aboutsummaryrefslogtreecommitdiff
path: root/src/script/common/c_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/common/c_internal.h')
-rw-r--r--src/script/common/c_internal.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/script/common/c_internal.h b/src/script/common/c_internal.h
index 442546332..677194453 100644
--- a/src/script/common/c_internal.h
+++ b/src/script/common/c_internal.h
@@ -34,7 +34,6 @@ extern "C" {
#include "config.h"
#include "common/c_types.h"
-
/*
Define our custom indices into the Lua registry table.
@@ -45,15 +44,15 @@ extern "C" {
so we can use numeric indices freely.
*/
#ifdef LUA_RIDX_LAST
-#define CUSTOM_RIDX_BASE ((LUA_RIDX_LAST)+1)
+#define CUSTOM_RIDX_BASE ((LUA_RIDX_LAST) + 1)
#else
#define CUSTOM_RIDX_BASE 1
#endif
-#define CUSTOM_RIDX_SCRIPTAPI (CUSTOM_RIDX_BASE)
-#define CUSTOM_RIDX_GLOBALS_BACKUP (CUSTOM_RIDX_BASE + 1)
-#define CUSTOM_RIDX_CURRENT_MOD_NAME (CUSTOM_RIDX_BASE + 2)
-#define CUSTOM_RIDX_BACKTRACE (CUSTOM_RIDX_BASE + 3)
+#define CUSTOM_RIDX_SCRIPTAPI (CUSTOM_RIDX_BASE)
+#define CUSTOM_RIDX_GLOBALS_BACKUP (CUSTOM_RIDX_BASE + 1)
+#define CUSTOM_RIDX_CURRENT_MOD_NAME (CUSTOM_RIDX_BASE + 2)
+#define CUSTOM_RIDX_BACKTRACE (CUSTOM_RIDX_BASE + 3)
// Determine if CUSTOM_RIDX_SCRIPTAPI will hold a light or full userdata
#if defined(__aarch64__) && USE_LUAJIT
@@ -65,17 +64,18 @@ extern "C" {
#endif
// Pushes the error handler onto the stack and returns its index
-#define PUSH_ERROR_HANDLER(L) \
+#define PUSH_ERROR_HANDLER(L) \
(lua_rawgeti((L), LUA_REGISTRYINDEX, CUSTOM_RIDX_BACKTRACE), lua_gettop((L)))
-#define PCALL_RESL(L, RES) { \
- int result_ = (RES); \
- if (result_ != 0) { \
- script_error((L), result_, NULL, __FUNCTION__); \
- } \
-}
+#define PCALL_RESL(L, RES) \
+ { \
+ int result_ = (RES); \
+ if (result_ != 0) { \
+ script_error((L), result_, NULL, __FUNCTION__); \
+ } \
+ }
-#define script_run_callbacks(L, nargs, mode) \
+#define script_run_callbacks(L, nargs, mode) \
script_run_callbacks_f((L), (nargs), (mode), __FUNCTION__)
// What script_run_callbacks does with the return values of callbacks.
@@ -111,8 +111,7 @@ enum RunCallbacksMode
std::string script_get_backtrace(lua_State *L);
int script_exception_wrapper(lua_State *L, lua_CFunction f);
void script_error(lua_State *L, int pcall_result, const char *mod, const char *fxn);
-void script_run_callbacks_f(lua_State *L, int nargs,
- RunCallbacksMode mode, const char *fxn);
+void script_run_callbacks_f(
+ lua_State *L, int nargs, RunCallbacksMode mode, const char *fxn);
-void log_deprecated(lua_State *L, const std::string &message,
- int stack_depth=1);
+void log_deprecated(lua_State *L, const std::string &message, int stack_depth = 1);