diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-04-25 17:43:03 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-04-25 17:43:03 +0900 |
| commit | 92dcfbaab38f3d848dcbd13c84be32d9f70f6e4a (patch) | |
| tree | 3eca3534bb84d0ff990689da6322167264e53c2b | |
| parent | b08dced2a63b24c215aba913d3a1a2f4d62f6e8d (diff) | |
| download | mruby-92dcfbaab38f3d848dcbd13c84be32d9f70f6e4a.tar.gz mruby-92dcfbaab38f3d848dcbd13c84be32d9f70f6e4a.zip | |
Add explicit cast from double to long.
| -rw-r--r-- | mrbgems/mruby-time/src/time.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-time/src/time.c b/mrbgems/mruby-time/src/time.c index e367ddb64..33755f570 100644 --- a/mrbgems/mruby-time/src/time.c +++ b/mrbgems/mruby-time/src/time.c @@ -255,12 +255,12 @@ time_alloc(mrb_state *mrb, double sec, double usec, enum mrb_timezone timezone) tm->sec = tsec; tm->usec = (time_t)llround((sec - tm->sec) * 1.0e6 + usec); if (tm->usec < 0) { - long sec2 = NDIV(usec,1000000); /* negative div */ + long sec2 = (long)NDIV(usec,1000000); /* negative div */ tm->usec -= sec2 * 1000000; tm->sec += sec2; } else if (tm->usec >= 1000000) { - long sec2 = usec / 1000000; + long sec2 = (long)(usec / 1000000); tm->usec -= sec2 * 1000000; tm->sec += sec2; } |
