mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* array.c, class.c, eval.c, file.c, gc.c, node.h, numeric.c,
object.c, parse.y, range.c, re.c, string.c, struct.c, util.c, ext/socket/socket.c: merge from 1.7: treat long values as long instead of int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@3003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
19de515b93
commit
0861cbd901
16 changed files with 45 additions and 39 deletions
|
|
@ -815,7 +815,7 @@ rb_num2int(val)
|
|||
long num = rb_num2long(val);
|
||||
|
||||
if (num < INT_MIN || INT_MAX < num) {
|
||||
rb_raise(rb_eRangeError, "integer %d too big to convert to `int'", num);
|
||||
rb_raise(rb_eRangeError, "integer %ld too big to convert to `int'", num);
|
||||
}
|
||||
return (int)num;
|
||||
}
|
||||
|
|
@ -827,7 +827,7 @@ rb_fix2int(val)
|
|||
long num = FIXNUM_P(val)?FIX2LONG(val):rb_num2long(val);
|
||||
|
||||
if (num < INT_MIN || INT_MAX < num) {
|
||||
rb_raise(rb_eRangeError, "integer %d too big to convert to `int'", num);
|
||||
rb_raise(rb_eRangeError, "integer %ld too big to convert to `int'", num);
|
||||
}
|
||||
return (int)num;
|
||||
}
|
||||
|
|
@ -857,7 +857,7 @@ rb_num2fix(val)
|
|||
|
||||
v = rb_num2long(val);
|
||||
if (!FIXABLE(v))
|
||||
rb_raise(rb_eRangeError, "integer %d out of range of fixnum", v);
|
||||
rb_raise(rb_eRangeError, "integer %ld out of range of fixnum", v);
|
||||
return INT2FIX(v);
|
||||
}
|
||||
|
||||
|
|
@ -890,7 +890,7 @@ int_chr(num)
|
|||
long i = NUM2LONG(num);
|
||||
|
||||
if (i < 0 || 0xff < i)
|
||||
rb_raise(rb_eRangeError, "%d out of char range", i);
|
||||
rb_raise(rb_eRangeError, "%ld out of char range", i);
|
||||
c = i;
|
||||
return rb_str_new(&c, 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue