From fd0df9c4fb36597e5e3f500670b29dbd77a14eca Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Tue, 6 Jul 2021 18:52:29 +0200 Subject: Emit deprecatation warnings for rb_iterate() * It is obsolete since 1.9, see https://github.com/ruby/ruby/blob/master/doc/extension.rdoc#label-Control+Structure and [Misc #18025] --- proc.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 6e1572847b..78b671a785 100644 --- a/proc.c +++ b/proc.c @@ -3152,18 +3152,6 @@ method_inspect(VALUE method) return str; } -static VALUE -mproc(VALUE method) -{ - return rb_funcallv(rb_mRubyVMFrozenCore, idProc, 0, 0); -} - -static VALUE -mlambda(VALUE method) -{ - return rb_funcallv(rb_mRubyVMFrozenCore, idLambda, 0, 0); -} - static VALUE bmcall(RB_BLOCK_CALL_FUNC_ARGLIST(args, method)) { @@ -3175,7 +3163,7 @@ rb_proc_new( rb_block_call_func_t func, VALUE val) { - VALUE procval = rb_iterate(mproc, 0, func, val); + VALUE procval = rb_block_call(rb_mRubyVMFrozenCore, idProc, 0, 0, func, val); return procval; } @@ -3201,7 +3189,7 @@ method_to_proc(VALUE method) * end * end */ - procval = rb_iterate(mlambda, 0, bmcall, method); + procval = rb_block_call(rb_mRubyVMFrozenCore, idLambda, 0, 0, bmcall, method); GetProcPtr(procval, proc); proc->is_from_method = 1; return procval; -- cgit v1.2.1