Mercurial > pub > dyncall > dyncall
comparison test/suite_aggrs/main.c @ 434:3d2c5d156d78
- test/suite_aggrs: support for nested structs, now
author | Tassilo Philipp |
---|---|
date | Sun, 23 Jan 2022 23:20:02 +0100 |
parents | 45662241d9cd |
children | a29baee68340 |
comparison
equal
deleted
inserted
replaced
433:45662241d9cd | 434:3d2c5d156d78 |
---|---|
42 return i; | 42 return i; |
43 } | 43 } |
44 return -1; | 44 return -1; |
45 } | 45 } |
46 | 46 |
47 int invoke(char const* signature, void* t) | 47 static int invoke(char const* signature, void* t) |
48 { | 48 { |
49 DCCallVM * p = (DCCallVM*) G_callvm; | 49 DCCallVM * p = (DCCallVM*) G_callvm; |
50 char const * sig = signature; | 50 char const * sig = signature; |
51 char const * sig_args; | 51 char const * sig_args; |
52 char rtype; | 52 char rtype; |
69 } | 69 } |
70 rtype = *sig; | 70 rtype = *sig; |
71 sig += len; | 71 sig += len; |
72 | 72 |
73 rtype_st_cmp = G_agg_cmpfuncs[i]; | 73 rtype_st_cmp = G_agg_cmpfuncs[i]; |
74 rtype_st = ((DCstruct*(*)())G_agg_newdcstfuncs[i])(); | 74 rtype_st = ((DCstruct*(*)())G_agg_newdcstfuncs[i])(NULL); |
75 dcBeginCallStruct(p, rtype_st, DC_FALSE); | 75 dcBeginCallStruct(p, rtype_st, DC_FALSE); |
76 } | 76 } |
77 else | 77 else |
78 rtype = *sig++; | 78 rtype = *sig++; |
79 | 79 |
96 int i = find_agg_idx(&len, sig); | 96 int i = find_agg_idx(&len, sig); |
97 if(i == -1) { | 97 if(i == -1) { |
98 printf("unknown sig at '%s' ;", sig); | 98 printf("unknown sig at '%s' ;", sig); |
99 return 0; | 99 return 0; |
100 } | 100 } |
101 DCstruct *st = ((DCstruct*(*)())G_agg_newdcstfuncs[i])(); | 101 DCstruct *st = ((DCstruct*(*)())G_agg_newdcstfuncs[i])(NULL); |
102 dcArgStruct(p, st, K_a[pos]); | 102 dcArgStruct(p, st, K_a[pos]); |
103 sig += len-1; /* advance to next arg char */ | 103 sig += len-1; /* advance to next arg char */ |
104 break; | 104 break; |
105 } | 105 } |
106 default: printf("unknown atype '%c' (1) ;", atype); return 0; | 106 default: printf("unknown atype '%c' (1) ;", atype); return 0; |