diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-03 01:56:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-03 01:56:01 +0000 |
commit | 1d670ab0f090c0232e2a7a619b70ebb559453331 (patch) | |
tree | 8b603d1279d3e5f4e53e4d5407074c46a0639920 /ext/tk/tcltklib.c | |
parent | fdfb939d72e8b66540df42821e3facfcda5aaf15 (diff) |
ext: prefer RB_TYPE_P over comparison TYPE with constants
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/tcltklib.c')
-rw-r--r-- | ext/tk/tcltklib.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c index 27771bff29..c67b0207c5 100644 --- a/ext/tk/tcltklib.c +++ b/ext/tk/tcltklib.c @@ -3110,7 +3110,7 @@ ip_set_exc_message(interp, exc) } if (NIL_P(enc)) { encoding = (Tcl_Encoding)NULL; - } else if (TYPE(enc) == T_STRING) { + } else if (RB_TYPE_P(enc, T_STRING)) { /* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */ encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(enc)); } else { @@ -3320,7 +3320,7 @@ tcl_protect_core(interp, proc, data) /* should not raise exception */ if (rb_obj_is_kind_of(exc, eLocalJumpError)) { VALUE reason = rb_ivar_get(exc, ID_at_reason); - if (TYPE(reason) == T_SYMBOL) { + if (RB_TYPE_P(reason, T_SYMBOL)) { if (SYM2ID(reason) == ID_return) return TCL_RETURN; @@ -7949,7 +7949,7 @@ lib_toUTF8_core(ip_obj, src, encodename) rb_thread_critical = Qtrue; if (NIL_P(encodename)) { - if (TYPE(str) == T_STRING) { + if (RB_TYPE_P(str, T_STRING)) { volatile VALUE enc; #ifdef HAVE_RUBY_ENCODING_H @@ -8127,7 +8127,7 @@ lib_fromUTF8_core(ip_obj, src, encodename) if (NIL_P(encodename)) { volatile VALUE enc; - if (TYPE(str) == T_STRING) { + if (RB_TYPE_P(str, T_STRING)) { enc = rb_attr_get(str, ID_at_enc); if (!NIL_P(enc)) { StringValue(enc); |