summaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-10 05:43:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-10 05:43:14 +0000
commite01999392c6700f85e3cb6f5fe71176199b04d09 (patch)
tree74d9b6baff5943a68e4339f1f5d7f1a668d8e421 /bignum.c
parent824b38d8b71a7959e716c42557195d18cc6b5b90 (diff)
downloadruby-e01999392c6700f85e3cb6f5fe71176199b04d09.tar.gz
ruby-e01999392c6700f85e3cb6f5fe71176199b04d09.tar.xz
ruby-e01999392c6700f85e3cb6f5fe71176199b04d09.zip
* array.c, bignum.c, gc.c, numeric.c, string.c, util.c, insns.def,
missing/crypt.c, missing/vsnprintf.c, : suppress warnings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bignum.c b/bignum.c
index 7f01917e9..c03b046d0 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1025,7 +1025,7 @@ rb_big2ulong_pack(VALUE x)
{
VALUE num = big2ulong(x, "unsigned long", Qfalse);
if (!RBIGNUM_SIGN(x)) {
- return -num;
+ return (VALUE)(-(SIGNED_VALUE)num);
}
return num;
}
@@ -1039,7 +1039,7 @@ rb_big2ulong(VALUE x)
if ((SIGNED_VALUE)num < 0) {
rb_raise(rb_eRangeError, "bignum out of range of unsigned long");
}
- return -num;
+ return (VALUE)(-(SIGNED_VALUE)num);
}
return num;
}
@@ -1082,7 +1082,8 @@ rb_big2ull(VALUE x)
{
unsigned LONG_LONG num = big2ull(x, "unsigned long long");
- if (!RBIGNUM_SIGN(x)) return -num;
+ if (!RBIGNUM_SIGN(x))
+ return (VALUE)(-(SIGNED_VALUE)num);
return num;
}