diff test/call_suite/main.c @ 511:a0c51f34023a

test/call_suite: - less confusing and simpler generated code (with first arg in V_?[0] output) - avoid using same test reference value for retval and last arg
author Tassilo Philipp
date Sat, 09 Apr 2022 23:48:01 +0200
parents ed7d1f5e7973
children c9c546f8598b
line wrap: on
line diff
--- a/test/call_suite/main.c	Sat Apr 09 23:45:44 2022 +0200
+++ b/test/call_suite/main.c	Sat Apr 09 23:48:01 2022 +0200
@@ -23,6 +23,7 @@
 
 */
 
+
 #include "dyncall.h"
 #include "globals.h"
 #include <string.h>
@@ -56,7 +57,6 @@
   ++rtype;
 
   while ( (atype = *sig++) != ')') {
-    pos++;
     switch(atype) {
       case 'c':  dcArgChar    (p,K_c[pos]); break;
       case 's':  dcArgShort   (p,K_s[pos]); break;
@@ -73,6 +73,7 @@
       case 'd':  dcArgDouble  (p,K_d[pos]); break;
       default: printf("unknown atype '%c' (1) ;", atype); return 0;
     }
+    ++pos;
   }
   
   switch(*rtype) 
@@ -98,7 +99,7 @@
 
   /* test: */
   sig = signature;
-  pos = 1;
+  pos = 0;
   while ( (atype = *sig++) != ')') {
     switch(atype) {
       case 'c':  s = ( V_c[pos] == K_c[pos] ); if (!s) printf("'%c':%d: %d != %d ; ",     atype, pos, V_c[pos], K_c[pos]); break;