aboutsummaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-14 03:10:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-14 03:10:11 +0000
commit391b579097f233cb734f89c6c39257e77473fa51 (patch)
treedba9920f97d26a614be8751a4f05bb1ceef5c52a /variable.c
parent9d7573c41a33f7759ea62b7f0d273bdcd90f2171 (diff)
downloadruby-391b579097f233cb734f89c6c39257e77473fa51.tar.gz
* variable.c (autoload_const_set, autoload_require): fix
signatures. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/variable.c b/variable.c
index 0dec1aa285..3e57d0d1ec 100644
--- a/variable.c
+++ b/variable.c
@@ -1639,16 +1639,19 @@ struct autoload_const_set_args {
VALUE value;
};
-static void
-autoload_const_set(struct autoload_const_set_args* args)
+static VALUE
+autoload_const_set(VALUE arg)
{
+ struct autoload_const_set_args* args = (struct autoload_const_set_args *)arg;
autoload_delete(args->mod, args->id);
rb_const_set(args->mod, args->id, args->value);
+ return 0; /* ignored */
}
static VALUE
-autoload_require(struct autoload_data_i *ele)
+autoload_require(VALUE arg)
{
+ struct autoload_data_i *ele = (struct autoload_data_i *)arg;
return rb_require_safe(ele->feature, ele->safe_level);
}
@@ -1674,7 +1677,7 @@ rb_autoload_load(VALUE mod, ID id)
ele->thread = rb_thread_current();
}
/* autoload_data_i can be deleted by another thread while require */
- result = rb_protect((VALUE(*)(VALUE))autoload_require, (VALUE)ele, &state);
+ result = rb_protect(autoload_require, (VALUE)ele, &state);
if (ele->thread == rb_thread_current()) {
ele->thread = Qnil;
}
@@ -1690,7 +1693,7 @@ rb_autoload_load(VALUE mod, ID id)
args.value = ele->value;
safe_backup = rb_safe_level();
rb_set_safe_level_force(ele->safe_level);
- rb_ensure((VALUE(*)(VALUE))autoload_const_set, (VALUE)&args, reset_safe, (VALUE)safe_backup);
+ rb_ensure(autoload_const_set, (VALUE)&args, reset_safe, (VALUE)safe_backup);
}
}
RB_GC_GUARD(load);