Ticket #1795: extra_thunks.c.patch
File extra_thunks.c.patch, 2.8 KB (added by ronaldws, 11 years ago) |
---|
-
src/nci/extra_thunks.c
2640 2640 2641 2641 } 2642 2642 static void 2643 pcf_p_ti B3P(PARROT_INTERP, PMC *nci, SHIM(PMC *self))2643 pcf_p_tiV3P(PARROT_INTERP, PMC *nci, SHIM(PMC *self)) 2644 2644 { 2645 typedef void *(* func_t)(char *, int, char**, int *, PMC *);2645 typedef void *(* func_t)(char *, int, void **, int *, PMC *); 2646 2646 func_t fn_pointer; 2647 2647 void *orig_func; 2648 2648 PMC * const ctx = CURRENT_CONTEXT(interp); … … 2653 2653 2654 2654 char *t_0; STRING *ts_0; 2655 2655 INTVAL t_1; 2656 char *t_2; STRING *ts_2;2656 PMC *t_2; void *v_2; 2657 2657 PMC *t_3; int i_3; 2658 2658 PMC * t_4; 2659 2659 UNUSED(return_data); /* Potentially unused, at least */ 2660 Parrot_pcc_fill_params_from_c_args(interp, call_object, "SI SPP", &ts_0, &t_1, &ts_2, &t_3, &t_4);2661 t_0 = STRING_IS_NULL(ts_0) ? (char *)NULL : Parrot_str_to_cstring(interp, ts_0); t_2 = STRING_IS_NULL(ts_2) ? (char *) NULL : Parrot_str_to_cstring(interp, ts_2);i_3 = VTABLE_get_integer(interp, t_3);2660 Parrot_pcc_fill_params_from_c_args(interp, call_object, "SIPPP", &ts_0, &t_1, &t_2, &t_3, &t_4); 2661 t_0 = STRING_IS_NULL(ts_0) ? (char *)NULL : Parrot_str_to_cstring(interp, ts_0);v_2 = VTABLE_get_pointer(interp, t_2);i_3 = VTABLE_get_integer(interp, t_3); 2662 2662 GETATTR_NCI_orig_func(interp, nci, orig_func); 2663 2663 fn_pointer = (func_t)D2FPTR(orig_func); 2664 return_data = (void *)(*fn_pointer)(t_0, t_1, & t_2, &i_3, t_4);2664 return_data = (void *)(*fn_pointer)(t_0, t_1, &v_2, &i_3, t_4); 2665 2665 if (return_data != NULL) { 2666 2666 final_destination = Parrot_pmc_new(interp, enum_class_UnManagedStruct); 2667 2667 VTABLE_set_pointer(interp, final_destination, return_data); … … 2669 2669 ret_object = Parrot_pcc_build_call_from_c_args(interp, call_object, "P", final_destination); 2670 2670 if (!STRING_IS_NULL(ts_0)) Parrot_str_free_cstring(t_0); 2671 2671 2672 if (!STRING_IS_NULL(ts_2)) Parrot_str_free_cstring(t_2);2672 VTABLE_set_pointer(interp, t_2, v_2); 2673 2673 VTABLE_set_integer_native(interp, t_3, i_3); 2674 2674 2675 2675 } … … 7121 7121 VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "ppttttitl"), temp_pmc); 7122 7122 7123 7123 temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct); 7124 VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_p_ti B3P);7125 VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "pti B3P"), temp_pmc);7124 VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_p_tiV3P); 7125 VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "ptiV3P"), temp_pmc); 7126 7126 7127 7127 temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct); 7128 7128 VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_p_tip3P);