ruby-changes:52344
From: nobu <ko1@a...>
Date: Mon, 27 Aug 2018 14:48:47 +0900 (JST)
Subject: [ruby-changes:52344] nobu:r64552 (trunk): hrtime.h: explicit casts to time_t
nobu 2018-08-27 14:48:41 +0900 (Mon, 27 Aug 2018) New Revision: 64552 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64552 Log: hrtime.h: explicit casts to time_t Modified files: trunk/hrtime.h Index: hrtime.h =================================================================== --- hrtime.h (revision 64551) +++ hrtime.h (revision 64552) @@ -142,7 +142,7 @@ static inline struct timespec * https://github.com/ruby/ruby/blob/trunk/hrtime.h#L142 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 * https://github.com/ruby/ruby/blob/trunk/hrtime.h#L157 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/