work around xform parsing issue

svn: r14766
This commit is contained in:
Eli Barzilay 2009-05-09 23:21:13 +00:00
parent f4bb0243fa
commit e9bcf8b15f
2 changed files with 7 additions and 3 deletions

View File

@ -2333,6 +2333,8 @@ void do_ptr_finalizer(void *p, void *finalizer)
#define MAX_QUICK_ARGS 16 #define MAX_QUICK_ARGS 16
typedef void(*VoidFun)();
Scheme_Object *ffi_do_call(void *data, int argc, Scheme_Object *argv[]) Scheme_Object *ffi_do_call(void *data, int argc, Scheme_Object *argv[])
/* data := {name, c-function, itypes, otype, cif} */ /* data := {name, c-function, itypes, otype, cif} */
{ {
@ -2419,7 +2421,7 @@ Scheme_Object *ffi_do_call(void *data, int argc, Scheme_Object *argv[])
} }
} }
/* Finally, call the function */ /* Finally, call the function */
ffi_call(cif, (void(*)())W_OFFSET(c_func, cfoff), p, avalues); ffi_call(cif, (VoidFun)W_OFFSET(c_func, cfoff), p, avalues);
if (ivals != stack_ivals) free(ivals); if (ivals != stack_ivals) free(ivals);
ivals = NULL; /* no need now to hold on to this */ ivals = NULL; /* no need now to hold on to this */
for (i=0; i<nargs; i++) { avalues[i] = NULL; } /* no need for these refs */ for (i=0; i<nargs; i++) { avalues[i] = NULL; } /* no need for these refs */

View File

@ -1737,6 +1737,8 @@ cdefine[register-finalizer 2 3]{
#define MAX_QUICK_ARGS 16 #define MAX_QUICK_ARGS 16
typedef void(*VoidFun)();
Scheme_Object *ffi_do_call(void *data, int argc, Scheme_Object *argv[]) Scheme_Object *ffi_do_call(void *data, int argc, Scheme_Object *argv[])
/* data := {name, c-function, itypes, otype, cif} */ /* data := {name, c-function, itypes, otype, cif} */
{ {
@ -1819,11 +1821,11 @@ Scheme_Object *ffi_do_call(void *data, int argc, Scheme_Object *argv[])
/* Otherwise it was a struct pointer, and avalues[i] is already fine. */ /* Otherwise it was a struct pointer, and avalues[i] is already fine. */
/* Add offset, if any: */ /* Add offset, if any: */
if (offsets[i] != 0) { if (offsets[i] != 0) {
ivals[i].x_pointer = (char *)ivals[i].x_pointer + offsets[i]; ivals[i].x_pointer = (char *)ivals[i].x_pointer + offsets[i];
} }
} }
/* Finally, call the function */ /* Finally, call the function */
ffi_call(cif, (void(*)())W_OFFSET(c_func, cfoff), p, avalues); ffi_call(cif, (VoidFun)W_OFFSET(c_func, cfoff), p, avalues);
if (ivals != stack_ivals) free(ivals); if (ivals != stack_ivals) free(ivals);
ivals = NULL; /* no need now to hold on to this */ ivals = NULL; /* no need now to hold on to this */
for (i=0; i<nargs; i++) { avalues[i] = NULL; } /* no need for these refs */ for (i=0; i<nargs; i++) { avalues[i] = NULL; } /* no need for these refs */