diff options
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/variable.c b/variable.c index 523bc58e75..20d86ace37 100644 --- a/variable.c +++ b/variable.c @@ -70,8 +70,11 @@ fc_path(struct fc_result *fc, ID name) } static int -fc_i(ID key, rb_const_entry_t *ce, struct fc_result *res) +fc_i(st_data_t k, st_data_t v, st_data_t a) { + ID key = (ID)k; + rb_const_entry_t *ce = (rb_const_entry_t *)v; + struct fc_result *res = (struct fc_result *)a; VALUE value = ce->value; if (!rb_is_const_id(key)) return ST_CONTINUE; @@ -455,8 +458,10 @@ readonly_setter(VALUE val, ID id, void *data, struct global_variable *gvar) } static int -mark_global_entry(ID key, struct global_entry *entry) +mark_global_entry(st_data_t k, st_data_t v, st_data_t a) { + ID key = (ID)key; + struct global_entry *entry = (struct global_entry *)v; struct trace_var *trace; struct global_variable *var = entry->var; @@ -746,8 +751,10 @@ rb_gvar_defined(struct global_entry *entry) } static int -gvar_i(ID key, struct global_entry *entry, VALUE ary) +gvar_i(st_data_t k, st_data_t v, st_data_t a) { + ID key = (ID)k; + VALUE ary = (VALUE)a; rb_ary_push(ary, ID2SYM(key)); return ST_CONTINUE; } @@ -916,15 +923,18 @@ rb_mark_generic_ivar(VALUE obj) } static int -givar_mark_i(ID key, VALUE value) +givar_mark_i(st_data_t k, st_data_t v, st_data_t a) { + VALUE value = (VALUE)v; rb_gc_mark(value); return ST_CONTINUE; } static int -givar_i(VALUE obj, st_table *tbl) +givar_i(st_data_t k, st_data_t v, st_data_t a) { + VALUE obj = (VALUE)k; + st_table *tbl = (st_table *)v; if (rb_special_const_p(obj)) { st_foreach_safe(tbl, givar_mark_i, 0); } @@ -1241,8 +1251,11 @@ rb_ivar_count(VALUE obj) } static int -ivar_i(ID key, VALUE val, VALUE ary) +ivar_i(st_data_t k, st_data_t v, st_data_t a) { + ID key = (ID)k; + VALUE ary = (VALUE)a; + if (rb_is_instance_id(key)) { rb_ary_push(ary, ID2SYM(key)); } @@ -1855,8 +1868,12 @@ rb_const_remove(VALUE mod, ID id) } static int -sv_i(ID key, rb_const_entry_t *ce, st_table *tbl) +sv_i(st_data_t k, st_data_t v, st_data_t a) { + ID key = (ID)k; + rb_const_entry_t *ce = (rb_const_entry_t *)v; + st_table *tbl = (st_table *)a; + if (rb_is_const_id(key)) { if (!st_lookup(tbl, (st_data_t)key, 0)) { st_insert(tbl, (st_data_t)key, (st_data_t)ce); @@ -2301,8 +2318,11 @@ rb_define_class_variable(VALUE klass, const char *name, VALUE val) } static int -cv_i(ID key, VALUE value, VALUE ary) +cv_i(st_data_t k, st_data_t v, st_data_t a) { + ID key = (ID)k; + VALUE ary = (VALUE)a; + if (rb_is_class_id(key)) { VALUE kval = ID2SYM(key); if (!rb_ary_includes(ary, kval)) { @@ -2334,7 +2354,7 @@ rb_mod_class_variables(VALUE obj) VALUE ary = rb_ary_new(); if (RCLASS_IV_TBL(obj)) { - st_foreach_safe(RCLASS_IV_TBL(obj), cv_i, ary); + st_foreach_safe(RCLASS_IV_TBL(obj), cv_i, (st_data_t)ary); } return ary; } |