diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-08-27 11:16:52 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-08-27 15:52:26 +0900 |
commit | ae2dc3f217ba9f181471f39a7e5ce72a28b27c2a (patch) | |
tree | e506115b9dd5c2adb07946763506a5b46d36b5f0 /ruby.c | |
parent | 78628618da98236fc1bf702079185b36ed394e2a (diff) | |
download | ruby-ae2dc3f217ba9f181471f39a7e5ce72a28b27c2a.tar.gz |
rb_define_hooked_variable now free from ANYARGS
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is
dangerous and should be extinct. This commit uses rb_gvar_getter_t /
rb_gvar_setter_t for rb_define_hooked_variable /
rb_define_virtual_variable which revealed lots of function prototype
inconsistencies. Some of them were literally decades old, going back
to dda5dc00cff334cac373096d444a0fd59e716124.
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1446,13 +1446,13 @@ VALUE rb_argv0; VALUE rb_e_script; static VALUE -false_value(void) +false_value(ID _x, VALUE *_y) { return Qfalse; } static VALUE -true_value(void) +true_value(ID _x, VALUE *_y) { return Qtrue; } @@ -2230,7 +2230,7 @@ ruby_setproctitle(VALUE title) } static void -set_arg0(VALUE val, ID id) +set_arg0(VALUE val, ID id, VALUE *_) { if (origarg.argv == 0) rb_raise(rb_eRuntimeError, "$0 not initialized"); @@ -2304,16 +2304,14 @@ forbid_setid(const char *s, const ruby_cmdline_options_t *opt) } static void -verbose_setter(VALUE val, ID id, void *data) +verbose_setter(VALUE val, ID id, VALUE *variable) { - VALUE *variable = data; *variable = RTEST(val) ? Qtrue : val; } static VALUE -opt_W_getter(ID id, void *data) +opt_W_getter(ID id, VALUE *variable) { - VALUE *variable = data; switch (*variable) { case Qnil: return INT2FIX(0); |