comparison test/callback_suite/env.c @ 489:63f623bff0b9

- test/callback_suite: reverted designated aggr initialization back to what it was, b/c of MSVCs before 2013 not handling a lot of C99
author Tassilo Philipp
date Fri, 18 Mar 2022 12:36:49 +0100
parents d8f0e6cecdab
children
comparison
equal deleted inserted replaced
488:1455b6beedd9 489:63f623bff0b9
28 #include "dyncall_signature.h" 28 #include "dyncall_signature.h"
29 #include "env.h" 29 #include "env.h"
30 30
31 DCValueSet ValueMatrix[CONFIG_MAXARGS]; 31 DCValueSet ValueMatrix[CONFIG_MAXARGS];
32 32
33 static DCValueSet K = { 33 static DCValueSet K;
34 .B = DC_TRUE,
35 .c = 13,
36 .C = 19,
37 .s = -23,
38 .S = 41,
39 .i = 134,
40 .I = 257,
41 .j = -12357,
42 .J = 356,
43 .l = -1234556687721LL,
44 .L = 23564634576581ULL,
45 .f = 1.20432545f,
46 .d = 1.0123456,
47 .p = (void*)0x1020345
48 };
49 34
50 void GetReferenceArg(DCValue* output, char ch, int pos) 35 void GetReferenceArg(DCValue* output, char ch, int pos)
51 { 36 {
52 output->L = 0xCAFEBABEDEADC0DELL; 37 output->L = 0xCAFEBABEDEADC0DELL;
53 pos = pos + 2; 38 pos = pos + 2;
76 } 61 }
77 62
78 void InitEnv() 63 void InitEnv()
79 { 64 {
80 int pos; 65 int pos;
66
67 K.B = DC_TRUE;
68 K.c = 13;
69 K.C = 19;
70 K.s = -23;
71 K.S = 41;
72 K.i = 134;
73 K.I = 257;
74 K.j = -12357;
75 K.J = 356;
76 K.l = -1234556687721LL;
77 K.L = 23564634576581ULL;
78 K.f = 1.20432545f;
79 K.d = 1.0123456;
80 K.p = (void*)0x1020345;
81
81 for(pos = 0 ;pos < CONFIG_MAXARGS ;++pos) { 82 for(pos = 0 ;pos < CONFIG_MAXARGS ;++pos) {
82 DCValue ref; 83 DCValue ref;
83 GetReferenceArg( &ref, DC_SIGCHAR_BOOL , pos); ValueMatrix[pos].B = ref.B; 84 GetReferenceArg( &ref, DC_SIGCHAR_BOOL , pos); ValueMatrix[pos].B = ref.B;
84 GetReferenceArg( &ref, DC_SIGCHAR_CHAR , pos); ValueMatrix[pos].c = ref.c; 85 GetReferenceArg( &ref, DC_SIGCHAR_CHAR , pos); ValueMatrix[pos].c = ref.c;
85 GetReferenceArg( &ref, DC_SIGCHAR_UCHAR , pos); ValueMatrix[pos].C = ref.C; 86 GetReferenceArg( &ref, DC_SIGCHAR_UCHAR , pos); ValueMatrix[pos].C = ref.C;