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

ruby-changes:31742

From: nobu <ko1@a...>
Date: Sun, 24 Nov 2013 00:44:40 +0900 (JST)
Subject: [ruby-changes:31742] nobu:r43821 (trunk): ruby.h: define RBIGNUM_EMBED_LEN_MAX by macros

nobu	2013-11-24 00:44:34 +0900 (Sun, 24 Nov 2013)

  New Revision: 43821

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

  Log:
    ruby.h: define RBIGNUM_EMBED_LEN_MAX by macros
    
    * include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros
      defined in defines.h, instead of complex and repeated expression.

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/ruby.h
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 43820)
+++ include/ruby/ruby.h	(revision 43821)
@@ -1069,9 +1069,11 @@ struct RStruct { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1069
 
 #define RBIGNUM_EMBED_LEN_NUMBITS 3
 #ifndef RBIGNUM_EMBED_LEN_MAX
-# define RBIGNUM_EMBED_LEN_MAX \
-    (((int)((sizeof(VALUE)*3)/sizeof(BDIGIT))) < (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1 ? \
-     ((int)((sizeof(VALUE)*3)/sizeof(BDIGIT))) : (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1)
+# if (SIZEOF_VALUE*3/SIZEOF_BDIGITS) < (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1
+#   define RBIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*3/SIZEOF_BDIGITS)
+# else
+#   define RBIGNUM_EMBED_LEN_MAX ((1 << RBIGNUM_EMBED_LEN_NUMBITS)-1)
+# endif
 #endif
 struct RBignum {
     struct RBasic basic;
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43820)
+++ ChangeLog	(revision 43821)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Nov 24 00:44:30 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros
+	  defined in defines.h, instead of complex and repeated expression.
+
 Sat Nov 23 22:22:26 2013  Tanaka Akira  <akr@f...>
 
 	* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Limit the value to

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

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