[前][次][番号順一覧][スレッド一覧]

ruby-changes:45601

From: nobu <ko1@a...>
Date: Tue, 21 Feb 2017 15:16:53 +0900 (JST)
Subject: [ruby-changes:45601] nobu:r57674 (trunk): variable.c: remove deprecated internal feature

nobu	2017-02-21 15:16:49 +0900 (Tue, 21 Feb 2017)

  New Revision: 57674

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57674

  Log:
    variable.c: remove deprecated internal feature

  Modified files:
    trunk/include/ruby/backward.h
    trunk/include/ruby/intern.h
    trunk/variable.c
Index: variable.c
===================================================================
--- variable.c	(revision 57673)
+++ variable.c	(revision 57674)
@@ -942,27 +942,6 @@ rb_alias_variable(ID name1, ID name2) https://github.com/ruby/ruby/blob/trunk/variable.c#L942
     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_ivtb https://github.com/ruby/ruby/blob/trunk/variable.c#L954
     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)
 {
Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h	(revision 57673)
+++ include/ruby/intern.h	(revision 57674)
@@ -909,7 +909,6 @@ VALUE rb_f_trace_var(int, const VALUE*); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L909
 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);
Index: include/ruby/backward.h
===================================================================
--- include/ruby/backward.h	(revision 57673)
+++ include/ruby/backward.h	(revision 57674)
@@ -35,6 +35,9 @@ DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_c https://github.com/ruby/ruby/blob/trunk/include/ruby/backward.h#L35
 /* 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]