* 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
This commit is contained in:
parent
c3e7816a78
commit
5342ed85f9
@ -22,6 +22,12 @@ Tue May 27 17:54:35 2008 Akinori MUSHA <knu@iDaemons.org>
|
|||||||
* ext/stringio/stringio.c (strio_each_byte): Return self instead
|
* ext/stringio/stringio.c (strio_each_byte): Return self instead
|
||||||
of nil as the rdoc says.
|
of nil as the rdoc says.
|
||||||
|
|
||||||
|
Tue May 27 15:36:27 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* numeric.c (check_int): use PRIxVALUE format specifier.
|
||||||
|
|
||||||
|
* numeric.c (check_uint, rb_num2fix, int_chr): ditto.
|
||||||
|
|
||||||
Tue May 27 13:14:53 2008 Akinori MUSHA <knu@iDaemons.org>
|
Tue May 27 13:14:53 2008 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* enum.c (enum_to_a): Pass arguments through to #each().
|
* enum.c (enum_to_a): Pass arguments through to #each().
|
||||||
|
16
numeric.c
16
numeric.c
@ -1559,22 +1559,14 @@ check_int(SIGNED_VALUE num)
|
|||||||
else {
|
else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef LONG_LONG_VALUE
|
rb_raise(rb_eRangeError, "integer " PRIdVALUE " too %s to convert to `int'", num, s);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
check_uint(VALUE num)
|
check_uint(VALUE num)
|
||||||
{
|
{
|
||||||
if (num > UINT_MAX) {
|
if (num > UINT_MAX) {
|
||||||
#ifdef LONG_LONG_VALUE
|
rb_raise(rb_eRangeError, "integer " PRIuVALUE " too big to convert to `unsigned int'", num);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1644,7 +1636,7 @@ rb_num2fix(VALUE val)
|
|||||||
|
|
||||||
v = rb_num2long(val);
|
v = rb_num2long(val);
|
||||||
if (!FIXABLE(v))
|
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);
|
return LONG2FIX(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1872,7 +1864,7 @@ int_chr(int argc, VALUE *argv, VALUE num)
|
|||||||
case 0:
|
case 0:
|
||||||
if (i < 0 || 0xff < i) {
|
if (i < 0 || 0xff < i) {
|
||||||
out_of_range:
|
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;
|
c = i;
|
||||||
if (i < 0x80) {
|
if (i < 0x80) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user