summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-08-27 11:16:52 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-08-27 15:52:26 +0900
commitae2dc3f217ba9f181471f39a7e5ce72a28b27c2a (patch)
treee506115b9dd5c2adb07946763506a5b46d36b5f0 /ruby.c
parent78628618da98236fc1bf702079185b36ed394e2a (diff)
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.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/ruby.c b/ruby.c
index 2610cf2..57c95fa 100644
--- a/ruby.c
+++ b/ruby.c
@@ -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);