Permalink
Browse files

convert_type() should be passed value of boolean with 4th argument be…

…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...
1 parent 8f9c771 commit 9ed4545d77c51ce9008d4345cbbafa22d8730c48 @Watson1978 Watson1978 committed Mar 23, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 object.c
View
@@ -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)",
@@ -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;
}
@@ -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)",
@@ -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;
}

0 comments on commit 9ed4545

Please sign in to comment.