summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-13 17:20:11 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-13 17:20:11 (GMT)
commitdd4cec36ca0229e5dcc45393f59f2633d2e350bf (patch)
tree103742b8a708b0ffe530370e3a5f124ca7f64b68 /vm_method.c
parent6687b34876a2677bb1d7288de82376960fb35ec7 (diff)
* method.h: constify rb_cref_t::scope_visi;
* eval_intern.h (CREF_SCOPE_VISI_COPY): catch up this fix. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/vm_method.c b/vm_method.c
index 7d658b0..6c2137b 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1048,20 +1048,24 @@ rb_scope_module_func_check(void)
return CREF_SCOPE_VISI(rb_vm_cref())->module_func;
}
+static void
+vm_cref_set_visibility(rb_method_visibility_t method_visi, int module_func)
+{
+ rb_scope_visibility_t *scope_visi = (rb_scope_visibility_t *)&rb_vm_cref()->scope_visi;
+ scope_visi->method_visi = method_visi;
+ scope_visi->module_func = module_func;
+}
+
void
rb_scope_visibility_set(rb_method_visibility_t visi)
{
- rb_scope_visibility_t *scope_visi = &rb_vm_cref()->scope_visi;
- scope_visi->method_visi = visi;
- scope_visi->module_func = FALSE;
+ vm_cref_set_visibility(visi, FALSE);
}
static void
rb_scope_module_func_set(void)
{
- rb_scope_visibility_t *scope_visi = &rb_vm_cref()->scope_visi;
- scope_visi->method_visi = METHOD_VISI_PRIVATE;
- scope_visi->module_func = TRUE;
+ vm_cref_set_visibility(METHOD_VISI_PRIVATE, TRUE);
}
void