From 1591776d465bb901d0be1f45d03a65e2691ede50 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 29 Aug 2007 23:38:38 +0000 Subject: [PATCH] forgot to modify ext/json/ext/parser/parser.rl and ext/tk/tkutil/tkutil.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ ext/json/ext/parser/parser.rl | 4 ++-- ext/tk/tkutil/tkutil.c | 14 +++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index c75125134d..18b752d1fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,8 +28,12 @@ Thu Aug 30 08:00:12 2007 Tanaka Akira * ext/json/ext/parser/parser.c: ditto. + * ext/json/ext/parser/parser.rl: ditto. + * ext/syck/rubyext.c: ditto. + * ext/tk/tkutil/tkutil.c: ditto. + Wed Aug 29 18:36:06 2007 Tanaka Akira * lib/open-uri.rb: add :ftp_active_mode option. diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl index c1373c23dd..9c51e90223 100644 --- a/ext/json/ext/parser/parser.rl +++ b/ext/json/ext/parser/parser.rl @@ -495,7 +495,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self) rb_raise(rb_eArgError, "opts needs to be like a hash"); } else { VALUE tmp = ID2SYM(i_max_nesting); - if (st_lookup(RHASH(opts)->tbl, tmp, 0)) { + if (st_lookup(RHASH_TBL(opts), tmp, 0)) { VALUE max_nesting = rb_hash_aref(opts, tmp); if (RTEST(max_nesting)) { Check_Type(max_nesting, T_FIXNUM); @@ -505,7 +505,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self) } } tmp = ID2SYM(i_allow_nan); - if (st_lookup(RHASH(opts)->tbl, tmp, 0)) { + if (st_lookup(RHASH_TBL(opts), tmp, 0)) { VALUE allow_nan = rb_hash_aref(opts, tmp); if (RTEST(allow_nan)) json->allow_nan = 1; } diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c index 25c4af742d..d74f996935 100644 --- a/ext/tk/tkutil/tkutil.c +++ b/ext/tk/tkutil/tkutil.c @@ -226,7 +226,7 @@ tk_symbolkey2str(self, keys) if NIL_P(keys) return new_keys; keys = rb_convert_type(keys, T_HASH, "Hash", "to_hash"); - st_foreach(RHASH(keys)->tbl, to_strkey, new_keys); + st_foreach(RHASH_TBL(keys), to_strkey, new_keys); return new_keys; } @@ -270,7 +270,7 @@ ary2list(ary, enc_flag, self) size = 0; for(idx = 0; idx < RARRAY_LEN(ary); idx++) { if (TYPE(RARRAY_PTR(ary)[idx]) == T_HASH) { - size += 2 * RHASH(RARRAY_PTR(ary)[idx])->tbl->num_entries; + size += 2 * RHASH_SIZE(RARRAY_PTR(ary)[idx]); } else { size++; } @@ -617,10 +617,10 @@ hash2kv(hash, ary, self) VALUE ary; VALUE self; { - volatile VALUE dst = rb_ary_new2(2 * RHASH(hash)->tbl->num_entries); + volatile VALUE dst = rb_ary_new2(2 * RHASH_SIZE(hash)); volatile VALUE args = rb_ary_new3(2, dst, self); - st_foreach(RHASH(hash)->tbl, push_kv, args); + st_foreach(RHASH_TBL(hash), push_kv, args); if (NIL_P(ary)) { return dst; @@ -662,10 +662,10 @@ hash2kv_enc(hash, ary, self) VALUE ary; VALUE self; { - volatile VALUE dst = rb_ary_new2(2 * RHASH(hash)->tbl->num_entries); + volatile VALUE dst = rb_ary_new2(2 * RHASH_SIZE(hash)); volatile VALUE args = rb_ary_new3(2, dst, self); - st_foreach(RHASH(hash)->tbl, push_kv_enc, args); + st_foreach(RHASH_TBL(hash), push_kv_enc, args); if (NIL_P(ary)) { return dst; @@ -892,7 +892,7 @@ tk_conv_args(argc, argv, self) for(size = 0, idx = 2; idx < argc; idx++) { if (TYPE(argv[idx]) == T_HASH) { - size += 2 * RHASH(argv[idx])->tbl->num_entries; + size += 2 * RHASH_SIZE(argv[idx]); } else { size++; }