forked from redo/BlockLua
Fix all warnings and errors in C++
This commit is contained in:
@@ -5,16 +5,16 @@
|
||||
#ifndef _H_BLFUNCS
|
||||
#define _H_BLFUNCS
|
||||
|
||||
// Require BlHooks to be included before this header
|
||||
// Ensure BlHooks is available (include it if not already included)
|
||||
#ifndef _H_BLHOOKS
|
||||
#error "BlFuncs.hpp: You must include BlHooks.hpp first"
|
||||
#else
|
||||
#include "BlHooks.hpp"
|
||||
#endif
|
||||
|
||||
typedef const char * (*tsf_StringCallback)(ADDR, signed int, const char *[]);
|
||||
typedef signed int (*tsf_IntCallback )(ADDR, signed int, const char *[]);
|
||||
typedef float (*tsf_FloatCallback )(ADDR, signed int, const char *[]);
|
||||
typedef void (*tsf_VoidCallback )(ADDR, signed int, const char *[]);
|
||||
typedef bool (*tsf_BoolCallback )(ADDR, signed int, const char *[]);
|
||||
typedef const char *(*tsf_StringCallback)(ADDR, signed int, const char *[]);
|
||||
typedef signed int (*tsf_IntCallback)(ADDR, signed int, const char *[]);
|
||||
typedef float (*tsf_FloatCallback)(ADDR, signed int, const char *[]);
|
||||
typedef void (*tsf_VoidCallback)(ADDR, signed int, const char *[]);
|
||||
typedef bool (*tsf_BoolCallback)(ADDR, signed int, const char *[]);
|
||||
|
||||
/* These functions are used for tsf_BlCon__executefSimObj.
|
||||
They refer to a special buffer for the argument stack.
|
||||
@@ -42,12 +42,21 @@ void tsf_AddVar(const char *, signed int *);
|
||||
void tsf_AddVar(const char *, float *);
|
||||
void tsf_AddVar(const char *, bool *);
|
||||
|
||||
ADDR tsf_AddConsoleFuncInternal(const char *, const char *, const char *, signed int, const char *, signed int, signed int);
|
||||
void tsf_AddConsoleFunc(const char *, const char *, const char *, tsf_StringCallback, const char *, signed int, signed int);
|
||||
void tsf_AddConsoleFunc(const char *, const char *, const char *, tsf_IntCallback, const char *, signed int, signed int);
|
||||
void tsf_AddConsoleFunc(const char *, const char *, const char *, tsf_FloatCallback, const char *, signed int, signed int);
|
||||
void tsf_AddConsoleFunc(const char *, const char *, const char *, tsf_VoidCallback, const char *, signed int, signed int);
|
||||
void tsf_AddConsoleFunc(const char *, const char *, const char *, tsf_BoolCallback, const char *, signed int, signed int);
|
||||
ADDR tsf_AddConsoleFuncInternal(const char *, const char *, const char *,
|
||||
signed int, const char *, signed int,
|
||||
signed int);
|
||||
void tsf_AddConsoleFunc(const char *, const char *, const char *,
|
||||
tsf_StringCallback, const char *, signed int,
|
||||
signed int);
|
||||
void tsf_AddConsoleFunc(const char *, const char *, const char *,
|
||||
tsf_IntCallback, const char *, signed int, signed int);
|
||||
void tsf_AddConsoleFunc(const char *, const char *, const char *,
|
||||
tsf_FloatCallback, const char *, signed int,
|
||||
signed int);
|
||||
void tsf_AddConsoleFunc(const char *, const char *, const char *,
|
||||
tsf_VoidCallback, const char *, signed int, signed int);
|
||||
void tsf_AddConsoleFunc(const char *, const char *, const char *,
|
||||
tsf_BoolCallback, const char *, signed int, signed int);
|
||||
|
||||
bool tsf_InitInternal();
|
||||
|
||||
@@ -56,21 +65,32 @@ extern ADDR tsf_mCacheAllocator;
|
||||
extern ADDR tsf_gIdDictionary;
|
||||
extern ADDR tsf_gEvalState_globalVars;
|
||||
|
||||
BlFunctionDefExtern(const char *, __stdcall, tsf_BlStringTable__insert, const char *, bool);
|
||||
BlFunctionDefExtern(ADDR, __fastcall, tsf_BlNamespace__find, const char *, const char *);
|
||||
BlFunctionDefExtern(ADDR, __thiscall, tsf_BlNamespace__createLocalEntry, ADDR, const char *);
|
||||
BlFunctionDefExtern(const char *, __stdcall, tsf_BlStringTable__insert,
|
||||
const char *, bool);
|
||||
BlFunctionDefExtern(ADDR, __fastcall, tsf_BlNamespace__find, const char *,
|
||||
const char *);
|
||||
BlFunctionDefExtern(ADDR, __thiscall, tsf_BlNamespace__createLocalEntry, ADDR,
|
||||
const char *);
|
||||
BlFunctionDefExtern(void, __thiscall, tsf_BlDataChunker__freeBlocks, ADDR);
|
||||
BlFunctionDefExtern(const char *, , tsf_BlCon__evaluate, ADDR, signed int, const char **);
|
||||
BlFunctionDefExtern(const char *, , tsf_BlCon__evaluate, ADDR, signed int,
|
||||
const char **);
|
||||
BlFunctionDefExtern(const char *, , tsf_BlCon__executef, signed int, ...);
|
||||
BlFunctionDefExtern(const char *, , tsf_BlCon__executefSimObj, ADDR *, signed int, ...);
|
||||
BlFunctionDefExtern(const char *, __thiscall, tsf_BlCon__getVariable, const char *);
|
||||
BlFunctionDefExtern(void, __thiscall, tsf_BlDictionary__addVariable, ADDR *, const char *, signed int, void *);
|
||||
BlFunctionDefExtern(ADDR *, __thiscall, tsf_BlSim__findObject_name, const char *);
|
||||
BlFunctionDefExtern(char *, __stdcall, tsf_BlStringStack__getArgBuffer, unsigned int);
|
||||
BlFunctionDefExtern(const char *, __thiscall, tsf_BlSimObject__getDataField, ADDR, const char *, const char *);
|
||||
BlFunctionDefExtern(void, __thiscall, tsf_BlSimObject__setDataField, ADDR, const char *, const char *, const char *);
|
||||
BlFunctionDefExtern(char *, __fastcall, tsf_BlCon__getReturnBuffer, unsigned int);
|
||||
|
||||
BlFunctionDefExtern(const char *, , tsf_BlCon__executefSimObj, ADDR *,
|
||||
signed int, ...);
|
||||
BlFunctionDefExtern(const char *, __thiscall, tsf_BlCon__getVariable,
|
||||
const char *);
|
||||
BlFunctionDefExtern(void, __thiscall, tsf_BlDictionary__addVariable, ADDR *,
|
||||
const char *, signed int, void *);
|
||||
BlFunctionDefExtern(ADDR *, __thiscall, tsf_BlSim__findObject_name,
|
||||
const char *);
|
||||
BlFunctionDefExtern(char *, __stdcall, tsf_BlStringStack__getArgBuffer,
|
||||
unsigned int);
|
||||
BlFunctionDefExtern(const char *, __thiscall, tsf_BlSimObject__getDataField,
|
||||
ADDR, const char *, const char *);
|
||||
BlFunctionDefExtern(void, __thiscall, tsf_BlSimObject__setDataField, ADDR,
|
||||
const char *, const char *, const char *);
|
||||
BlFunctionDefExtern(char *, __fastcall, tsf_BlCon__getReturnBuffer,
|
||||
unsigned int);
|
||||
|
||||
// Function short names
|
||||
|
||||
@@ -80,7 +100,7 @@ BlFunctionDefExtern(char *, __fastcall, tsf_BlCon__getReturnBuffer, unsigned int
|
||||
#define BlIntArg tsf_GetIntArg
|
||||
#define BlFloatArg tsf_GetFloatArg
|
||||
#define BlThisArg tsf_GetThisArg
|
||||
#define BlStringArg(x) tsf_GetStringArg((char*)x)
|
||||
#define BlStringArg(x) tsf_GetStringArg((char *)x)
|
||||
#define BlReturnBuffer tsf_BlCon__getReturnBuffer
|
||||
|
||||
#define BlObject tsf_FindObject
|
||||
@@ -94,16 +114,23 @@ BlFunctionDefExtern(char *, __fastcall, tsf_BlCon__getReturnBuffer, unsigned int
|
||||
|
||||
#define BlAddFunction tsf_AddConsoleFunc
|
||||
|
||||
#define __22ND_ARGUMENT(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, ...) a22
|
||||
#define __NUM_LIST(...) __22ND_ARGUMENT(dummy, ##__VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
|
||||
#define BlCall(...) \
|
||||
tsf_BlCon__executef(__NUM_LIST(__VA_ARGS__), __VA_ARGS__)
|
||||
#define BlCallObj(obj, ...) \
|
||||
tsf_BlCon__executefSimObj((ADDR*)obj, __NUM_LIST(__VA_ARGS__), __VA_ARGS__)
|
||||
|
||||
#define BlFuncsInit() if(!tsf_InitInternal()) { return false; }
|
||||
#define BlFuncsDeinit() if(!tsf_DeinitInternal()) { return false; }
|
||||
#define __22ND_ARGUMENT(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, \
|
||||
a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, ...) \
|
||||
a22
|
||||
#define __NUM_LIST(...) \
|
||||
__22ND_ARGUMENT(dummy, ##__VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, \
|
||||
11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
|
||||
#define BlCall(...) tsf_BlCon__executef(__NUM_LIST(__VA_ARGS__), __VA_ARGS__)
|
||||
#define BlCallObj(obj, ...) \
|
||||
tsf_BlCon__executefSimObj((ADDR *)obj, __NUM_LIST(__VA_ARGS__), __VA_ARGS__)
|
||||
|
||||
#define BlFuncsInit() \
|
||||
if (!tsf_InitInternal()) { \
|
||||
return false; \
|
||||
}
|
||||
#define BlFuncsDeinit() \
|
||||
if (!tsf_DeinitInternal()) { \
|
||||
return false; \
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user