mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
9d7573c41a
commit
391b579097
2 changed files with 13 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Feb 14 12:10:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* variable.c (autoload_const_set, autoload_require): fix
|
||||
signatures.
|
||||
|
||||
Tue Feb 14 05:23:40 2012 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* process.c (proc_wait): Change typo "SystemError" to
|
||||
|
|
13
variable.c
13
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);
|
||||
|
|
Loading…
Reference in a new issue