summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-27 12:44:52 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-27 12:44:52 +0000
commit5342ed85f9c0d130d15540e042f739255ca05ab5 (patch)
treeaa9140884dd02eafccc8770146c71416455b7f37 /numeric.c
parentc3e7816a7834d7361a2b1f394e6992962f9924f3 (diff)
* numeric.c (check_int): use PRIxVALUE format specifier.
* numeric.c (check_uint, rb_num2fix, int_chr): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/numeric.c b/numeric.c
index 999c970..95e44a2 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1559,22 +1559,14 @@ check_int(SIGNED_VALUE num)
else {
return;
}
-#ifdef LONG_LONG_VALUE
- rb_raise(rb_eRangeError, "integer %lld too %s to convert to `int'", num, s);
-#else
- rb_raise(rb_eRangeError, "integer %ld too %s to convert to `int'", num, s);
-#endif
+ rb_raise(rb_eRangeError, "integer " PRIdVALUE " too %s to convert to `int'", num, s);
}
static void
check_uint(VALUE num)
{
if (num > UINT_MAX) {
-#ifdef LONG_LONG_VALUE
- rb_raise(rb_eRangeError, "integer %llu too big to convert to `unsigned int'", num);
-#else
- rb_raise(rb_eRangeError, "integer %lu too big to convert to `unsigned int'", num);
-#endif
+ rb_raise(rb_eRangeError, "integer " PRIuVALUE " too big to convert to `unsigned int'", num);
}
}
@@ -1644,7 +1636,7 @@ rb_num2fix(VALUE val)
v = rb_num2long(val);
if (!FIXABLE(v))
- rb_raise(rb_eRangeError, "integer %ld out of range of fixnum", v);
+ rb_raise(rb_eRangeError, "integer " PRIdVALUE " out of range of fixnum", v);
return LONG2FIX(v);
}
@@ -1872,7 +1864,7 @@ int_chr(int argc, VALUE *argv, VALUE num)
case 0:
if (i < 0 || 0xff < i) {
out_of_range:
- rb_raise(rb_eRangeError, "%ld out of char range", i);
+ rb_raise(rb_eRangeError, PRIdVALUE " out of char range", i);
}
c = i;
if (i < 0x80) {