From a2561fe3b0d555b4b69414282512577bce5ea0f7 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 3 Jun 2015 14:07:24 +0000 Subject: * vm_method.c: rename `rb_frame_...' to `rb_scope_...'. * eval_intern.h: move decl. of rb_scope_visibility_set() to method.h. * load.c: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ eval_intern.h | 2 -- load.c | 2 +- method.h | 2 ++ vm_method.c | 20 ++++++++++---------- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7df89dca9..29c120c255 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Jun 3 23:03:50 2015 Koichi Sasada + + * vm_method.c: rename `rb_frame_...' to `rb_scope_...'. + + * eval_intern.h: move decl. of rb_scope_visibility_set() to method.h. + + * load.c: catch up this fix. + Wed Jun 3 21:14:20 2015 Tanaka Akira * ext/rbconfig/sizeof/extconf.rb: Check C99 standard integer types. diff --git a/eval_intern.h b/eval_intern.h index e503d15d9d..df2d857340 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -291,8 +291,6 @@ CREF_OMOD_SHARED_UNSET(rb_cref_t *cref) cref->flags &= ~NODE_FL_CREF_OMOD_SHARED_; } -void rb_frame_visibility_set(rb_method_visibility_t); - void rb_thread_cleanup(void); void rb_thread_wait_other_threads(void); diff --git a/load.c b/load.c index bf1d4ee982..02b4a68a89 100644 --- a/load.c +++ b/load.c @@ -929,7 +929,7 @@ load_failed(VALUE fname) static VALUE load_ext(VALUE path) { - rb_frame_visibility_set(METHOD_VISI_PUBLIC); + rb_scope_visibility_set(METHOD_VISI_PUBLIC); return (VALUE)dln_load(RSTRING_PTR(path)); } diff --git a/method.h b/method.h index fbd8ce9953..16c20dc345 100644 --- a/method.h +++ b/method.h @@ -141,4 +141,6 @@ rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_d rb_method_entry_t *rb_method_entry_clone(const rb_method_entry_t *me); void rb_method_entry_copy(rb_method_entry_t *dst, rb_method_entry_t *src); +void rb_scope_visibility_set(rb_method_visibility_t); + #endif /* METHOD_H */ diff --git a/vm_method.c b/vm_method.c index fcc033bc3f..20e4794f41 100644 --- a/vm_method.c +++ b/vm_method.c @@ -934,7 +934,7 @@ rb_method_boundp(VALUE klass, ID id, int ex) extern ID rb_check_attr_id(ID id); static int -rb_frame_visibility_test(rb_method_visibility_t visi) +rb_scope_visibility_test(rb_method_visibility_t visi) { rb_thread_t *th = GET_THREAD(); rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp); @@ -948,21 +948,21 @@ rb_frame_visibility_test(rb_method_visibility_t visi) } static int -rb_frame_module_func_check(void) +rb_scope_module_func_check(void) { return CREF_SCOPE_VISI(rb_vm_cref())->module_func; } void -rb_frame_visibility_set(rb_method_visibility_t visi) +rb_scope_visibility_set(rb_method_visibility_t visi) { rb_scope_visibility_t *scope_visi = (rb_scope_visibility_t *)&rb_vm_cref()->scope_visi; scope_visi->method_visi = visi; scope_visi->module_func = FALSE; } -void -rb_frame_module_func_set(void) +static void +rb_scope_module_func_set(void) { rb_scope_visibility_t *scope_visi = (rb_scope_visibility_t *)&rb_vm_cref()->scope_visi; scope_visi->method_visi = METHOD_VISI_PRIVATE; @@ -980,13 +980,13 @@ rb_attr(VALUE klass, ID id, int read, int write, int ex) visi = METHOD_VISI_PUBLIC; } else { - if (rb_frame_visibility_test(METHOD_VISI_PRIVATE)) { + if (rb_scope_visibility_test(METHOD_VISI_PRIVATE)) { visi = METHOD_VISI_PRIVATE; - if (rb_frame_module_func_check()) { + if (rb_scope_module_func_check()) { rb_warning("attribute accessor as module_function"); } } - else if (rb_frame_visibility_test(METHOD_VISI_PROTECTED)) { + else if (rb_scope_visibility_test(METHOD_VISI_PROTECTED)) { visi = METHOD_VISI_PROTECTED; } else { @@ -1485,7 +1485,7 @@ static VALUE set_visibility(int argc, const VALUE *argv, VALUE module, rb_method_visibility_t visi) { if (argc == 0) { - rb_frame_visibility_set(visi); + rb_scope_visibility_set(visi); } else { set_method_visibility(module, argc, argv, visi); @@ -1686,7 +1686,7 @@ rb_mod_modfunc(int argc, VALUE *argv, VALUE module) } if (argc == 0) { - rb_frame_module_func_set(); + rb_scope_module_func_set(); return module; } -- cgit v1.2.3