aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_base.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:57:41 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:57:41 +0100
commit6ccb5835ff55d85156be91473c598eca9d6cb9a6 (patch)
tree7f1eaf8b94694c8e24e206909ba8f55a1ebfbb3e /src/script/lua_api/l_base.cpp
parent244713971a976e43e8740b6a9d9d122e37020ef2 (diff)
downloaddragonfireclient-6ccb5835ff55d85156be91473c598eca9d6cb9a6.tar.xz
Revert "Make Lint Happy"
This reverts commit ad148587dcf5244c2d2011dba339786c765c54c4.
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 8ae03d6c8..011434845 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,8 +93,9 @@ 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!
@@ -125,7 +126,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);
@@ -135,13 +136,12 @@ 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;
}