diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-20 22:26:14 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-20 22:26:14 +0000 |
commit | fe8bb861255035f7903c6f332f3cc87368a9c410 (patch) | |
tree | 1c41a8e46f75308f9a2c77027099948503059249 /encoding.c | |
parent | 13f20ccda7aeb82750b020d2c8bf4f8c6fc72d37 (diff) | |
download | ruby-fe8bb861255035f7903c6f332f3cc87368a9c410.tar.gz |
* encoding.c, include/ruby/encoding.h
(rb_enc_associate, rb_enc_associate_index):
returns obj. [ruby-dev:34778]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r-- | encoding.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/encoding.c b/encoding.c index e1824f557f..20d47b1e6f 100644 --- a/encoding.c +++ b/encoding.c @@ -564,10 +564,10 @@ rb_enc_set_index(VALUE obj, int idx) return; } -void +VALUE rb_enc_associate_index(VALUE obj, int idx) { -// enc_check_capable(obj); +/* enc_check_capable(obj);*/ if (rb_enc_get_index(obj) == idx) return; if (!ENC_CODERANGE_ASCIIONLY(obj) || @@ -575,12 +575,13 @@ rb_enc_associate_index(VALUE obj, int idx) ENC_CODERANGE_CLEAR(obj); } rb_enc_set_index(obj, idx); + return obj; } -void +VALUE rb_enc_associate(VALUE obj, rb_encoding *enc) { - rb_enc_associate_index(obj, rb_enc_to_index(enc)); + return rb_enc_associate_index(obj, rb_enc_to_index(enc)); } rb_encoding* |