Skip to content
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
Merged

Reduce -Wconversion warnings for date-time code #687

merged 2 commits into from
May 5, 2017

Conversation

krlmlr
Copy link
Contributor

@krlmlr krlmlr commented May 5, 2017

As discussed on Rcpp-devel.

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@codecov-io
Copy link

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
Copy link
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.

@eddelbuettel eddelbuettel merged commit 5f20d1a into RcppCore:master May 5, 2017
@krlmlr krlmlr deleted the f-Wconversion-1 branch March 7, 2018 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants