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

ruby-changes:29215

From: akr <ko1@a...>
Date: Thu, 13 Jun 2013 06:14:08 +0900 (JST)
Subject: [ruby-changes:29215] akr:r41267 (trunk): * bignum.c (integer_unpack_num_bdigits_small): Fix a comple error on

akr	2013-06-13 06:13:56 +0900 (Thu, 13 Jun 2013)

  New Revision: 41267

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

  Log:
    * bignum.c (integer_unpack_num_bdigits_small): Fix a comple error on
      clang -Werror,-Wshorten-64-to-32
      Reported by Eric Hodel.  [ruby-core:55467] [Bug #8522]

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41266)
+++ ChangeLog	(revision 41267)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jun 13 06:12:18 2013  Tanaka Akira  <akr@f...>
+
+	* bignum.c (integer_unpack_num_bdigits_small): Fix a comple error on
+	  clang -Werror,-Wshorten-64-to-32
+	  Reported by Eric Hodel.  [ruby-core:55467] [Bug #8522]
+
 Thu Jun 13 05:32:13 2013  Eric Hodel  <drbrain@s...>
 
 	* ext/socket/extconf.rb:  Enable RFC 3542 IPV6 socket options for OS X
Index: bignum.c
===================================================================
--- bignum.c	(revision 41266)
+++ bignum.c	(revision 41267)
@@ -1125,7 +1125,7 @@ integer_unpack_num_bdigits_small(size_t https://github.com/ruby/ruby/blob/trunk/bignum.c#L1125
     /* nlp_bits stands for number of leading padding bits */
     size_t num_bits = (wordsize * CHAR_BIT - nails) * numwords;
     size_t num_bdigits = (num_bits + BITSPERDIG - 1) / BITSPERDIG;
-    *nlp_bits_ret = num_bdigits * BITSPERDIG - num_bits;
+    *nlp_bits_ret = (int)(num_bdigits * BITSPERDIG - num_bits);
     return num_bdigits;
 }
 
@@ -1224,7 +1224,7 @@ rb_integer_unpack_internal(const void *w https://github.com/ruby/ruby/blob/trunk/bignum.c#L1224
     BDIGIT_DBL dd;
     int numbits_in_dd;
 
-    if (numwords <= (SIZE_MAX - (SIZEOF_BDIGITS*CHAR_BIT-1)) / CHAR_BIT / wordsize) {
+    if (numwords <= (SIZE_MAX - (BITSPERDIG-1)) / CHAR_BIT / wordsize) {
         num_bdigits = integer_unpack_num_bdigits_small(numwords, wordsize, nails, nlp_bits_ret);
 #if 0
         {

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

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