New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce -Wconversion warnings for date-time code #687

Merged
merged 2 commits into from May 5, 2017

Conversation

Projects
None yet
5 participants
@krlmlr
Contributor

krlmlr commented May 5, 2017

As discussed on Rcpp-devel.

Show outdated Hide outdated inst/include/Rcpp/date_datetime/Date.h
@@ -127,7 +127,7 @@ namespace Rcpp {
// update m_tm based on m_d
void update_tm() {
if (R_FINITE(m_d)) {
time_t t = 24*60*60 * m_d; // (fractional) days since epoch to seconds since epoch
time_t t = (time_t)(24*60*60 * m_d); // (fractional) days since epoch to seconds since epoch

This comment has been minimized.

@coatless

coatless May 5, 2017

Contributor

I think you may need to use a static_cast<time_t>() in place of the c-style / regular cast.

@coatless

coatless May 5, 2017

Contributor

I think you may need to use a static_cast<time_t>() in place of the c-style / regular cast.

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io May 5, 2017

Codecov Report

Merging #687 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #687   +/-   ##
=======================================
  Coverage   89.77%   89.77%           
=======================================
  Files          66       66           
  Lines        3511     3511           
=======================================
  Hits         3152     3152           
  Misses        359      359

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c57b754...9dbbcb5. Read the comment docs.

codecov-io commented May 5, 2017

Codecov Report

Merging #687 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #687   +/-   ##
=======================================
  Coverage   89.77%   89.77%           
=======================================
  Files          66       66           
  Lines        3511     3511           
=======================================
  Hits         3152     3152           
  Misses        359      359

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c57b754...9dbbcb5. Read the comment docs.

@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel May 5, 2017

Member

This looks good to me. It would help if we had more tests for some of the rounding etc issues, but blame for that is mostly on me.

Member

eddelbuettel commented May 5, 2017

This looks good to me. It would help if we had more tests for some of the rounding etc issues, but blame for that is mostly on me.

@eddelbuettel eddelbuettel merged commit 5f20d1a into RcppCore:master May 5, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@krlmlr krlmlr deleted the krlmlr:f-Wconversion-1 branch Mar 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment