summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-16 09:53:45 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-16 09:53:45 +0000
commitecabbf1bf606305bb553100700e1edb487604ecc (patch)
treeb9173748f7e09561c37c02efe9107d518b933266 /sprintf.c
parentfc3fbc143cc5ee95758b561a59d6b856c492bbb4 (diff)
* internal.h (INTEGER_PACK_2COMP): Defined.
(rb_integer_pack_2comp): Removed. * bignum.c (bary_pack): Support INTEGER_PACK_2COMP. (rb_integer_pack): Invoke bary_pack directly. (rb_integer_pack_2comp): Removed. (rb_integer_pack_internal): Ditto. (absint_numwords_generic): Follow the above change. * pack.c (pack_pack): Ditto. * sprintf.c (rb_str_format): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sprintf.c b/sprintf.c
index b025b51..b66d34e 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -856,8 +856,8 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
(!bignum ? v < 0 : RBIGNUM_NEGATIVE_P(val))))
numdigits++;
tmp = rb_str_new(NULL, numdigits);
- valsign = rb_integer_pack_2comp(val, RSTRING_PTR(tmp), RSTRING_LEN(tmp),
- 1, CHAR_BIT-numbits, INTEGER_PACK_BIG_ENDIAN);
+ valsign = rb_integer_pack(val, RSTRING_PTR(tmp), RSTRING_LEN(tmp),
+ 1, CHAR_BIT-numbits, INTEGER_PACK_2COMP | INTEGER_PACK_BIG_ENDIAN);
for (i = 0; i < RSTRING_LEN(tmp); i++)
RSTRING_PTR(tmp)[i] = ruby_digitmap[((unsigned char *)RSTRING_PTR(tmp))[i]];
s = RSTRING_PTR(tmp);