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

ruby-changes:27891

From: akr <ko1@a...>
Date: Tue, 26 Mar 2013 23:46:09 +0900 (JST)
Subject: [ruby-changes:27891] akr:r39943 (trunk): * internal.h: Define TIMET_MAX and TIMET_MIN here.

akr	2013-03-26 23:45:55 +0900 (Tue, 26 Mar 2013)

  New Revision: 39943

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

  Log:
    * internal.h: Define TIMET_MAX and TIMET_MIN here.
    
    * time.c: Remove TIMET_MAX and TIMET_MIN definitions.
    
    * thread.c: Ditto.
    
    * thread_pthread.c: Remove TIMET_MAX definition.
    
    * thread_win32.c: Ditto.

  Modified files:
    trunk/ChangeLog
    trunk/internal.h
    trunk/thread.c
    trunk/thread_pthread.c
    trunk/thread_win32.c
    trunk/time.c

Index: thread_win32.c
===================================================================
--- thread_win32.c	(revision 39942)
+++ thread_win32.c	(revision 39943)
@@ -516,8 +516,6 @@ typedef unsigned LONG_LONG unsigned_time https://github.com/ruby/ruby/blob/trunk/thread_win32.c#L516
 # error cannot find integer type which size is same as time_t.
 #endif
 
-#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
-
 static struct timespec
 native_cond_timeout(rb_thread_cond_t *cond, struct timespec timeout_rel)
 {
Index: time.c
===================================================================
--- time.c	(revision 39942)
+++ time.c	(revision 39943)
@@ -736,9 +736,6 @@ typedef unsigned LONG_LONG unsigned_time https://github.com/ruby/ruby/blob/trunk/time.c#L736
 # error cannot find integer type which size is same as time_t.
 #endif
 
-#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
-#define TIMET_MIN (~(time_t)0 <= 0 ? (time_t)(((unsigned_time_t)1) << (sizeof(time_t) * CHAR_BIT - 1)) : (time_t)0)
-
 static wideval_t
 rb_time_magnify(wideval_t w)
 {
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39942)
+++ ChangeLog	(revision 39943)
@@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Mar 26 23:41:18 2013  Tanaka Akira  <akr@f...>
+
+	* internal.h: Define TIMET_MAX and TIMET_MIN here.
+
+	* time.c: Remove TIMET_MAX and TIMET_MIN definitions.
+
+	* thread.c: Ditto.
+
+	* thread_pthread.c: Remove TIMET_MAX definition.
+
+	* thread_win32.c: Ditto.
+	
 Tue Mar 26 22:31:10 2013  Tanaka Akira  <akr@f...>
 
 	* ext/socket/socket.c (sockaddr_len): return the shortest length for
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 39942)
+++ thread_pthread.c	(revision 39943)
@@ -376,8 +376,6 @@ typedef unsigned LONG_LONG unsigned_time https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L376
 # error cannot find integer type which size is same as time_t.
 #endif
 
-#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
-
 static struct timespec
 native_cond_timeout(rb_thread_cond_t *cond, struct timespec timeout_rel)
 {
Index: thread.c
===================================================================
--- thread.c	(revision 39942)
+++ thread.c	(revision 39943)
@@ -73,9 +73,6 @@ https://github.com/ruby/ruby/blob/trunk/thread.c#L73
 #define THREAD_DEBUG 0
 #endif
 
-#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
-#define TIMET_MIN (~(time_t)0 <= 0 ? (time_t)(((unsigned_time_t)1) << (sizeof(time_t) * CHAR_BIT - 1)) : (time_t)0)
-
 VALUE rb_cMutex;
 VALUE rb_cThreadShield;
 
Index: internal.h
===================================================================
--- internal.h	(revision 39942)
+++ internal.h	(revision 39943)
@@ -19,6 +19,9 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/internal.h#L19
 #endif
 #endif
 
+#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
+#define TIMET_MIN (~(time_t)0 <= 0 ? (time_t)(((unsigned_time_t)1) << (sizeof(time_t) * CHAR_BIT - 1)) : (time_t)0)
+
 struct rb_deprecated_classext_struct {
     char conflict[sizeof(VALUE) * 3];
 };

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

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