mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* array.c: fixed format string for 'long' args (%d -> %ld).
* class.c: ditto. * eval.c: ditto. * numeric.c: ditto. * pack.c: ditto. * parse.y: ditto. * range.c: ditto. * string.c: ditto. * util.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ff3d6d201d
commit
bab153b243
9 changed files with 21 additions and 21 deletions
8
array.c
8
array.c
|
@ -292,7 +292,7 @@ rb_ary_store(ary, idx, val)
|
|||
if (idx < 0) {
|
||||
idx += RARRAY(ary)->len;
|
||||
if (idx < 0) {
|
||||
rb_raise(rb_eIndexError, "index %d out of array",
|
||||
rb_raise(rb_eIndexError, "index %ld out of array",
|
||||
idx - RARRAY(ary)->len);
|
||||
}
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ rb_ary_fetch(argc, argv, ary)
|
|||
return rb_yield(pos);
|
||||
}
|
||||
if (argc == 1) {
|
||||
rb_raise(rb_eIndexError, "index %d out of array", idx);
|
||||
rb_raise(rb_eIndexError, "index %ld out of array", idx);
|
||||
}
|
||||
return ifnone;
|
||||
}
|
||||
|
@ -642,12 +642,12 @@ rb_ary_update(ary, beg, len, rpl)
|
|||
rpl = rb_ary_to_ary(rpl);
|
||||
rlen = RARRAY(rpl)->len;
|
||||
|
||||
if (len < 0) rb_raise(rb_eIndexError, "negative length (%d)", len);
|
||||
if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);
|
||||
if (beg < 0) {
|
||||
beg += RARRAY(ary)->len;
|
||||
if (beg < 0) {
|
||||
beg -= RARRAY(ary)->len;
|
||||
rb_raise(rb_eIndexError, "index %d out of array", beg);
|
||||
rb_raise(rb_eIndexError, "index %ld out of array", beg);
|
||||
}
|
||||
}
|
||||
if (beg + len > RARRAY(ary)->len) {
|
||||
|
|
2
class.c
2
class.c
|
@ -694,7 +694,7 @@ rb_singleton_class(obj)
|
|||
SPECIAL_SINGLETON(Qnil, rb_cNilClass);
|
||||
SPECIAL_SINGLETON(Qfalse, rb_cFalseClass);
|
||||
SPECIAL_SINGLETON(Qtrue, rb_cTrueClass);
|
||||
rb_bug("unknown immediate %d", obj);
|
||||
rb_bug("unknown immediate %ld", obj);
|
||||
}
|
||||
|
||||
DEFER_INTS;
|
||||
|
|
8
eval.c
8
eval.c
|
@ -3778,13 +3778,13 @@ rb_yield_0(val, self, klass, pcall)
|
|||
if ((state = EXEC_TAG()) == 0) {
|
||||
if (block->var == (NODE*)1) {
|
||||
if (pcall && RARRAY(val)->len != 0) {
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)",
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%ld for 0)",
|
||||
RARRAY(val)->len);
|
||||
}
|
||||
}
|
||||
else if (block->var == (NODE*)2) {
|
||||
if (TYPE(val) == T_ARRAY && RARRAY(val)->len != 0) {
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)",
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%ld for 0)",
|
||||
RARRAY(val)->len);
|
||||
}
|
||||
}
|
||||
|
@ -3906,7 +3906,7 @@ massign(self, node, val, pcall)
|
|||
int pcall;
|
||||
{
|
||||
NODE *list;
|
||||
int i = 0, len;
|
||||
long i = 0, len;
|
||||
|
||||
if (!pcall) {
|
||||
val = svalue_to_mvalue(val);
|
||||
|
@ -3945,7 +3945,7 @@ massign(self, node, val, pcall)
|
|||
i++;
|
||||
list = list->nd_next;
|
||||
}
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", len, i);
|
||||
rb_raise(rb_eArgError, "wrong number of arguments (%ld for %ld)", len, i);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -891,7 +891,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;
|
||||
}
|
||||
|
@ -903,7 +903,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;
|
||||
}
|
||||
|
@ -933,7 +933,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);
|
||||
}
|
||||
|
||||
|
@ -1027,7 +1027,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);
|
||||
}
|
||||
|
|
4
pack.c
4
pack.c
|
@ -338,7 +338,7 @@ pack_pack(ary, fmt)
|
|||
char *p, *pend;
|
||||
VALUE res, from, associates = 0;
|
||||
char type;
|
||||
int items, len, idx;
|
||||
long items, len, idx;
|
||||
char *ptr;
|
||||
int plen;
|
||||
#ifdef NATINT_PACK
|
||||
|
@ -825,7 +825,7 @@ pack_pack(ary, fmt)
|
|||
if (!NIL_P(from)) {
|
||||
StringValue(from);
|
||||
if (RSTRING(from)->len < len) {
|
||||
rb_raise(rb_eArgError, "too short buffer for P(%d for %d)",
|
||||
rb_raise(rb_eArgError, "too short buffer for P(%ld for %ld)",
|
||||
RSTRING(from)->len, len);
|
||||
}
|
||||
}
|
||||
|
|
2
parse.y
2
parse.y
|
@ -4947,7 +4947,7 @@ arg_prepend(node1, node2)
|
|||
return node2;
|
||||
|
||||
default:
|
||||
rb_bug("unknown nodetype(%d) for arg_prepend");
|
||||
rb_bug("unknown nodetype(%d) for arg_prepend", nodetype(node2));
|
||||
}
|
||||
return 0; /* not reached */
|
||||
}
|
||||
|
|
2
range.c
2
range.c
|
@ -401,7 +401,7 @@ rb_range_beg_len(range, begp, lenp, len, err)
|
|||
|
||||
out_of_range:
|
||||
if (err) {
|
||||
rb_raise(rb_eRangeError, "%d..%s%d out of range",
|
||||
rb_raise(rb_eRangeError, "%ld..%s%ld out of range",
|
||||
b, EXCL(range)? "." : "", e);
|
||||
}
|
||||
return Qnil;
|
||||
|
|
6
string.c
6
string.c
|
@ -1198,10 +1198,10 @@ rb_str_update(str, beg, len, val)
|
|||
long len;
|
||||
VALUE val;
|
||||
{
|
||||
if (len < 0) rb_raise(rb_eIndexError, "negative length %d", len);
|
||||
if (len < 0) rb_raise(rb_eIndexError, "negative length %ld", len);
|
||||
if (RSTRING(str)->len < beg) {
|
||||
out_of_range:
|
||||
rb_raise(rb_eIndexError, "index %d out of string", beg);
|
||||
rb_raise(rb_eIndexError, "index %ld out of string", beg);
|
||||
}
|
||||
if (beg < 0) {
|
||||
if (-beg > RSTRING(str)->len) {
|
||||
|
@ -1282,7 +1282,7 @@ rb_str_aset(str, indx, val)
|
|||
idx = NUM2INT(indx);
|
||||
if (RSTRING(str)->len <= idx) {
|
||||
out_of_range:
|
||||
rb_raise(rb_eIndexError, "index %d out of string", idx);
|
||||
rb_raise(rb_eIndexError, "index %ld out of string", idx);
|
||||
}
|
||||
if (idx < 0) {
|
||||
if (-idx > RSTRING(str)->len)
|
||||
|
|
2
util.c
2
util.c
|
@ -169,7 +169,7 @@ ruby_add_suffix(str, suffix)
|
|||
char buf[1024];
|
||||
|
||||
if (RSTRING(str)->len > 1000)
|
||||
rb_fatal("Cannot do inplace edit on long filename (%d characters)",
|
||||
rb_fatal("Cannot do inplace edit on long filename (%ld characters)",
|
||||
RSTRING(str)->len);
|
||||
|
||||
#if defined(DJGPP) || defined(__CYGWIN32__) || defined(NT)
|
||||
|
|
Loading…
Reference in a new issue