зеркало из https://github.com/github/ruby.git
* bignum.c (rb_absint_size): Use numberof.
(rb_int_export): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
bd15d4ca78
Коммит
84d8e58249
|
@ -1,3 +1,8 @@
|
|||
Fri Jun 7 19:23:15 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (rb_absint_size): Use numberof.
|
||||
(rb_int_export): Ditto.
|
||||
|
||||
Fri Jun 7 18:58:56 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* internal.h (numberof): Gathered from various files.
|
||||
|
|
8
bignum.c
8
bignum.c
|
@ -473,14 +473,14 @@ rb_absint_size(VALUE val, int *number_of_leading_zero_bits)
|
|||
#else
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (int)(sizeof(fixbuf)/sizeof(*fixbuf)); i++) {
|
||||
for (i = 0; i < numberof(fixbuf); i++) {
|
||||
fixbuf[i] = (BDIGIT)(v & ((1L << (SIZEOF_BDIGITS * CHAR_BIT)) - 1));
|
||||
v >>= SIZEOF_BDIGITS * CHAR_BIT;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
dp = fixbuf;
|
||||
de = fixbuf + sizeof(fixbuf)/sizeof(*fixbuf);
|
||||
de = fixbuf + numberof(fixbuf);
|
||||
}
|
||||
else {
|
||||
dp = BDIGITS(val);
|
||||
|
@ -626,14 +626,14 @@ rb_int_export(VALUE val, int *signp, size_t *wordcount_allocated, void *words, s
|
|||
#else
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (int)(sizeof(fixbuf)/sizeof(*fixbuf)); i++) {
|
||||
for (i = 0; i < numberof(fixbuf); i++) {
|
||||
fixbuf[i] = (BDIGIT)(v & ((1L << (SIZEOF_BDIGITS * CHAR_BIT)) - 1));
|
||||
v >>= SIZEOF_BDIGITS * CHAR_BIT;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
dp = fixbuf;
|
||||
de = fixbuf + sizeof(fixbuf)/sizeof(*fixbuf);
|
||||
de = fixbuf + numberof(fixbuf);
|
||||
}
|
||||
else {
|
||||
sign = RBIGNUM_POSITIVE_P(val) ? 1 : -1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче