Mercurial > pub > dyncall > dyncall
comparison test/suite_x86win32std/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(DClonglong value, int pos) { mValue[pos].L = value; } | 41 template<> void g(DClonglong value, int pos) { mValue[pos].L = value; } |
42 template<> void g(DCfloat value, int pos) { mValue[pos].f = value; } | 42 template<> void g(DCfloat value, int pos) { mValue[pos].f = value; } |
43 template<> void g(DCdouble value, int pos) { mValue[pos].d = value; } | 43 template<> void g(DCdouble value, int pos) { mValue[pos].d = value; } |
44 template<> void g(DCpointer value, int pos) { mValue[pos].p = value; } | 44 template<> void g(DCpointer value, int pos) { mValue[pos].p = value; } |
45 | 45 |
46 DCValue* getArg(int pos) { return &mValue[pos]; } | 46 DCValue* getArg(int pos) { return &mValue[pos]; } |
47 | 47 |
48 int gID; | 48 int gID; |
49 int getId() { return gID; } | 49 int getId() { return gID; } |
95 #define VF8(id,A1,A2,A3,A4,A5,A6,A7,A8,S) reinterpret_cast<void(*)()>(S), | 95 #define VF8(id,A1,A2,A3,A4,A5,A6,A7,A8,S) reinterpret_cast<void(*)()>(S), |
96 #define VF9(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,S) reinterpret_cast<void(*)()>(S), | 96 #define VF9(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,S) reinterpret_cast<void(*)()>(S), |
97 #define VF10(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,S) reinterpret_cast<void(*)()>(S), | 97 #define VF10(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,S) reinterpret_cast<void(*)()>(S), |
98 | 98 |
99 typedef void (*fp)(); | 99 typedef void (*fp)(); |
100 fp gFuncTable[] = { | 100 static fp gFuncTable[] = { |
101 #include "case.h" | 101 #include "case.h" |
102 }; | 102 }; |
103 | 103 |
104 DCpointer getFunc(int x) { | 104 DCpointer getFunc(int x) { |
105 return (DCpointer) gFuncTable[x]; | 105 return (DCpointer) gFuncTable[x]; |
106 } | 106 } |
107 |