Skip to content

Commit

Permalink
convert_type() should be passed value of boolean with 4th argument be…
Browse files Browse the repository at this point in the history
…cause its value is checked with "if (raise) " in convert_type().

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5294 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information
Watson1978 committed Mar 23, 2011
1 parent 8f9c771 commit 9ed4545
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions object.c
Expand Up @@ -2521,7 +2521,7 @@ rb_convert_type(VALUE val, int type, const char *tname, const char *method)
if (TYPE(val) == type) {
return val;
}
VALUE v = convert_type(val, tname, method, Qtrue);
VALUE v = convert_type(val, tname, method, TRUE);
if (TYPE(v) != type) {
const char *cname = rb_obj_classname(val);
rb_raise(rb_eTypeError, "can't convert %s to %s (%s#%s gives %s)",
Expand All @@ -2539,7 +2539,7 @@ rb_check_convert_type(VALUE val, int type, const char *tname, const char *method
if (TYPE(val) == type && type != T_DATA) {
return val;
}
v = convert_type(val, tname, method, Qfalse);
v = convert_type(val, tname, method, FALSE);
if (NIL_P(v)) {
return Qnil;
}
Expand All @@ -2558,7 +2558,7 @@ rb_to_integer(VALUE val, const char *method)
VALUE v;

if (FIXNUM_P(val)) return val;
v = convert_type(val, "Integer", method, Qtrue);
v = convert_type(val, "Integer", method, TRUE);
if (!rb_obj_is_kind_of(v, rb_cInteger)) {
const char *cname = rb_obj_classname(val);
rb_raise(rb_eTypeError, "can't convert %s to Integer (%s#%s gives %s)",
Expand All @@ -2573,7 +2573,7 @@ rb_check_to_integer(VALUE val, const char *method)
VALUE v;

if (FIXNUM_P(val)) return val;
v = convert_type(val, "Integer", method, Qfalse);
v = convert_type(val, "Integer", method, FALSE);
if (!rb_obj_is_kind_of(v, rb_cInteger)) {
return Qnil;
}
Expand Down

0 comments on commit 9ed4545

Please sign in to comment.