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

ruby-changes:29697

From: charliesome <ko1@a...>
Date: Tue, 2 Jul 2013 22:16:45 +0900 (JST)
Subject: [ruby-changes:29697] charliesome:r41749 (trunk): * bignum.c (rb_cstr_to_inum): fix 64 bit to 32 bit shorten warning

charliesome	2013-07-02 22:16:35 +0900 (Tue, 02 Jul 2013)

  New Revision: 41749

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

  Log:
    * bignum.c (rb_cstr_to_inum): fix 64 bit to 32 bit shorten warning

  Modified files:
    trunk/bignum.c

Index: bignum.c
===================================================================
--- bignum.c	(revision 41748)
+++ bignum.c	(revision 41749)
@@ -2107,8 +2107,8 @@ rb_cstr_to_inum(const char *str, int bas https://github.com/ruby/ruby/blob/trunk/bignum.c#L2107
             vds = uds + num_bdigits;
 
             powerv = bignew(2, 1);
-            BDIGITS(powerv)[0] = BIGLO(power);
-            BDIGITS(powerv)[1] = BIGDN(power);
+            BDIGITS(powerv)[0] = (BDIGIT)BIGLO(power);
+            BDIGITS(powerv)[1] = (BDIGIT)BIGDN(power);
 
             i = 0;
             while (buf < p) {
@@ -2124,8 +2124,8 @@ rb_cstr_to_inum(const char *str, int bas https://github.com/ruby/ruby/blob/trunk/bignum.c#L2124
                 for (j = 0; j < m; j++) {
                     d = d * base + p[j];
                 }
-                uds[i++] = BIGLO(d);
-                uds[i++] = BIGDN(d);
+                uds[i++] = (BDIGIT)BIGLO(d);
+                uds[i++] = (BDIGIT)BIGDN(d);
             }
             for (unit = 2; unit < num_bdigits; unit *= 2) {
                 for (i = 0; i < num_bdigits; i += unit*2) {

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

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