mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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:
parent
56eccb350b
commit
0346cbbc14
4 changed files with 11 additions and 19 deletions
4
object.c
4
object.c
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue