summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-01 17:55:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-01 17:55:44 +0000
commit0fdb18e513b53e71911c57a7b5fddd86c3a17704 (patch)
tree523b417e821e5b7586abaca925e88cceb33e4f6c /vm.c
parent43ba2c01e746992e9658000e4df7bb025bfb6b01 (diff)
vm.c: constify
* vm.c (vm_make_env_each): constify pointer arguments. (collect_local_variables_in_iseq): ditto. (collect_local_variables_in_env): ditto. (vm_collect_local_variables_in_heap): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/vm.c b/vm.c
index 8eb02f3..a84320b 100644
--- a/vm.c
+++ b/vm.c
@@ -453,8 +453,8 @@ check_env_value(VALUE envval)
}
static VALUE
-vm_make_env_each(rb_thread_t * const th, rb_control_frame_t * const cfp,
- VALUE *envptr, VALUE * const endptr)
+vm_make_env_each(const rb_thread_t *const th, rb_control_frame_t *const cfp,
+ VALUE *envptr, const VALUE *const endptr)
{
VALUE envval, penvval = 0;
rb_env_t *env;
@@ -532,7 +532,7 @@ vm_make_env_each(rb_thread_t * const th, rb_control_frame_t * const cfp,
}
static int
-collect_local_variables_in_iseq(rb_iseq_t *iseq, const struct local_var_list *vars)
+collect_local_variables_in_iseq(const rb_iseq_t *iseq, const struct local_var_list *vars)
{
int i;
if (!iseq) return 0;
@@ -542,19 +542,18 @@ collect_local_variables_in_iseq(rb_iseq_t *iseq, const struct local_var_list *va
return 1;
}
-static int
-collect_local_variables_in_env(rb_env_t *env, const struct local_var_list *vars)
+static void
+collect_local_variables_in_env(const rb_env_t *env, const struct local_var_list *vars)
{
while (collect_local_variables_in_iseq(env->block.iseq, vars),
env->prev_envval) {
GetEnvPtr(env->prev_envval, env);
}
- return 0;
}
static int
-vm_collect_local_variables_in_heap(rb_thread_t *th, VALUE *ep, const struct local_var_list *vars)
+vm_collect_local_variables_in_heap(rb_thread_t *th, const VALUE *ep, const struct local_var_list *vars)
{
if (ENV_IN_HEAP_P(th, ep)) {
rb_env_t *env;