[前][次][番号順一覧][スレッド一覧]

ruby-changes:30578

From: nobu <ko1@a...>
Date: Fri, 23 Aug 2013 11:17:29 +0900 (JST)
Subject: [ruby-changes:30578] nobu:r42657 (trunk): process.c: suppress warnings

nobu	2013-08-23 11:17:25 +0900 (Fri, 23 Aug 2013)

  New Revision: 42657

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42657

  Log:
    process.c: suppress warnings
    
    * process.c (rb_clock_gettime): cast for tv_nsec explicitly to
      suppress warnings by VC.

  Modified files:
    trunk/process.c
Index: process.c
===================================================================
--- process.c	(revision 42656)
+++ process.c	(revision 42657)
@@ -6886,7 +6886,7 @@ rb_clock_gettime(int argc, VALUE *argv) https://github.com/ruby/ruby/blob/trunk/process.c#L6886
                 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) https://github.com/ruby/ruby/blob/trunk/process.c#L6905
             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;
         }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]