summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-10 10:37:39 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-10 10:37:39 +0000
commit0e8caa7d0f79c9514b4b4dbe9ac88b08e822e387 (patch)
tree4490705929fdb1765569a900d081e93c9f2d49f1 /ext
parenta8aaf133921e5cfcf6e0ee88dc6b69e9c52ecf75 (diff)
* bignum.c (rb_integer_pack): Returns sign instead of words.
(absint_numwords_generic): Follow the above change. (big2str_base_powerof2): Follow the above change. * internal.h: Ditto. * hash.c (rb_hash): Ditto. * pack.c (pack_pack): Ditto. * random.c (int_pair_to_real_inclusive): Ditto. (rand_init): Ditto. (random_load): Ditto. (limited_big_rand): Ditto. * time.c (v2w_bignum): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/-test-/bignum/pack.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/-test-/bignum/pack.c b/ext/-test-/bignum/pack.c
index 8634e1e..62f8f62 100644
--- a/ext/-test-/bignum/pack.c
+++ b/ext/-test-/bignum/pack.c
@@ -6,17 +6,16 @@ rb_integer_pack_m(VALUE val, VALUE buf, VALUE wordsize_arg, VALUE nails, VALUE f
{
int sign;
size_t count = 0;
- void *ret;
size_t wordsize = NUM2SIZET(wordsize_arg);
StringValue(buf);
rb_str_modify(buf);
count = wordsize == 0 ? 0 : RSTRING_LEN(buf) / wordsize;
- ret = rb_integer_pack(val,
- &sign, RSTRING_PTR(buf), count,
+ sign = rb_integer_pack(val,
+ RSTRING_PTR(buf), count,
wordsize, NUM2SIZET(nails), NUM2INT(flags));
- return rb_ary_new_from_args(3, INT2NUM(sign), ret ? rb_str_new(ret, wordsize * count) : Qnil, SIZET2NUM(count));
+ return rb_ary_new_from_args(3, INT2NUM(sign), rb_str_new(RSTRING_PTR(buf), wordsize * count), SIZET2NUM(count));
}
static VALUE