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

ruby-changes:29131

From: akr <ko1@a...>
Date: Sat, 8 Jun 2013 23:57:39 +0900 (JST)
Subject: [ruby-changes:29131] akr:r41183 (trunk): * numeric.c (rb_num_to_uint): Use rb_absint_size instead of

akr	2013-06-08 23:57:28 +0900 (Sat, 08 Jun 2013)

  New Revision: 41183

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

  Log:
    * numeric.c (rb_num_to_uint): Use rb_absint_size instead of
      RBIGNUM_LEN.

  Modified files:
    trunk/ChangeLog
    trunk/numeric.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41182)
+++ ChangeLog	(revision 41183)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jun  8 23:56:00 2013  Tanaka Akira  <akr@f...>
+
+	* numeric.c (rb_num_to_uint): Use rb_absint_size instead of
+	  RBIGNUM_LEN.
+
 Sat Jun  8 22:53:45 2013  Tanaka Akira  <akr@f...>
 
 	* marshal.c (r_object0): Use rb_integer_unpack.
Index: numeric.c
===================================================================
--- numeric.c	(revision 41182)
+++ numeric.c	(revision 41183)
@@ -142,8 +142,7 @@ rb_num_to_uint(VALUE val, unsigned int * https://github.com/ruby/ruby/blob/trunk/numeric.c#L142
 	return NUMERR_TOOLARGE;
 #else
 	/* long is 32bit */
-#define DIGSPERLONG (SIZEOF_LONG/SIZEOF_BDIGITS)
-	if (RBIGNUM_LEN(val) > DIGSPERLONG) return NUMERR_TOOLARGE;
+	if (rb_absint_size(val, NULL) > sizeof(int)) return NUMERR_TOOLARGE;
 	*ret = (unsigned int)rb_big2ulong((VALUE)val);
 	return 0;
 #endif

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

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