aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_base.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:19:54 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:19:54 +0100
commitad148587dcf5244c2d2011dba339786c765c54c4 (patch)
treebdd914121cd326da2ed26679838878e3edffc841 /src/script/lua_api/l_base.cpp
parent1145b05ea0bda87dc0827821385810eced08f774 (diff)
downloaddragonfireclient-ad148587dcf5244c2d2011dba339786c765c54c4.tar.xz
Make Lint Happy
Diffstat (limited to 'src/script/lua_api/l_base.cpp')
-rw-r--r--src/script/lua_api/l_base.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/script/lua_api/l_base.cpp b/src/script/lua_api/l_base.cpp
index 011434845..8ae03d6c8 100644
--- a/src/script/lua_api/l_base.cpp
+++ b/src/script/lua_api/l_base.cpp
@@ -32,9 +32,9 @@ ScriptApiBase *ModApiBase::getScriptApiBase(lua_State *L)
lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_SCRIPTAPI);
ScriptApiBase *sapi_ptr;
#if INDIRECT_SCRIPTAPI_RIDX
- sapi_ptr = (ScriptApiBase*) *(void**)(lua_touserdata(L, -1));
+ sapi_ptr = (ScriptApiBase *)*(void **)(lua_touserdata(L, -1));
#else
- sapi_ptr = (ScriptApiBase*) lua_touserdata(L, -1);
+ sapi_ptr = (ScriptApiBase *)lua_touserdata(L, -1);
#endif
lua_pop(L, 1);
return sapi_ptr;
@@ -93,9 +93,8 @@ std::string ModApiBase::getCurrentModPath(lua_State *L)
return mod->path;
}
-
-bool ModApiBase::registerFunction(lua_State *L, const char *name,
- lua_CFunction func, int top)
+bool ModApiBase::registerFunction(
+ lua_State *L, const char *name, lua_CFunction func, int top)
{
// TODO: Check presence first!
@@ -126,7 +125,7 @@ int ModApiBase::l_deprecated_function(lua_State *L)
// Get parent class to get the wrappers map
luaL_checktype(L, 1, LUA_TUSERDATA);
void *ud = lua_touserdata(L, 1);
- ModApiBase *o = *(ModApiBase**)ud;
+ ModApiBase *o = *(ModApiBase **)ud;
// New function and new function name
auto it = o->m_deprecated_wrappers.find(ar.name);
@@ -136,12 +135,13 @@ int ModApiBase::l_deprecated_function(lua_State *L)
backtrace.append(":").append(std::to_string(ar.currentline));
u64 hash = murmur_hash_64_ua(backtrace.data(), backtrace.length(), 0xBADBABE);
- if (std::find(deprecated_logged.begin(), deprecated_logged.end(), hash)
- == deprecated_logged.end()) {
+ if (std::find(deprecated_logged.begin(), deprecated_logged.end(), hash) ==
+ deprecated_logged.end()) {
deprecated_logged.emplace_back(hash);
- warningstream << "Call to deprecated function '" << ar.name << "', please use '"
- << it->second.name << "' at " << backtrace << std::endl;
+ warningstream << "Call to deprecated function '" << ar.name
+ << "', please use '" << it->second.name << "' at "
+ << backtrace << std::endl;
if (m_error_deprecated_calls)
script_error(L, LUA_ERRRUN, NULL, NULL);
@@ -172,8 +172,8 @@ void ModApiBase::markAliasDeprecated(luaL_Reg *reg)
// Do not inline struct. Breaks MSVC or is error-prone
original_reg.name = last_name;
original_reg.func = reg->func;
- m_deprecated_wrappers.emplace(
- std::pair<std::string, luaL_Reg>(reg->name, original_reg));
+ m_deprecated_wrappers.emplace(std::pair<std::string, luaL_Reg>(
+ reg->name, original_reg));
reg->func = l_deprecated_function;
}