diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-23 02:17:25 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-23 02:17:25 +0000 |
commit | fb8b2689dbfaab178d74a89928081df336868afe (patch) | |
tree | 3e26effd1425577c55067701da43a3b65a8731b1 | |
parent | d12cf192dec5f7aa6e771167b55f44070ed6670a (diff) |
process.c: suppress warnings
* process.c (rb_clock_gettime): cast for tv_nsec explicitly to
suppress warnings by VC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | process.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -6886,7 +6886,7 @@ rb_clock_gettime(int argc, VALUE *argv) rb_sys_fail("times"); ns = ((double)buf.tms_utime + buf.tms_stime) * (1e9 / get_clk_tck()); ts.tv_sec = (time_t)(ns*1e-9); - ts.tv_nsec = ns - ts.tv_sec*1e9; + ts.tv_nsec = (long)(ns - ts.tv_sec*1e9); goto success; } #endif @@ -6905,7 +6905,7 @@ rb_clock_gettime(int argc, VALUE *argv) ns = (uc*1e9) / CLOCKS_PER_SEC; /* uc*1e9 doesn't lose data if clock_t is 32bit. */ s = floor(ns*1e-9); ts.tv_sec = (time_t)s; - ts.tv_nsec = ns - s*1e9; + ts.tv_nsec = (long)(ns - s*1e9); goto success; } |