Mercurial > pub > dyncall > dyncall
comparison test/call_suite_aggrs/main.c @ 527:ed8835abe05f
- cosmetics
author | Tassilo Philipp |
---|---|
date | Thu, 14 Apr 2022 10:13:10 +0200 |
parents | a2de1d0a73f3 |
children | f29db2bf3c0e |
comparison
equal
deleted
inserted
replaced
526:93628a1eaed4 | 527:ed8835abe05f |
---|---|
1 /* | 1 /* |
2 | 2 |
3 Package: dyncall | 3 Package: dyncall |
4 Library: test | 4 Library: test |
5 File: test/call_suite_aggrs/main.c | 5 File: test/call_suite_aggrs/main.c |
6 Description: | 6 Description: |
7 License: | 7 License: |
8 | 8 |
9 Copyright (c) 2022 Tassilo Philipp <tphilipp@potion-studios.com> | 9 Copyright (c) 2022 Tassilo Philipp <tphilipp@potion-studios.com> |
10 | 10 |
11 Permission to use, copy, modify, and distribute this software for any | 11 Permission to use, copy, modify, and distribute this software for any |
37 int i; | 37 int i; |
38 for(i=0; i<G_naggs; ++i) { | 38 for(i=0; i<G_naggs; ++i) { |
39 const char* agg_sig = G_agg_sigs[i]; | 39 const char* agg_sig = G_agg_sigs[i]; |
40 int l = strlen(agg_sig); | 40 int l = strlen(agg_sig); |
41 if(len) | 41 if(len) |
42 *len = l; | 42 *len = l; |
43 if(strncmp(agg_sig, sig, l) == 0) | 43 if(strncmp(agg_sig, sig, l) == 0) |
44 return i; | 44 return i; |
45 } | 45 } |
46 return -1; | 46 return -1; |
47 } | 47 } |
120 } | 120 } |
121 ++pos; | 121 ++pos; |
122 ++sig; | 122 ++sig; |
123 } | 123 } |
124 | 124 |
125 switch(*rtype) | 125 switch(*rtype) |
126 { | 126 { |
127 case 'v': dcCallVoid(p,t); s=1; break; /*TODO:check that no return-arg was touched.*/ | 127 case 'v': dcCallVoid(p,t); s=1; break; /*TODO:check that no return-arg was touched.*/ |
128 case 'B': s = ( dcCallBool (p,t) == K_B[pos]); break; | 128 case 'B': s = ( dcCallBool (p,t) == K_B[pos]); break; |
129 case 'c': s = ( dcCallChar (p,t) == K_c[pos]); break; | 129 case 'c': s = ( dcCallChar (p,t) == K_c[pos]); break; |
130 case 's': s = ( dcCallShort (p,t) == K_s[pos]); break; | 130 case 's': s = ( dcCallShort (p,t) == K_s[pos]); break; |
201 } | 201 } |
202 return 1; | 202 return 1; |
203 } | 203 } |
204 | 204 |
205 static int run_test(int i) | 205 static int run_test(int i) |
206 { | 206 { |
207 char const * sig; | 207 char const * sig; |
208 void * target; | 208 void * target; |
209 int success; | 209 int success; |
210 sig = G_sigtab[i]; | 210 sig = G_sigtab[i]; |
211 target = (void*) G_funtab[i]; | 211 target = (void*) G_funtab[i]; |