ruby-changes:29698
From: akr <ko1@a...>
Date: Tue, 2 Jul 2013 23:49:19 +0900 (JST)
Subject: [ruby-changes:29698] akr:r41750 (trunk): * bignum.c (roomof): Cast to long.
akr 2013-07-02 23:49:06 +0900 (Tue, 02 Jul 2013) New Revision: 41750 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41750 Log: * bignum.c (roomof): Cast to long. (rb_ull2big): Fix bignew arguments. Modified files: trunk/ChangeLog trunk/bignum.c Index: ChangeLog =================================================================== --- ChangeLog (revision 41749) +++ ChangeLog (revision 41750) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Jul 2 23:47:50 2013 Tanaka Akira <akr@f...> + + * bignum.c (roomof): Cast to long. + (rb_ull2big): Fix bignew arguments. + Tue Jul 2 21:17:37 2013 Tanaka Akira <akr@f...> * bignum.c (rb_cstr_to_inum): Merge two temporary buffers. Index: bignum.c =================================================================== --- bignum.c (revision 41749) +++ bignum.c (revision 41750) @@ -80,7 +80,7 @@ static VALUE big_three = Qnil; https://github.com/ruby/ruby/blob/trunk/bignum.c#L80 rb_absint_size(x, NULL)) #define BIGDIVREM_EXTRA_WORDS 2 -#define roomof(n, m) ((int)(((n)+(m)-1) / (m))) +#define roomof(n, m) ((long)(((n)+(m)-1) / (m))) #define bdigit_roomof(n) roomof(n, SIZEOF_BDIGITS) #define BARY_ARGS(ary) ary, numberof(ary) @@ -2199,7 +2199,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/bignum.c#L2199 rb_ull2big(unsigned LONG_LONG n) { long i; - VALUE big = bignew(DIGSPERLL, bdigit_roomof(SIZEOF_LONG_LONG)); + VALUE big = bignew(bdigit_roomof(SIZEOF_LONG_LONG), 1); BDIGIT *digits = BDIGITS(big); #if SIZEOF_BDIGITS >= SIZEOF_LONG_LONG -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/