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

backward.h: 2.2 deprecated features

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-02-21 05:17:41 +00:00
parent bd26c796a1
commit 556a1352e4
7 changed files with 20 additions and 65 deletions

12
hash.c
View file

@ -83,12 +83,6 @@ VALUE rb_cHash;
static VALUE envtbl;
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)
{
@ -266,12 +260,6 @@ rb_obj_hash(VALUE obj)
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,

View file

@ -1,6 +1,26 @@
#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

View file

@ -371,24 +371,11 @@ NORETURN(VALUE rb_f_exit(int, const VALUE*));
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*);
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);
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);
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, VALUE *klassp);
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)

12
pack.c
View file

@ -126,18 +126,6 @@ str_associated(VALUE str)
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

View file

@ -1126,12 +1126,6 @@ rb_struct_size(VALUE s)
return LONG2FIX(RSTRUCT_LEN(s));
}
const VALUE*
rb_struct_ptr(VALUE s)
{
return RSTRUCT_CONST_PTR(s);
}
/*
* call-seq:
* struct.dig(key, ...) -> object

7
vm.c
View file

@ -544,13 +544,6 @@ rb_vm_rewind_cfp(rb_thread_t *th, rb_control_frame_t *cfp)
}
}
/* obsolete */
void
rb_frame_pop(void)
{
DEPRECATED_INTERNAL_FEATURE("rb_frame_pop()");
}
/* at exit */
void

View file

@ -80,12 +80,6 @@ rb_class_clear_method_cache(VALUE klass, VALUE arg)
rb_class_foreach_subclass(klass, rb_class_clear_method_cache, arg);
}
void
rb_clear_cache(void)
{
DEPRECATED_INTERNAL_FEATURE("rb_clear_cache()");
}
void
rb_clear_constant_cache(void)
{