From ad148587dcf5244c2d2011dba339786c765c54c4 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 4 Nov 2020 16:19:54 +0100 Subject: Make Lint Happy --- src/script/lua_api/l_base.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/script/lua_api/l_base.cpp') 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(reg->name, original_reg)); + m_deprecated_wrappers.emplace(std::pair( + reg->name, original_reg)); reg->func = l_deprecated_function; } -- cgit v1.2.3