Skip to content

Commit

Permalink
vm_insnhelper.c: add casts
Browse files Browse the repository at this point in the history
Why they have not been at the first place?  Siblings have proper casts.
  • Loading branch information
shyouhei committed Sep 21, 2022
1 parent 406ebb2 commit 06cb030
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions vm_insnhelper.c
Expand Up @@ -2700,14 +2700,16 @@ static VALUE
call_cfunc_m2(VALUE recv, int argc, const VALUE *argv, VALUE (*func)(ANYARGS))
{
ractor_unsafe_check();
return (*func)(recv, rb_ary_new4(argc, argv));
VALUE(*f)(VALUE, VALUE) = (VALUE(*)(VALUE, VALUE))func;
return (*f)(recv, rb_ary_new4(argc, argv));
}

static VALUE
call_cfunc_m1(VALUE recv, int argc, const VALUE *argv, VALUE (*func)(ANYARGS))
{
ractor_unsafe_check();
return (*func)(argc, argv, recv);
VALUE(*f)(int, const VALUE *, VALUE) = (VALUE(*)(int, const VALUE *, VALUE))func;
return (*f)(argc, argv, recv);
}

static VALUE
Expand Down Expand Up @@ -2841,13 +2843,15 @@ call_cfunc_15(VALUE recv, int argc, const VALUE *argv, VALUE (*func)(ANYARGS))
static VALUE
ractor_safe_call_cfunc_m2(VALUE recv, int argc, const VALUE *argv, VALUE (*func)(ANYARGS))
{
return (*func)(recv, rb_ary_new4(argc, argv));
VALUE(*f)(VALUE, VALUE) = (VALUE(*)(VALUE, VALUE))func;
return (*f)(recv, rb_ary_new4(argc, argv));
}

static VALUE
ractor_safe_call_cfunc_m1(VALUE recv, int argc, const VALUE *argv, VALUE (*func)(ANYARGS))
{
return (*func)(argc, argv, recv);
VALUE(*f)(int, const VALUE *, VALUE) = (VALUE(*)(int, const VALUE *, VALUE))func;
return (*f)(argc, argv, recv);
}

static VALUE
Expand Down

0 comments on commit 06cb030

Please sign in to comment.