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

ruby-changes:45598

From: nobu <ko1@a...>
Date: Tue, 21 Feb 2017 14:17:46 +0900 (JST)
Subject: [ruby-changes:45598] nobu:r57671 (trunk): backward.h: 2.2 deprecated features

nobu	2017-02-21 14:17:41 +0900 (Tue, 21 Feb 2017)

  New Revision: 57671

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

  Log:
    backward.h: 2.2 deprecated features
    
    * include/ruby/backward.h (DECLARE_DEPRECATED_FEATURE): move
      features deprecated at 2.2.

  Modified files:
    trunk/hash.c
    trunk/include/ruby/backward.h
    trunk/include/ruby/intern.h
    trunk/pack.c
    trunk/struct.c
    trunk/vm.c
    trunk/vm_method.c
Index: hash.c
===================================================================
--- hash.c	(revision 57670)
+++ hash.c	(revision 57671)
@@ -84,12 +84,6 @@ static VALUE envtbl; https://github.com/ruby/ruby/blob/trunk/hash.c#L84
 static ID id_hash, id_yield, id_default, id_flatten_bang;
 
 VALUE
-rb_hash_ifnone(VALUE h)
-{
-    return RHASH_IFNONE(h);
-}
-
-VALUE
 rb_hash_set_ifnone(VALUE hash, VALUE ifnone)
 {
     RB_OBJ_WRITE(hash, (&RHASH(hash)->ifnone), ifnone);
@@ -266,12 +260,6 @@ rb_obj_hash(VALUE obj) https://github.com/ruby/ruby/blob/trunk/hash.c#L260
     return ST2FIX(hnum);
 }
 
-int
-rb_hash_iter_lev(VALUE h)
-{
-    return RHASH_ITER_LEV(h);
-}
-
 static const struct st_hash_type objhash = {
     rb_any_cmp,
     rb_any_hash,
Index: include/ruby/backward.h
===================================================================
--- include/ruby/backward.h	(revision 57670)
+++ include/ruby/backward.h	(revision 57671)
@@ -1,6 +1,26 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/backward.h#L1
 #ifndef RUBY_RUBY_BACKWARD_H
 #define RUBY_RUBY_BACKWARD_H 1
 
+#define DECLARE_DEPRECATED_FEATURE(ver, func) \
+    NORETURN(ERRORFUNC(("deprecated since "#ver), DEPRECATED(void func(void))))
+
+/* eval.c */
+DECLARE_DEPRECATED_FEATURE(2.2, rb_disable_super);
+DECLARE_DEPRECATED_FEATURE(2.2, rb_enable_super);
+
+/* hash.c */
+DECLARE_DEPRECATED_FEATURE(2.2, rb_hash_iter_lev);
+DECLARE_DEPRECATED_FEATURE(2.2, rb_hash_ifnone);
+
+/* string.c */
+DECLARE_DEPRECATED_FEATURE(2.2, rb_str_associate);
+DECLARE_DEPRECATED_FEATURE(2.2, rb_str_associated);
+
+/* vm.c */
+DECLARE_DEPRECATED_FEATURE(2.2, rb_clear_cache);
+DECLARE_DEPRECATED_FEATURE(2.2, rb_frame_pop);
+
+/* from version.c */
 #ifndef RUBY_SHOW_COPYRIGHT_TO_DIE
 # define RUBY_SHOW_COPYRIGHT_TO_DIE 1
 #endif
Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h	(revision 57670)
+++ include/ruby/intern.h	(revision 57671)
@@ -371,24 +371,11 @@ NORETURN(VALUE rb_f_exit(int, const VALU https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L371
 NORETURN(VALUE rb_f_abort(int, const VALUE*));
 void rb_remove_method(VALUE, const char*);
 void rb_remove_method_id(VALUE, ID);
-DEPRECATED(static inline void rb_disable_super(void));
-DEPRECATED(static inline void rb_enable_super(void));
-static inline void rb_disable_super(void)
-{
-    /* obsolete - no use */
-}
-static inline void rb_enable_super(void)
-{
-    rb_warning("rb_enable_super() is obsolete");
-}
-#define rb_disable_super(klass, name) rb_disable_super()
-#define rb_enable_super(klass, name) rb_enable_super()
 #define HAVE_RB_DEFINE_ALLOC_FUNC 1
 typedef VALUE (*rb_alloc_func_t)(VALUE);
 void rb_define_alloc_func(VALUE, rb_alloc_func_t);
 void rb_undef_alloc_func(VALUE);
 rb_alloc_func_t rb_get_alloc_func(VALUE);
-NORETURN(DEPRECATED(void rb_clear_cache(void)));
 void rb_clear_constant_cache(void);
 void rb_clear_method_cache_by_class(VALUE);
 void rb_alias(VALUE, ID, ID);
@@ -527,8 +514,6 @@ int rb_path_check(const char*); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L514
 int rb_env_path_tainted(void);
 VALUE rb_env_clear(void);
 VALUE rb_hash_size(VALUE);
-DEPRECATED(int rb_hash_iter_lev(VALUE));
-DEPRECATED(VALUE rb_hash_ifnone(VALUE));
 /* io.c */
 #define rb_defout rb_stdout
 RUBY_EXTERN VALUE rb_fs;
@@ -777,8 +762,6 @@ VALUE rb_str_replace(VALUE, VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L762
 VALUE rb_str_inspect(VALUE);
 VALUE rb_str_dump(VALUE);
 VALUE rb_str_split(VALUE, const char*);
-NORETURN(DEPRECATED(void rb_str_associate(VALUE, VALUE)));
-NORETURN(DEPRECATED(VALUE rb_str_associated(VALUE)));
 void rb_str_setter(VALUE, ID, VALUE*);
 VALUE rb_str_intern(VALUE);
 VALUE rb_sym_to_s(VALUE);
@@ -886,7 +869,6 @@ VALUE rb_struct_getmember(VALUE, ID); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L869
 VALUE rb_struct_s_members(VALUE);
 VALUE rb_struct_members(VALUE);
 VALUE rb_struct_size(VALUE s);
-DEPRECATED(const VALUE *rb_struct_ptr(VALUE s));
 VALUE rb_struct_alloc_noinit(VALUE);
 VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
 VALUE rb_struct_define_without_accessor_under(VALUE outer, const char *class_name, VALUE super, rb_alloc_func_t alloc, ...);
@@ -973,10 +955,6 @@ int rb_frame_method_id_and_class(ID *idp https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L955
 VALUE rb_make_backtrace(void);
 VALUE rb_make_exception(int, const VALUE*);
 
-/* deprecated */
-NORETURN(DEPRECATED(void rb_frame_pop(void)));
-
-
 RUBY_SYMBOL_EXPORT_END
 
 #if defined(__cplusplus)
Index: struct.c
===================================================================
--- struct.c	(revision 57670)
+++ struct.c	(revision 57671)
@@ -1126,12 +1126,6 @@ rb_struct_size(VALUE s) https://github.com/ruby/ruby/blob/trunk/struct.c#L1126
     return LONG2FIX(RSTRUCT_LEN(s));
 }
 
-const VALUE*
-rb_struct_ptr(VALUE s)
-{
-    return RSTRUCT_CONST_PTR(s);
-}
-
 /*
  * call-seq:
  *   struct.dig(key, ...)              -> object
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 57670)
+++ vm_method.c	(revision 57671)
@@ -81,12 +81,6 @@ rb_class_clear_method_cache(VALUE klass, https://github.com/ruby/ruby/blob/trunk/vm_method.c#L81
 }
 
 void
-rb_clear_cache(void)
-{
-    DEPRECATED_INTERNAL_FEATURE("rb_clear_cache()");
-}
-
-void
 rb_clear_constant_cache(void)
 {
     INC_GLOBAL_CONSTANT_STATE();
Index: vm.c
===================================================================
--- vm.c	(revision 57670)
+++ vm.c	(revision 57671)
@@ -544,13 +544,6 @@ rb_vm_rewind_cfp(rb_thread_t *th, rb_con https://github.com/ruby/ruby/blob/trunk/vm.c#L544
     }
 }
 
-/* obsolete */
-void
-rb_frame_pop(void)
-{
-    DEPRECATED_INTERNAL_FEATURE("rb_frame_pop()");
-}
-
 /* at exit */
 
 void
Index: pack.c
===================================================================
--- pack.c	(revision 57670)
+++ pack.c	(revision 57671)
@@ -126,18 +126,6 @@ str_associated(VALUE str) https://github.com/ruby/ruby/blob/trunk/pack.c#L126
     return rb_ivar_lookup(str, id_associated, Qfalse);
 }
 
-void
-rb_str_associate(VALUE str, VALUE add)
-{
-    DEPRECATED_INTERNAL_FEATURE("rb_str_associate()");
-}
-
-VALUE
-rb_str_associated(VALUE str)
-{
-    DEPRECATED_INTERNAL_FEATURE("rb_str_associated()");
-}
-
 /*
  *  call-seq:
  *     arr.pack( aTemplateString ) -> aBinaryString

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

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