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:
commit
2ba9f6589b
5 changed files with 14 additions and 15 deletions
binding-mri
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue