1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

variable.c: remove deprecated internal feature

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-02-21 06:16:49 +00:00
parent f922f1cbeb
commit cd0426c00b
3 changed files with 3 additions and 61 deletions

View file

@ -35,6 +35,9 @@ DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error_append);
/* struct.c */
DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_struct_ptr);
/* variable.c */
DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_generic_ivar_table);
/* from version.c */
#ifndef RUBY_SHOW_COPYRIGHT_TO_DIE
# define RUBY_SHOW_COPYRIGHT_TO_DIE 1

View file

@ -909,7 +909,6 @@ VALUE rb_f_trace_var(int, const VALUE*);
VALUE rb_f_untrace_var(int, const VALUE*);
VALUE rb_f_global_variables(void);
void rb_alias_variable(ID, ID);
DEPRECATED(struct st_table* rb_generic_ivar_table(VALUE));
void rb_copy_generic_ivar(VALUE,VALUE);
void rb_free_generic_ivar(VALUE);
VALUE rb_ivar_get(VALUE, ID);

View file

@ -942,27 +942,6 @@ rb_alias_variable(ID name1, ID name2)
entry1->var = entry2->var;
}
#if 0
struct gen_ivar_compat_tbl {
struct gen_ivtbl *ivtbl;
st_table *tbl;
};
static int
gen_ivar_compat_tbl_i(st_data_t id, st_data_t index, st_data_t arg)
{
struct gen_ivar_compat_tbl *a = (struct gen_ivar_compat_tbl *)arg;
if (index < a->ivtbl->numiv) {
VALUE val = a->ivtbl->ivptr[index];
if (val != Qundef) {
st_add_direct(a->tbl, id, (st_data_t)val);
}
}
return ST_CONTINUE;
}
#endif
static int
gen_ivtbl_get(VALUE obj, struct gen_ivtbl **ivtbl)
{
@ -975,45 +954,6 @@ gen_ivtbl_get(VALUE obj, struct gen_ivtbl **ivtbl)
return 0;
}
/* for backwards compatibility only */
#ifdef __GNUC__
NORETURN(st_table *rb_generic_ivar_table(VALUE obj));
#endif
st_table*
rb_generic_ivar_table(VALUE obj)
{
#if 0
st_table *iv_index_tbl = RCLASS_IV_INDEX_TBL(rb_obj_class(obj));
struct gen_ivar_compat_tbl a;
st_data_t d;
if (!iv_index_tbl) return 0;
if (!FL_TEST(obj, FL_EXIVAR)) return 0;
if (!gen_ivtbl_get(obj, &a.ivtbl)) return 0;
a.tbl = 0;
if (!generic_iv_tbl_compat) {
generic_iv_tbl_compat = st_init_numtable();
}
else {
if (st_lookup(generic_iv_tbl_compat, (st_data_t)obj, &d)) {
a.tbl = (st_table *)d;
st_clear(a.tbl);
}
}
if (!a.tbl) {
a.tbl = st_init_numtable();
d = (st_data_t)a.tbl;
st_add_direct(generic_iv_tbl_compat, (st_data_t)obj, d);
}
st_foreach_safe(iv_index_tbl, gen_ivar_compat_tbl_i, (st_data_t)&a);
return a.tbl;
#else
DEPRECATED_INTERNAL_FEATURE("rb_generic_ivar_table()");
#endif
}
static VALUE
generic_ivar_delete(VALUE obj, ID id, VALUE undef)
{