summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-23 02:17:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-23 02:17:25 +0000
commitfb8b2689dbfaab178d74a89928081df336868afe (patch)
tree3e26effd1425577c55067701da43a3b65a8731b1 /process.c
parentd12cf192dec5f7aa6e771167b55f44070ed6670a (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
Diffstat (limited to 'process.c')
-rw-r--r--process.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/process.c b/process.c
index 8bf0313e75..58d6a07bbf 100644
--- a/process.c
+++ b/process.c
@@ -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;
}