From 391b579097f233cb734f89c6c39257e77473fa51 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 14 Feb 2012 03:10:11 +0000 Subject: * 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 --- variable.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'variable.c') 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); -- cgit v1.2.3