diff options
| author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-29 23:10:25 +0000 |
|---|---|---|
| committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-29 23:10:25 +0000 |
| commit | d1a9f6205e1ad0619f3c71c8730cc7212d645bfa (patch) | |
| tree | 46a02cc28977b17a16754ee470a45a9d7214a9b7 | |
| parent | d0045cad37b394eedd169a153b8589482f4a889f (diff) | |
| download | ruby-d1a9f6205e1ad0619f3c71c8730cc7212d645bfa.tar.gz ruby-d1a9f6205e1ad0619f3c71c8730cc7212d645bfa.tar.xz ruby-d1a9f6205e1ad0619f3c71c8730cc7212d645bfa.zip | |
* encoding.c (enc_compatible_p): use TYPE not BUILTIN_TYPE.
[ruby-dev:36048]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | encoding.c | 6 |
2 files changed, 8 insertions, 4 deletions
@@ -1,6 +1,12 @@ +Sat Aug 30 08:09:36 2008 NARUSE, Yui <naruse@ruby-lang.org> + + * encoding.c (enc_compatible_p): use TYPE not BUILTIN_TYPE. + [ruby-dev:36048] + Sat Aug 30 07:48:48 2008 NARUSE, Yui <naruse@ruby-lang.org> * encoding.c (enc_compatible_p): add SPECIAL_CONST_P check. + [ruby-dev:36048] * test/ruby/test_m17n.rb (test_compatible): fix test. diff --git a/encoding.c b/encoding.c index bb6f5b269..44e80b955 100644 --- a/encoding.c +++ b/encoding.c @@ -880,13 +880,11 @@ enc_compatible_p(VALUE klass, VALUE str1, VALUE str2) { rb_encoding *enc; - if (SPECIAL_CONST_P(str1) || - BUILTIN_TYPE(str1) != T_STRING && BUILTIN_TYPE(str1) != T_REGEXP) { + if (SPECIAL_CONST_P(str1) || TYPE(str1) != T_STRING && TYPE(str1) != T_REGEXP) { rb_raise(rb_eTypeError, "wrong argument type %s (expected String or Regexp)", rb_obj_classname(str1)); } - if (SPECIAL_CONST_P(str2) || - BUILTIN_TYPE(str2) != T_STRING && BUILTIN_TYPE(str2) != T_REGEXP) { + if (SPECIAL_CONST_P(str2) || TYPE(str2) != T_STRING && TYPE(str2) != T_REGEXP) { rb_raise(rb_eTypeError, "wrong argument type %s (expected String or Regexp)", rb_obj_classname(str2)); } |
