mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bignum.c (rb_absint_numwords): Renamed from rb_absint_size_in_word.
* internal.h (rb_absint_numwords): Follow the above change. * pack.c (pack_pack): Ditto. * random.c (rand_init): Ditto. (limited_big_rand): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
837392b452
commit
f5ad120b97
5 changed files with 17 additions and 6 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
Sun Jun 9 16:51:41 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (rb_absint_numwords): Renamed from rb_absint_size_in_word.
|
||||
|
||||
* internal.h (rb_absint_numwords): Follow the above change.
|
||||
|
||||
* pack.c (pack_pack): Ditto.
|
||||
|
||||
* random.c (rand_init): Ditto.
|
||||
(limited_big_rand): Ditto.
|
||||
|
||||
Sun Jun 9 14:41:05 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (rb_integer_pack): numwords_allocated argument removed.
|
||||
|
|
4
bignum.c
4
bignum.c
|
@ -500,7 +500,7 @@ rb_absint_size(VALUE val, int *number_of_leading_zero_bits)
|
|||
}
|
||||
|
||||
size_t
|
||||
rb_absint_size_in_word(VALUE val, size_t word_numbits_arg, size_t *number_of_leading_zero_bits)
|
||||
rb_absint_numwords(VALUE val, size_t word_numbits_arg, size_t *number_of_leading_zero_bits)
|
||||
{
|
||||
size_t numbytes;
|
||||
size_t numwords;
|
||||
|
@ -1662,7 +1662,7 @@ big2str_base_powerof2(VALUE x, size_t len, int base, int trim)
|
|||
size_t numwords;
|
||||
VALUE result;
|
||||
char *ptr;
|
||||
numwords = trim ? rb_absint_size_in_word(x, word_numbits, NULL) : len;
|
||||
numwords = trim ? rb_absint_numwords(x, word_numbits, NULL) : len;
|
||||
if (RBIGNUM_NEGATIVE_P(x) || !trim) {
|
||||
if (LONG_MAX-1 < numwords)
|
||||
rb_raise(rb_eArgError, "too big number");
|
||||
|
|
|
@ -120,7 +120,7 @@ VALUE rb_big_uminus(VALUE x);
|
|||
VALUE rb_integer_float_cmp(VALUE x, VALUE y);
|
||||
VALUE rb_integer_float_eq(VALUE x, VALUE y);
|
||||
size_t rb_absint_size(VALUE val, int *number_of_leading_zero_bits);
|
||||
size_t rb_absint_size_in_word(VALUE val, size_t word_numbits, size_t *number_of_leading_zero_bits);
|
||||
size_t rb_absint_numwords(VALUE val, size_t word_numbits, size_t *number_of_leading_zero_bits);
|
||||
int rb_absint_singlebit_p(VALUE val);
|
||||
|
||||
/* class.c */
|
||||
|
|
2
pack.c
2
pack.c
|
@ -1018,7 +1018,7 @@ pack_pack(VALUE ary, VALUE fmt)
|
|||
|
||||
from = NEXTFROM;
|
||||
from = rb_to_int(from);
|
||||
numbytes = rb_absint_size_in_word(from, 7, NULL);
|
||||
numbytes = rb_absint_numwords(from, 7, NULL);
|
||||
if (numbytes == 0)
|
||||
numbytes = 1;
|
||||
buf = rb_str_new(NULL, numbytes);
|
||||
|
|
4
random.c
4
random.c
|
@ -375,7 +375,7 @@ rand_init(struct MT *mt, VALUE vseed)
|
|||
|
||||
seed = rb_to_int(vseed);
|
||||
|
||||
len = rb_absint_size_in_word(seed, 32, NULL);
|
||||
len = rb_absint_numwords(seed, 32, NULL);
|
||||
if (MT_MAX_STATE < len)
|
||||
len = MT_MAX_STATE;
|
||||
if (len > numberof(buf0))
|
||||
|
@ -750,7 +750,7 @@ limited_big_rand(struct MT *mt, VALUE limit)
|
|||
VALUE vtmp;
|
||||
VALUE val;
|
||||
|
||||
len = rb_absint_size_in_word(limit, 32, NULL);
|
||||
len = rb_absint_numwords(limit, 32, NULL);
|
||||
tmp = ALLOCV_N(uint32_t, vtmp, len*2);
|
||||
lim_array = tmp;
|
||||
rnd_array = tmp + len;
|
||||
|
|
Loading…
Add table
Reference in a new issue