From 1d670ab0f090c0232e2a7a619b70ebb559453331 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 3 Aug 2014 01:56:01 +0000 Subject: 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 --- ext/tk/tcltklib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/tk/tcltklib.c') 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); -- cgit v1.2.3