diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/iconv/iconv.c | 4 | ||||
-rw-r--r-- | ext/json/ext/generator/generator.c | 8 | ||||
-rw-r--r-- | ext/json/ext/parser/parser.c | 4 | ||||
-rw-r--r-- | ext/syck/rubyext.c | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index b6bc0a11a5..ccedd0c66d 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -138,10 +138,10 @@ map_charset(VALUE *code) { VALUE val = *code; - if (RHASH(charset_map)->tbl && RHASH(charset_map)->tbl->num_entries) { + if (RHASH_SIZE(charset_map)) { VALUE key = rb_funcall2(val, rb_intern("downcase"), 0, 0); StringValuePtr(key); - if (st_lookup(RHASH(charset_map)->tbl, key, &val)) { + if (st_lookup(RHASH_TBL(charset_map), key, &val)) { *code = val; } } diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator/generator.c index b08455f223..616832c992 100644 --- a/ext/json/ext/generator/generator.c +++ b/ext/json/ext/generator/generator.c @@ -86,7 +86,7 @@ static int hash_to_json_state_i(VALUE key, VALUE value, VALUE Vstate) } inline static VALUE mHash_json_transfrom(VALUE self, VALUE Vstate, VALUE Vdepth) { - long depth, len = RHASH(self)->tbl->num_entries; + long depth, len = RHASH_SIZE(self); VALUE result; GET_STATE(Vstate); @@ -140,7 +140,7 @@ static VALUE mHash_to_json(int argc, VALUE *argv, VALUE self) rb_scan_args(argc, argv, "02", &Vstate, &Vdepth); depth = NIL_P(Vdepth) ? 0 : FIX2LONG(Vdepth); if (NIL_P(Vstate)) { - long len = RHASH(self)->tbl->num_entries; + long len = RHASH_SIZE(self); result = rb_str_buf_new(len); rb_str_buf_cat2(result, "{"); rb_hash_foreach(self, hash_to_json_i, result); @@ -480,7 +480,7 @@ static inline VALUE cState_configure(VALUE self, VALUE opts) state->object_nl = tmp; } tmp = ID2SYM(i_check_circular); - if (st_lookup(RHASH(opts)->tbl, tmp, 0)) { + if (st_lookup(RHASH_TBL(opts), tmp, 0)) { tmp = rb_hash_aref(opts, ID2SYM(i_check_circular)); state->check_circular = RTEST(tmp); } else { @@ -488,7 +488,7 @@ static inline VALUE cState_configure(VALUE self, VALUE opts) } tmp = ID2SYM(i_max_nesting); state->max_nesting = 19; - 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); diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index a1950b067a..a6b7021f7e 100644 --- a/ext/json/ext/parser/parser.c +++ b/ext/json/ext/parser/parser.c @@ -1470,7 +1470,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); @@ -1480,7 +1480,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/syck/rubyext.c b/ext/syck/rubyext.c index 9a41c18e8f..53625c91de 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -621,7 +621,7 @@ rb_syck_load_handler(SyckParser *p, SyckNode *n) if ( bonus->taint) OBJ_TAINT( obj ); if ( bonus->proc != 0 ) rb_funcall(bonus->proc, s_call, 1, obj); - rb_hash_aset(bonus->data, INT2FIX(RHASH(bonus->data)->tbl->num_entries), obj); + rb_hash_aset(bonus->data, INT2FIX(RHASH_SIZE(bonus->data)), obj); return obj; } |