dont take sizeof(void), fix function typecase (both PR10234), fix error message

svn: r14764
This commit is contained in:
Eli Barzilay 2009-05-09 19:39:17 +00:00
parent 248fb510b9
commit cd6fbedfa8
2 changed files with 10 additions and 6 deletions

View File

@ -1752,8 +1752,10 @@ static Scheme_Object *foreign_compiler_sizeof(int argc, Scheme_Object *argv[])
else scheme_signal_error(MYNAME": cannot qualify 'char");
break;
case 3: /* void */
if (intsize==0) RETSIZE(void);
else scheme_signal_error(MYNAME": cannot qualify 'char");
if (intsize==0 && stars>0) RETSIZE(void);
else if (stars==0)
scheme_signal_error(MYNAME": cannot use 'void without a '*");
else scheme_signal_error(MYNAME": cannot qualify 'void");
break;
case 4: /* float */
if (intsize==0) RETSIZE(float);
@ -2417,7 +2419,7 @@ Scheme_Object *ffi_do_call(void *data, int argc, Scheme_Object *argv[])
}
}
/* Finally, call the function */
ffi_call(cif, (void *)W_OFFSET(c_func, cfoff), p, avalues);
ffi_call(cif, (void(*)())W_OFFSET(c_func, cfoff), p, avalues);
if (ivals != stack_ivals) free(ivals);
ivals = NULL; /* no need now to hold on to this */
for (i=0; i<nargs; i++) { avalues[i] = NULL; } /* no need for these refs */

View File

@ -1224,8 +1224,10 @@ static void* SCHEME2C(Scheme_Object *type, void *dst, long delta,
else scheme_signal_error(MYNAME": cannot qualify 'char");
break;
case 3: /* void */
if (intsize==0) RETSIZE(void);
else scheme_signal_error(MYNAME": cannot qualify 'char");
if (intsize==0 && stars>0) RETSIZE(void);
else if (stars==0)
scheme_signal_error(MYNAME": cannot use 'void without a '*");
else scheme_signal_error(MYNAME": cannot qualify 'void");
break;
case 4: /* float */
if (intsize==0) RETSIZE(float);
@ -1821,7 +1823,7 @@ Scheme_Object *ffi_do_call(void *data, int argc, Scheme_Object *argv[])
}
}
/* Finally, call the function */
ffi_call(cif, (void *)W_OFFSET(c_func, cfoff), p, avalues);
ffi_call(cif, (void(*)())W_OFFSET(c_func, cfoff), p, avalues);
if (ivals != stack_ivals) free(ivals);
ivals = NULL; /* no need now to hold on to this */
for (i=0; i<nargs; i++) { avalues[i] = NULL; } /* no need for these refs */