summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-09 04:37:36 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-09 04:37:36 +0000
commit4ab384be2d4a98868c8da9739609585efc15f920 (patch)
tree6d9052019b773701d489f0f37f58a397e8027bb7 /encoding.c
parenta46c532ab83c1c080311e4c7948b6fc4e5d6df14 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@13848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/encoding.c b/encoding.c
index 97e6cfff50..15a2398f05 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