Merge pull request #57 from cremno/mri-use-rb_type_p-instead-of-rb_type

MRI: use RB_TYPE_P() instead of rb_type()
This commit is contained in:
Jonas Kulla 2014-08-30 03:56:37 +02:00
commit 2ba9f6589b
5 changed files with 14 additions and 15 deletions

View file

@ -148,7 +148,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...)
VALUE *str = va_arg(ap, VALUE*);
VALUE tmp = *arg;
if (!(rb_type(tmp) == RUBY_T_STRING))
if (!RB_TYPE_P(tmp, RUBY_T_STRING))
rb_raise(rb_eTypeError, "Argument %d: Expected string", argI);
*str = tmp;
@ -167,7 +167,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...)
VALUE tmp = *arg;
if (!(rb_type(tmp) == RUBY_T_STRING))
if (!RB_TYPE_P(tmp, RUBY_T_STRING))
rb_raise(rb_eTypeError, "Argument %d: Expected string", argI);
*s = RSTRING_PTR(tmp);
@ -186,7 +186,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...)
VALUE tmp = *arg++;
if (!(rb_type(tmp) == RUBY_T_STRING))
if (!RB_TYPE_P(tmp, RUBY_T_STRING))
rb_raise(rb_eTypeError, "Argument %d: Expected string", argI);
*s = RSTRING_PTR(tmp);