Skip to content

Commit

Permalink
even more fixes for MSVC, re #49
Browse files Browse the repository at this point in the history
  • Loading branch information
gentryx committed Feb 20, 2017
1 parent 3461fac commit 5d10f7e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libgeodecomp/io/timestringconversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class TimeStringConversion
static std::string renderISO(double time)
{
double intFraction;
int uSecondsSinceEpoch = std::modf(time, &intFraction) * 1.0e6;
time_t secondsSinceEpoch = intFraction;
int uSecondsSinceEpoch = int(std::modf(time, &intFraction) * 1.0e6);
time_t secondsSinceEpoch = time_t(intFraction);
tm timeSpec;
gmtime_r(&secondsSinceEpoch, &timeSpec);
gmtime(&secondsSinceEpoch, &timeSpec);
char buf[1024];
strftime(buf, 1024, "%Y.%m.%d %H:%M:%S", &timeSpec);

Expand All @@ -37,7 +37,7 @@ class TimeStringConversion
double realSeconds;
double subseconds = std::modf(duration, &realSeconds);

int totalSeconds = realSeconds;
int totalSeconds = int(realSeconds);
int seconds = totalSeconds % 60;
int minutes = totalSeconds / 60 % 60;
int hours = totalSeconds / 3600;
Expand All @@ -48,7 +48,7 @@ class TimeStringConversion
<< std::setw(2) << std::setfill('0') << seconds;

if (subseconds > 0) {
int fraction = subseconds * 1.0e6;
int fraction = int(subseconds * 1.0e6);
buf << "." << std::setw(6) << fraction;
}

Expand Down

0 comments on commit 5d10f7e

Please sign in to comment.