Fix parameter types for rb_ivar_foreach() callbacks

For this public API, the callback is declared to take
`(ID, VALUE, st_data_t)`, but it so happens that using
`(st_data_t, st_data_t, st_data_t)` also
type checks, because the underlying type is identical.
Use it as declared and get rid of some casts.
This commit is contained in:
Alan Wu 2023-12-05 17:54:37 -05:00
parent 56eccb350b
commit 0346cbbc14
4 changed files with 11 additions and 19 deletions

View file

@ -702,10 +702,8 @@ rb_inspect(VALUE obj)
}
static int
inspect_i(st_data_t k, st_data_t v, st_data_t a)
inspect_i(ID id, VALUE value, st_data_t a)
{
ID id = (ID)k;
VALUE value = (VALUE)v;
VALUE str = (VALUE)a;
/* need not to show internal data */