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

ruby-changes:49769

From: nobu <ko1@a...>
Date: Wed, 17 Jan 2018 20:16:28 +0900 (JST)
Subject: [ruby-changes:49769] nobu:r61887 (trunk): process.c: remove useless cast

nobu	2018-01-17 20:16:24 +0900 (Wed, 17 Jan 2018)

  New Revision: 61887

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61887

  Log:
    process.c: remove useless cast
    
    * process.c (get_clk_tck): remove useless cast, implicitly cast to
      long again.
    
    * process.c (rb_proc_times): cast explicitly.

  Modified files:
    trunk/process.c
Index: process.c
===================================================================
--- process.c	(revision 61886)
+++ process.c	(revision 61887)
@@ -6884,7 +6884,7 @@ get_clk_tck(void) https://github.com/ruby/ruby/blob/trunk/process.c#L6884
 {
     long hertz =
 #ifdef HAVE__SC_CLK_TCK
-	(double)sysconf(_SC_CLK_TCK);
+	sysconf(_SC_CLK_TCK);
 #else
 #ifndef HZ
 # ifdef CLK_TCK
@@ -6924,7 +6924,7 @@ rb_proc_times(VALUE obj) https://github.com/ruby/ruby/blob/trunk/process.c#L6924
     cutime = DBL2NUM((double)usage_c.ru_utime.tv_sec + (double)usage_c.ru_utime.tv_usec/1e6);
     cstime = DBL2NUM((double)usage_c.ru_stime.tv_sec + (double)usage_c.ru_stime.tv_usec/1e6);
 #else
-    const double hertz = get_clk_tck();
+    const double hertz = (double)get_clk_tck();
     struct tms buf;
 
     times(&buf);

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

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