* bignum.c (roomof): Cast to long.

(rb_ull2big): Fix bignew arguments.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2013-07-02 14:49:06 +00:00
Родитель d74bb62dcc
Коммит c78826190f
2 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Jul 2 23:47:50 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (roomof): Cast to long.
(rb_ull2big): Fix bignew arguments.
Tue Jul 2 21:17:37 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (rb_cstr_to_inum): Merge two temporary buffers.

Просмотреть файл

@ -80,7 +80,7 @@ static VALUE big_three = Qnil;
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
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