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

@ -3248,9 +3248,9 @@ exception_dumper(VALUE exc)
}
static int
ivar_copy_i(st_data_t key, st_data_t val, st_data_t exc)
ivar_copy_i(ID key, VALUE val, st_data_t exc)
{
rb_ivar_set((VALUE) exc, (ID) key, (VALUE) val);
rb_ivar_set((VALUE)exc, key, val);
return ST_CONTINUE;
}