Merge pull request 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

@ -258,7 +258,7 @@ RB_METHOD(bitmapDrawText)
VALUE strObj;
rb_get_args(argc, argv, "oo|i", &rectObj, &strObj, &align RB_ARG_END);
if (rb_type(strObj) != RUBY_T_STRING)
if (!RB_TYPE_P(strObj, RUBY_T_STRING))
strObj = rb_funcallv(strObj, rb_intern("to_s"), 0, 0);
str = RSTRING_PTR(strObj);
@ -281,7 +281,7 @@ RB_METHOD(bitmapDrawText)
VALUE strObj;
rb_get_args(argc, argv, "iiiio|i", &x, &y, &width, &height, &strObj, &align RB_ARG_END);
if (rb_type(strObj) != RUBY_T_STRING)
if (!RB_TYPE_P(strObj, RUBY_T_STRING))
strObj = rb_funcallv(strObj, rb_intern("to_s"), 0, 0);
str = RSTRING_PTR(strObj);
@ -308,7 +308,7 @@ RB_METHOD(bitmapTextSize)
VALUE strObj;
rb_get_args(argc, argv, "o", &strObj RB_ARG_END);
if (rb_type(strObj) != RUBY_T_STRING)
if (!RB_TYPE_P(strObj, RUBY_T_STRING))
strObj = rb_funcallv(strObj, rb_intern("to_s"), 0, 0);
str = RSTRING_PTR(strObj);