Method: RCSimCinterface.rcsim_make_cast

Defined in:
ext/hruby_sim/hruby_rcsim_build.c

.rcsim_make_cast(type, child) ⇒ Object

Creating a cast C object.



732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
# File 'ext/hruby_sim/hruby_rcsim_build.c', line 732

VALUE rcsim_make_cast(VALUE mod, VALUE type, VALUE child) {
    // printf("rcsim_make_cast\n");
    /* Allocates the cast. */
    Cast cast = (Cast)malloc(sizeof(CastS));
    // printf("cast=%p\n",cast);
    /* Set it up. */
    cast->kind = CAST;
    cast->owner = NULL;
    value_to_rcsim(TypeS,type,cast->type);
    value_to_rcsim(ExpressionS,child,cast->child);
    /* Returns the C cast embedded into a ruby VALUE. */
    VALUE res;
    rcsim_to_value(CastS,cast,res);
    return res;
}