diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-09 04:37:36 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-09 04:37:36 +0000 |
commit | ca92a70850c65eeda835080db750d03ee89cb427 (patch) | |
tree | 6d9052019b773701d489f0f37f58a397e8027bb7 /encoding.c | |
parent | db16da486e7b35d1fbbdafb58d1c2ee64f067158 (diff) | |
download | ruby-ca92a70850c65eeda835080db750d03ee89cb427.tar.gz ruby-ca92a70850c65eeda835080db750d03ee89cb427.tar.xz ruby-ca92a70850c65eeda835080db750d03ee89cb427.zip |
* test/ruby/test_basicinstructions.rb: updated for new class
behavior. [ruby-dev:32192]
* encoding.c (enc_name): Encoding should not rely on ENCODING in
the FL_USERS flags.
* encoding.c (rb_enc_from_encoding): do not call rb_enc_associate
for encoding itself.
* encoding.c (enc_register_at): ditto.
* marshal.c (r_ivar): do not set real instance variable for
encoding data associated.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r-- | encoding.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/encoding.c b/encoding.c index 97e6cfff5..15a2398f0 100644 --- a/encoding.c +++ b/encoding.c @@ -52,9 +52,7 @@ rb_enc_from_encoding(rb_encoding *encoding) if (!encoding) return 0; if (enc_initialized_p(encoding)) return ENC_FROM_ENCODING(encoding); - enc = enc_new(encoding); - rb_enc_associate(enc, encoding); - return enc; + return enc_new(encoding); } static int @@ -146,8 +144,8 @@ enc_register_at(int index, const char *name, rb_encoding *encoding) encoding = ent->enc; encoding->name = name; if (rb_cEncoding) { - VALUE enc = enc_new(encoding); - rb_enc_associate_index(enc, index); + /* initialize encoding data */ + enc_new(encoding); } else { encoding->auxiliary_data = ENC_UNINITIALIZED; @@ -523,13 +521,13 @@ static VALUE enc_to_s(VALUE self) { return rb_sprintf("<%s:%s>", rb_obj_classname(self), - rb_enc_name(enc_get_encoding(self))); + rb_enc_name((rb_encoding*)DATA_PTR(self))); } static VALUE enc_name(VALUE self) { - return rb_str_new2(rb_enc_name(enc_get_encoding(self))); + return rb_str_new2(rb_enc_name((rb_encoding*)DATA_PTR(self))); } static VALUE |