Mercurial > pub > dyncall > dyncall
diff test/suite_aggrs/mk-cases.lua @ 435:a29baee68340
- suite_aggrs: simplified nested struct handling given upcoming api simplification (still not in depo, though, so test is ahead)
author | Tassilo Philipp |
---|---|
date | Mon, 24 Jan 2022 12:41:27 +0100 |
parents | 3d2c5d156d78 |
children | b4ddad459690 |
line wrap: on
line diff
--- a/test/suite_aggrs/mk-cases.lua Sun Jan 23 23:20:02 2022 +0100 +++ b/test/suite_aggrs/mk-cases.lua Mon Jan 24 12:41:27 2022 +0100 @@ -161,12 +161,10 @@ end -- convenient dcnewstruct helper funcs - io.write('static int nfields'..v[2]..' = '..(#v[1]>>1)..';\n') - io.write('DCstruct* f_newdcst'..v[2]..'(DCstruct* parent) {\n\tDCstruct* st = parent;\n\tif(!st) st = dcNewStruct(nfields'..v[2]..', sizeof('..st..'), 0, 1);\n\t') + io.write('DCstruct* f_newdcst'..v[2]..'() {\n\tDCstruct* st = dcNewStruct('..(#v[1]>>1)..', sizeof('..st..'), 0, 1);\n\t') for i = 1, #v[1], 2 do if string.match(v[1][i], '^struct') then - io.write('dcSubStruct(st, nfields'..v[1][i]:sub(8)..', offsetof('..st..', '..v[1][i+1]..'), sizeof('..v[1][i]..'), 0, DC_TRUE, 1);\n\t') - io.write("f_newdcst"..v[1][i]:sub(8)..'(st);\n\t') + io.write('dcStructField(st, DC_SIGCHAR_STRUCT, offsetof('..st..', '..v[1][i+1]..'), 1, f_newdcst'..v[1][i]:sub(8)..'());\n\t') else io.write("dcStructField(st, '"..v[1][i].."', offsetof("..st..', '..v[1][i+1]..'), 1);\n\t') end