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

ruby-changes:27910

From: akr <ko1@a...>
Date: Wed, 27 Mar 2013 12:03:46 +0900 (JST)
Subject: [ruby-changes:27910] akr:r39962 (trunk): * internal.h (TIMET_MAX_PLUS_ONE): definition simplified.

akr	2013-03-27 12:03:36 +0900 (Wed, 27 Mar 2013)

  New Revision: 39962

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

  Log:
    * internal.h (TIMET_MAX_PLUS_ONE): definition simplified.

  Modified files:
    trunk/ChangeLog
    trunk/internal.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39961)
+++ ChangeLog	(revision 39962)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Mar 27 12:02:45 2013  Tanaka Akira  <akr@f...>
+
+	* internal.h (TIMET_MAX_PLUS_ONE): definition simplified.
+
 Wed Mar 27 06:39:41 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/mkmf.rb (MAIN_DOES_NOTHING): force to refer symbols for tests
Index: internal.h
===================================================================
--- internal.h	(revision 39961)
+++ internal.h	(revision 39962)
@@ -22,14 +22,11 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/internal.h#L22
 #if SIGNEDNESS_OF_TIME_T < 0	/* signed */
 # define TIMET_MAX (time_t)((~(unsigned_time_t)0) >> 1)
 # define TIMET_MIN (time_t)(((unsigned_time_t)1) << (sizeof(time_t) * CHAR_BIT - 1))
-# define TIMET_MAX_PLUS_ONE \
-    (((time_t)1 << (sizeof(time_t) * CHAR_BIT / 2)) * (double)((time_t)1 << (sizeof(time_t) * CHAR_BIT / 2 - 1)))
 #elif SIGNEDNESS_OF_TIME_T > 0	/* unsigned */
 # define TIMET_MAX (time_t)(~(unsigned_time_t)0)
 # define TIMET_MIN (time_t)0
-# define TIMET_MAX_PLUS_ONE \
-    (((time_t)1 << (sizeof(time_t) * CHAR_BIT / 2)) * (double)((time_t)1 << (sizeof(time_t) * CHAR_BIT / 2))))
 #endif
+#define TIMET_MAX_PLUS_ONE (2*(double)(TIMET_MAX/2+1))
 
 struct rb_deprecated_classext_struct {
     char conflict[sizeof(VALUE) * 3];

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

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