aboutsummaryrefslogtreecommitdiffstats
path: root/hrtime.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-27 05:48:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-27 05:48:41 +0000
commit26d63d60de5cbc7621d1d9bac4c6a293907fa964 (patch)
treee18ec9a1d0857ae22b932630bcbd5ea0064b3845 /hrtime.h
parentcf889f5bfc1a4f2852f8c5c1083e7beff6597933 (diff)
downloadruby-26d63d60de5cbc7621d1d9bac4c6a293907fa964.tar.gz
hrtime.h: explicit casts to time_t
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hrtime.h')
-rw-r--r--hrtime.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/hrtime.h b/hrtime.h
index 9fa066687d..68e478e7af 100644
--- a/hrtime.h
+++ b/hrtime.h
@@ -142,7 +142,7 @@ static inline struct timespec *
rb_hrtime2timespec(struct timespec *ts, const rb_hrtime_t *hrt)
{
if (hrt) {
- ts->tv_sec = *hrt / RB_HRTIME_PER_SEC;
+ ts->tv_sec = (time_t)(*hrt / RB_HRTIME_PER_SEC);
ts->tv_nsec = (int32_t)(*hrt % RB_HRTIME_PER_SEC);
return ts;
}
@@ -157,7 +157,7 @@ static inline struct timeval *
rb_hrtime2timeval(struct timeval *tv, const rb_hrtime_t *hrt)
{
if (hrt) {
- tv->tv_sec = *hrt / RB_HRTIME_PER_SEC;
+ tv->tv_sec = (time_t)*hrt / RB_HRTIME_PER_SEC;
tv->tv_usec = (int32_t)((*hrt % RB_HRTIME_PER_SEC)/RB_HRTIME_PER_USEC);
return tv;