From: John M M. <jo...@us...> - 2002-12-21 06:36:41
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims In directory sc8-pr-cvs1:/tmp/cvs-serv30333/squeak/platforms/Mac OS/plugins/SqueakFFIPrims Modified Files: sqMacFFIPPC.c Log Message: 1.3.1 Add test cases for 7 and 13 arguments Index: sqMacFFIPPC.c =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims/sqMacFFIPPC.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sqMacFFIPPC.c 18 Nov 2002 19:09:23 -0000 1.3 --- sqMacFFIPPC.c 21 Dec 2002 06:36:37 -0000 1.4 *************** *** 503,507 **** --- 503,510 ---- EXPORT(short) ffiTestShorts(short c1, short c2, short c3, short c4); EXPORT(int) ffiTestInts(int c1, int c2, int c3, int c4); + EXPORT(int) ffiTestInts8(int c1, int c2, int c3, int c4, int c5, int c6, int c7, int c8); EXPORT(float) ffiTestFloats(float f1, float f2); + EXPORT(float) ffiTestFloats7(float f1, float f2, float f3, float f4, float f5, float f6, float f7); + EXPORT(float) ffiTestFloats13(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13); EXPORT(double) ffiTestDoubles(double d1, double d2); EXPORT(char *) ffiPrintString(char *string); *************** *** 531,534 **** --- 534,543 ---- } + EXPORT(int) ffiTestInts8(int c1, int c2, int c3, int c4, int c5, int c6, int c7, int c8) { + printf("4 ints came in as\ni1 = %d (%x)\ni2 = %d (%x)\ni3 = %d (%x)\ni4 = %d (%x)\ni5 = %d (%x)\ni6 = %d (%x)\ni7 = %d (%x)\ni8 = %d (%x)\n", c1, c1, c2, c2, c3, c3, c4, c4, c5, c5, c6, c6, c7, c7, c8, c8); + return 42; + } + + /* test passing and returning floats */ EXPORT(float) ffiTestFloats(float f1, float f2) { *************** *** 536,539 **** --- 545,559 ---- return (float) (f1 + f2); } + + EXPORT(float) ffiTestFloats7(float f1, float f2, float f3, float f4, float f5, float f6, float f7) { + printf("The 7 floats are %f %f %f %f %f %f %f\n", f1, f2, f3, f4, f5, f6, f7); + return (float) (f1 + f2 + f3 + f4 + f5 + f6 + f7); + } + + EXPORT(float) ffiTestFloats13(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13) { + printf("The 13 floats are %f %f %f %f %f %f %f %f %f %f %f %f %f\n", f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13); + return (float) (f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13); + } + /* test passing and returning doubles */ |