summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-08-26 16:06:40 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-08-27 15:52:26 +0900
commit6dd60cf114701f1ff3526381c0e742c588af2f91 (patch)
treed3552b145f9b5153c470ad7e3cf560c0dd5c552e /ext
parente3fc30564e9466d6926f9d25a090dcf787bd5c33 (diff)
st_foreach now free from ANYARGS
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from st_foreach. I strongly believe that this commit should have had come with b0af0592fdd9e9d4e4b863fde006d67ccefeac21, which added extra parameter to st_foreach callbacks.
Diffstat (limited to 'ext')
-rw-r--r--ext/-test-/st/foreach/foreach.c2
-rw-r--r--ext/-test-/st/numhash/numhash.c3
-rw-r--r--ext/objspace/object_tracing.c4
3 files changed, 4 insertions, 5 deletions
diff --git a/ext/-test-/st/foreach/foreach.c b/ext/-test-/st/foreach/foreach.c
index 209b535503..27ac18046f 100644
--- a/ext/-test-/st/foreach/foreach.c
+++ b/ext/-test-/st/foreach/foreach.c
@@ -106,7 +106,7 @@ unp_fec(VALUE self, VALUE test)
}
static int
-unp_fe_i(st_data_t key, st_data_t val, st_data_t args, int error)
+unp_fe_i(st_data_t key, st_data_t val, st_data_t args)
{
struct checker *c = (struct checker *)args;
diff --git a/ext/-test-/st/numhash/numhash.c b/ext/-test-/st/numhash/numhash.c
index fc35f476cd..71eeed4910 100644
--- a/ext/-test-/st/numhash/numhash.c
+++ b/ext/-test-/st/numhash/numhash.c
@@ -57,7 +57,7 @@ numhash_aset(VALUE self, VALUE key, VALUE data)
}
static int
-numhash_i(st_data_t key, st_data_t value, st_data_t arg)
+numhash_i(st_data_t key, st_data_t value, st_data_t arg, int _)
{
VALUE ret;
ret = rb_yield_values(3, (VALUE)key, (VALUE)value, (VALUE)arg);
@@ -135,4 +135,3 @@ Init_numhash(void)
rb_define_method(st, "size", numhash_size, 0);
rb_define_method(st, "delete_safe", numhash_delete_safe, 1);
}
-
diff --git a/ext/objspace/object_tracing.c b/ext/objspace/object_tracing.c
index 7c354498ab..a057ac2a96 100644
--- a/ext/objspace/object_tracing.c
+++ b/ext/objspace/object_tracing.c
@@ -138,14 +138,14 @@ freeobj_i(VALUE tpval, void *data)
}
static int
-free_keys_i(st_data_t key, st_data_t value, void *data)
+free_keys_i(st_data_t key, st_data_t value, st_data_t data)
{
ruby_xfree((void *)key);
return ST_CONTINUE;
}
static int
-free_values_i(st_data_t key, st_data_t value, void *data)
+free_values_i(st_data_t key, st_data_t value, st_data_t data)
{
ruby_xfree((void *)value);
return ST_CONTINUE;