From 6fdd701472af5355562cb2394167b26a4c3a2a97 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Sun, 29 Sep 2019 16:41:00 -0700 Subject: Remove VM_NO_KEYWORDS, replace with RB_NO_KEYWORDS VM_NO_KEYWORDS was introduced first in vm_core.h, but it is best to only use a single definition for this. --- proc.c | 4 ++-- vm.c | 2 +- vm_args.c | 2 +- vm_core.h | 1 - vm_eval.c | 6 +++--- vm_insnhelper.c | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/proc.c b/proc.c index 91e9f98ddc..667b86ac1b 100644 --- a/proc.c +++ b/proc.c @@ -960,7 +960,7 @@ rb_proc_call(VALUE self, VALUE args) GetProcPtr(self, proc); vret = rb_vm_invoke_proc(GET_EC(), proc, check_argc(RARRAY_LEN(args)), RARRAY_CONST_PTR(args), - VM_NO_KEYWORDS, VM_BLOCK_HANDLER_NONE); + RB_NO_KEYWORDS, VM_BLOCK_HANDLER_NONE); RB_GC_GUARD(self); RB_GC_GUARD(args); return vret; @@ -993,7 +993,7 @@ rb_proc_call_with_block(VALUE self, int argc, const VALUE *argv, VALUE passed_pr VALUE vret; rb_proc_t *proc; GetProcPtr(self, proc); - vret = rb_vm_invoke_proc(ec, proc, argc, argv, VM_NO_KEYWORDS, proc_to_block_handler(passed_procval)); + vret = rb_vm_invoke_proc(ec, proc, argc, argv, RB_NO_KEYWORDS, proc_to_block_handler(passed_procval)); RB_GC_GUARD(self); return vret; } diff --git a/vm.c b/vm.c index a442e9f553..e104688d71 100644 --- a/vm.c +++ b/vm.c @@ -1191,7 +1191,7 @@ static VALUE vm_yield_force_blockarg(rb_execution_context_t *ec, VALUE args) { return invoke_block_from_c_bh(ec, check_block_handler(ec), 1, &args, - VM_NO_KEYWORDS, VM_BLOCK_HANDLER_NONE, NULL, FALSE, TRUE); + RB_NO_KEYWORDS, VM_BLOCK_HANDLER_NONE, NULL, FALSE, TRUE); } ALWAYS_INLINE(static VALUE diff --git a/vm_args.c b/vm_args.c index 3e90e8a16b..92deef5586 100644 --- a/vm_args.c +++ b/vm_args.c @@ -1064,7 +1064,7 @@ vm_to_proc(VALUE proc) rb_callable_method_entry_with_refinements(CLASS_OF(proc), idTo_proc, NULL); if (me) { - b = rb_vm_call0(GET_EC(), proc, idTo_proc, 0, NULL, me, VM_NO_KEYWORDS); + b = rb_vm_call0(GET_EC(), proc, idTo_proc, 0, NULL, me, RB_NO_KEYWORDS); } else { /* NOTE: calling method_missing */ diff --git a/vm_core.h b/vm_core.h index f1e7443926..8eb155585e 100644 --- a/vm_core.h +++ b/vm_core.h @@ -1281,7 +1281,6 @@ VM_FRAME_RUBYFRAME_P(const rb_control_frame_t *cfp) #define VM_GUARDED_PREV_EP(ep) GC_GUARDED_PTR(ep) #define VM_BLOCK_HANDLER_NONE 0 -#define VM_NO_KEYWORDS 0 static inline int VM_ENV_LOCAL_P(const VALUE *ep) diff --git a/vm_eval.c b/vm_eval.c index 04a1315b0d..f6a1cc035e 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -267,7 +267,7 @@ rb_adjust_argv_kw_splat(int *argc, const VALUE **argv, int *kw_splat) VALUE rb_vm_call(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me) { - return rb_vm_call0(ec, recv, id, argc, argv, me, VM_NO_KEYWORDS); + return rb_vm_call0(ec, recv, id, argc, argv, me, RB_NO_KEYWORDS); } MJIT_FUNC_EXPORTED VALUE @@ -371,7 +371,7 @@ rb_call0(rb_execution_context_t *ec, const rb_callable_method_entry_t *me; enum method_missing_reason call_status; call_type scope = call_scope; - int kw_splat = VM_NO_KEYWORDS; + int kw_splat = RB_NO_KEYWORDS; switch(scope) { case(CALL_PUBLIC_KW): @@ -1012,7 +1012,7 @@ rb_funcallv_with_cc(struct rb_call_cache_and_mid *cc, VALUE recv, ID mid, int ar Qundef, recv, argc, - VM_NO_KEYWORDS, + RB_NO_KEYWORDS, }, &ci, &cc->cc, diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 4375a4827e..54142b8d71 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1625,7 +1625,7 @@ check_match(rb_execution_context_t *ec, VALUE pattern, VALUE target, enum vm_che const rb_callable_method_entry_t *me = rb_callable_method_entry_with_refinements(CLASS_OF(pattern), idEqq, NULL); if (me) { - return rb_vm_call0(ec, pattern, idEqq, 1, &target, me, VM_NO_KEYWORDS); + return rb_vm_call0(ec, pattern, idEqq, 1, &target, me, RB_NO_KEYWORDS); } else { /* fallback to funcall (e.g. method_missing) */ -- cgit v1.2.3