From 0051f00ce760d2afa32691efa5023da38eed0323 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Tue, 14 Feb 2023 12:33:45 +0100 Subject: [PATCH] Move logHelper and its namespace to the top of LuaAPI.cpp --- src/controllers/plugins/LuaAPI.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/controllers/plugins/LuaAPI.cpp b/src/controllers/plugins/LuaAPI.cpp index 5cae62473..c0a7d887d 100644 --- a/src/controllers/plugins/LuaAPI.cpp +++ b/src/controllers/plugins/LuaAPI.cpp @@ -16,6 +16,22 @@ # include # include +namespace { +using namespace chatterino; + +void logHelper(lua_State *L, Plugin *pl, QDebug stream, int argc) +{ + stream.noquote(); + stream << "[" + pl->id + ":" + pl->meta.name + "]"; + for (int i = 1; i <= argc; i++) + { + stream << lua::toString(L, i); + } + lua_pop(L, argc); +} + +} // namespace + // NOLINTBEGIN(*vararg) // luaL_error is a c-style vararg function, this makes clang-tidy not dislike it so much namespace chatterino::lua::api { @@ -101,20 +117,6 @@ int c2_system_msg(lua_State *L) return 1; } -namespace { - void logHelper(lua_State *L, Plugin *pl, QDebug stream, int argc) - { - stream.noquote(); - stream << "[" + pl->id + ":" + pl->meta.name + "]"; - for (int i = 1; i <= argc; i++) - { - stream << lua::toString(L, i); - } - lua_pop(L, argc); - } - -} // namespace - int c2_log(lua_State *L) { auto *pl = getApp()->plugins->getPluginByStatePtr(L);