Permalink
Browse files

* 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: http://svn.ruby-lang.org/repos/ruby/trunk@2498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent a0a7d2d commit 2231bb6de2f1846a25a8aa9ee3b34ed684eeabd4 michal committed May 28, 2002
Showing with 21 additions and 21 deletions.
  1. +4 −4 array.c
  2. +1 −1 class.c
  3. +4 −4 eval.c
  4. +4 −4 numeric.c
  5. +2 −2 pack.c
  6. +1 −1 parse.y
  7. +1 −1 range.c
  8. +3 −3 string.c
  9. +1 −1 util.c
View
@@ -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) {
View
@@ -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;
View
@@ -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
View
@@ -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);
}
View
@@ -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);
}
}
View
@@ -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 */
}
View
@@ -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;
View
@@ -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)
View
@@ -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)

0 comments on commit 2231bb6

Please sign in to comment.