summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-09 07:53:20 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-09 07:53:20 (GMT)
commitf5ad120b9798d58d20e67dc458a5f5005482a1d8 (patch)
tree76c1ec9d309a7cf8c88c8e22319d6e427ef9a4ff
parent837392b45260785a8ccc13aceba5be90e067a974 (diff)
* 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
-rw-r--r--ChangeLog11
-rw-r--r--bignum.c4
-rw-r--r--internal.h2
-rw-r--r--pack.c2
-rw-r--r--random.c4
5 files changed, 17 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 458229b..3e9778e 100644
--- a/ChangeLog
+++ b/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.
diff --git a/bignum.c b/bignum.c
index b4606c5..78cc893 100644
--- a/bignum.c
+++ b/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");
diff --git a/internal.h b/internal.h
index fc8fc1c..da0ee34 100644
--- a/internal.h
+++ b/internal.h
@@ -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 */
diff --git a/pack.c b/pack.c
index 67ee20d..b5545f7 100644
--- a/pack.c
+++ b/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);
diff --git a/random.c b/random.c
index 3241874..b664dbd 100644
--- a/random.c
+++ b/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;