comparison test/suite_x86win32fast/case.cc @ 604:90dfdac91b9b

- cleanups, made some arrays local to TUs, etc.
author Tassilo Philipp
date Wed, 21 Sep 2022 14:36:44 +0200
parents f5577f6bf97a
children 85b7a117b807
comparison
equal deleted inserted replaced
603:c1208587091c 604:90dfdac91b9b
27 27
28 #include "../../dyncall/dyncall.h" 28 #include "../../dyncall/dyncall.h"
29 #include "config.h" 29 #include "config.h"
30 #include "../../dyncall/dyncall_value.h" 30 #include "../../dyncall/dyncall_value.h"
31 31
32 DCValue mValue[NARGS]; 32 static DCValue mValue[NARGS];
33 33
34 void clearValues() { for(int i = 0;i<NARGS;++i) mValue[i].L = 0xCAFEBABEDEADC0DEULL; } 34 void clearValues() { for(int i = 0;i<NARGS;++i) mValue[i].L = 0xCAFEBABEDEADC0DEULL; }
35 35
36 template<typename T> void g(T value, int pos); 36 template<typename T> void g(T value, int pos);
37 37
38 template<> void g(DCchar value, int pos) { mValue[pos].c = value; } 38 template<> void g(DCchar value, int pos) { mValue[pos].c = value; }
39 template<> void g(DCshort value, int pos) { mValue[pos].s = value; } 39 template<> void g(DCshort value, int pos) { mValue[pos].s = value; }
40 template<> void g(DCint value, int pos) { mValue[pos].i = value; } 40 template<> void g(DCint value, int pos) { mValue[pos].i = value; }
41 template<> void g(DClong value, int pos) { mValue[pos].l = value; } 41 template<> void g(DClong value, int pos) { mValue[pos].l = value; }
42 template<> void g(DClonglong value, int pos) { mValue[pos].L = value; } 42 template<> void g(DClonglong value, int pos) { mValue[pos].L = value; }
43 template<> void g(DCfloat value, int pos) { mValue[pos].f = value; } 43 template<> void g(DCfloat value, int pos) { mValue[pos].f = value; }
44 template<> void g(DCdouble value, int pos) { mValue[pos].d = value; } 44 template<> void g(DCdouble value, int pos) { mValue[pos].d = value; }
45 template<> void g(DCpointer value, int pos) { mValue[pos].p = value; } 45 template<> void g(DCpointer value, int pos) { mValue[pos].p = value; }
46 46
47 DCValue* getArg(int pos) { return &mValue[pos]; } 47 DCValue* getArg(int pos) { return &mValue[pos]; }
48 48
49 int gID; 49 int gID;
50 int getId() { return gID; } 50 int getId() { return gID; }
96 #define VF8(id,A1,A2,A3,A4,A5,A6,A7,A8,S) reinterpret_cast<void(*)()>(S), 96 #define VF8(id,A1,A2,A3,A4,A5,A6,A7,A8,S) reinterpret_cast<void(*)()>(S),
97 #define VF9(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,S) reinterpret_cast<void(*)()>(S), 97 #define VF9(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,S) reinterpret_cast<void(*)()>(S),
98 #define VF10(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,S) reinterpret_cast<void(*)()>(S), 98 #define VF10(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,S) reinterpret_cast<void(*)()>(S),
99 99
100 typedef void (*fp)(); 100 typedef void (*fp)();
101 fp gFuncTable[] = { 101 static fp gFuncTable[] = {
102 #include "case.h" 102 #include "case.h"
103 }; 103 };
104 104
105 DCpointer getFunc(int x) { 105 DCpointer getFunc(int x) {
106 return (DCpointer) gFuncTable[x]; 106 return (DCpointer) gFuncTable[x];
107 } 107 }
108