From 93d29555e58df172bafba530afbc593c16ec66a3 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 21 Jul 2014 15:19:48 +0200 Subject: Style: Normalized to no spaces before closing parenthesis. --- src/Bindings/DeprecatedBindings.h | 2 +- src/Bindings/LuaFunctions.h | 2 +- src/Bindings/ManualBindings.cpp | 60 +++++++++++++++++++-------------------- src/Bindings/ManualBindings.h | 2 +- src/Bindings/Plugin.h | 4 +-- src/Bindings/PluginLua.cpp | 2 +- src/Bindings/PluginLua.h | 2 +- src/Bindings/PluginManager.cpp | 6 ++-- src/Bindings/PluginManager.h | 2 +- src/Bindings/WebPlugin.cpp | 14 ++++----- src/Bindings/WebPlugin.h | 6 ++-- 11 files changed, 51 insertions(+), 51 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/DeprecatedBindings.h b/src/Bindings/DeprecatedBindings.h index 5fc3cfa80..037d50489 100644 --- a/src/Bindings/DeprecatedBindings.h +++ b/src/Bindings/DeprecatedBindings.h @@ -4,5 +4,5 @@ struct lua_State; class DeprecatedBindings { public: - static void Bind( lua_State* tolua_S ); + static void Bind( lua_State* tolua_S); }; diff --git a/src/Bindings/LuaFunctions.h b/src/Bindings/LuaFunctions.h index 629e2d77d..2ea37d7a4 100644 --- a/src/Bindings/LuaFunctions.h +++ b/src/Bindings/LuaFunctions.h @@ -9,7 +9,7 @@ inline unsigned int GetTime() return (unsigned int)time(0); } -inline std::string GetChar( std::string & a_Str, unsigned int a_Idx ) +inline std::string GetChar( std::string & a_Str, unsigned int a_Idx) { return std::string(1, a_Str[ a_Idx ]); } diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 5e9e7349d..df9687fc0 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -319,9 +319,9 @@ static int tolua_DoWith(lua_State* tolua_S) { public: cLuaCallback(lua_State* a_LuaState, int a_FuncRef, int a_TableRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) - , TableRef( a_TableRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) + , TableRef( a_TableRef) {} private: @@ -358,7 +358,7 @@ static int tolua_DoWith(lua_State* tolua_S) luaL_unref(tolua_S, LUA_REGISTRYINDEX, FuncRef); /* Push return value on stack */ - tolua_pushboolean(tolua_S, bRetVal ); + tolua_pushboolean(tolua_S, bRetVal); return 1; } @@ -448,7 +448,7 @@ static int tolua_DoWithID(lua_State* tolua_S) luaL_unref(tolua_S, LUA_REGISTRYINDEX, FuncRef); /* Push return value on stack */ - tolua_pushboolean(tolua_S, bRetVal ); + tolua_pushboolean(tolua_S, bRetVal); return 1; } @@ -478,7 +478,7 @@ static int tolua_DoWithXYZ(lua_State* tolua_S) int ItemX = ((int)tolua_tonumber(tolua_S, 2, 0)); int ItemY = ((int)tolua_tonumber(tolua_S, 3, 0)); int ItemZ = ((int)tolua_tonumber(tolua_S, 4, 0)); - LOG("x %i y %i z %i", ItemX, ItemY, ItemZ ); + LOG("x %i y %i z %i", ItemX, ItemY, ItemZ); if (!lua_isfunction( tolua_S, 5)) { return lua_do_error(tolua_S, "Error in function call '#funcname#': Expected a function for parameter #4"); @@ -506,9 +506,9 @@ static int tolua_DoWithXYZ(lua_State* tolua_S) { public: cLuaCallback(lua_State* a_LuaState, int a_FuncRef, int a_TableRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) - , TableRef( a_TableRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) + , TableRef( a_TableRef) {} private: @@ -544,7 +544,7 @@ static int tolua_DoWithXYZ(lua_State* tolua_S) luaL_unref(tolua_S, LUA_REGISTRYINDEX, FuncRef); /* Push return value on stack */ - tolua_pushboolean(tolua_S, bRetVal ); + tolua_pushboolean(tolua_S, bRetVal); return 1; } @@ -601,9 +601,9 @@ static int tolua_ForEachInChunk(lua_State * tolua_S) { public: cLuaCallback(lua_State* a_LuaState, int a_FuncRef, int a_TableRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) - , TableRef( a_TableRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) + , TableRef( a_TableRef) {} private: @@ -640,7 +640,7 @@ static int tolua_ForEachInChunk(lua_State * tolua_S) luaL_unref(tolua_S, LUA_REGISTRYINDEX, FuncRef); /* Push return value on stack */ - tolua_pushboolean(tolua_S, bRetVal ); + tolua_pushboolean(tolua_S, bRetVal); return 1; } @@ -694,16 +694,16 @@ static int tolua_ForEach(lua_State * tolua_S) { public: cLuaCallback(lua_State* a_LuaState, int a_FuncRef, int a_TableRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) - , TableRef( a_TableRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) + , TableRef( a_TableRef) {} private: virtual bool Item(Ty2 * a_Item) override { lua_rawgeti( LuaState, LUA_REGISTRYINDEX, FuncRef); /* Push function reference */ - tolua_pushusertype( LuaState, a_Item, Ty2::GetClassStatic() ); + tolua_pushusertype( LuaState, a_Item, Ty2::GetClassStatic()); if (TableRef != LUA_REFNIL) { lua_rawgeti( LuaState, LUA_REGISTRYINDEX, TableRef); /* Push table reference */ @@ -733,7 +733,7 @@ static int tolua_ForEach(lua_State * tolua_S) luaL_unref(tolua_S, LUA_REGISTRYINDEX, FuncRef); /* Push return value on stack */ - tolua_pushboolean(tolua_S, bRetVal ); + tolua_pushboolean(tolua_S, bRetVal); return 1; } @@ -1390,8 +1390,8 @@ static int tolua_cPluginManager_ForEachCommand(lua_State * tolua_S) { public: cLuaCallback(lua_State * a_LuaState, int a_FuncRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) {} private: @@ -1467,8 +1467,8 @@ static int tolua_cPluginManager_ForEachConsoleCommand(lua_State * tolua_S) { public: cLuaCallback(lua_State * a_LuaState, int a_FuncRef) - : LuaState( a_LuaState ) - , FuncRef( a_FuncRef ) + : LuaState( a_LuaState) + , FuncRef( a_FuncRef) {} private: @@ -1963,7 +1963,7 @@ static int tolua_cPluginLua_AddTab(lua_State* tolua_S) LOGWARN("WARNING: Using deprecated function AddTab()! Use AddWebTab() instead. (plugin \"%s\" in folder \"%s\")", self->GetName().c_str(), self->GetDirectory().c_str() ); - return tolua_cPluginLua_AddWebTab( tolua_S ); + return tolua_cPluginLua_AddWebTab( tolua_S); } @@ -2011,7 +2011,7 @@ static int tolua_md5(lua_State* tolua_S) -static int tolua_push_StringStringMap(lua_State* tolua_S, std::map< std::string, std::string >& a_StringStringMap ) +static int tolua_push_StringStringMap(lua_State* tolua_S, std::map< std::string, std::string >& a_StringStringMap) { lua_newtable(tolua_S); int top = lua_gettop(tolua_S); @@ -2062,9 +2062,9 @@ static int tolua_get_HTTPRequest_FormData(lua_State* tolua_S) for (std::map::iterator it = FormData.begin(); it != FormData.end(); ++it) { - lua_pushstring(tolua_S, it->first.c_str() ); - tolua_pushusertype(tolua_S, &(it->second), "HTTPFormData" ); - // lua_pushlstring(tolua_S, it->second.Value.c_str(), it->second.Value.size() ); // Might contain binary data + lua_pushstring(tolua_S, it->first.c_str()); + tolua_pushusertype(tolua_S, &(it->second), "HTTPFormData"); + // lua_pushlstring(tolua_S, it->second.Value.c_str(), it->second.Value.size()); // Might contain binary data lua_settable(tolua_S, top); } @@ -2113,8 +2113,8 @@ static int tolua_cWebPlugin_GetTabNames(lua_State * tolua_S) { const AString & FancyName = iter->first; const AString & WebName = iter->second; - tolua_pushstring( tolua_S, WebName.c_str() ); // Because the WebName is supposed to be unique, use it as key - tolua_pushstring( tolua_S, FancyName.c_str() ); + tolua_pushstring( tolua_S, WebName.c_str()); // Because the WebName is supposed to be unique, use it as key + tolua_pushstring( tolua_S, FancyName.c_str()); // lua_rawset(tolua_S, -3); ++iter; diff --git a/src/Bindings/ManualBindings.h b/src/Bindings/ManualBindings.h index f38e26267..36161c6a2 100644 --- a/src/Bindings/ManualBindings.h +++ b/src/Bindings/ManualBindings.h @@ -4,5 +4,5 @@ struct lua_State; class ManualBindings { public: - static void Bind( lua_State* tolua_S ); + static void Bind( lua_State* tolua_S); }; diff --git a/src/Bindings/Plugin.h b/src/Bindings/Plugin.h index fc8aa1cdb..3882b7474 100644 --- a/src/Bindings/Plugin.h +++ b/src/Bindings/Plugin.h @@ -33,7 +33,7 @@ class cPlugin public: // tolua_end - cPlugin( const AString & a_PluginDirectory ); + cPlugin( const AString & a_PluginDirectory); virtual ~cPlugin(); virtual void OnDisable(void) {} @@ -141,7 +141,7 @@ public: E_SQUIRREL, // OBSOLETE, but kept in place to remind us of the horrors lurking in the history }; PluginLanguage GetLanguage() { return m_Language; } - void SetLanguage( PluginLanguage a_Language ) { m_Language = a_Language; } + void SetLanguage( PluginLanguage a_Language) { m_Language = a_Language; } private: PluginLanguage m_Language; diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp index 5fa8adc66..0f3f25d75 100644 --- a/src/Bindings/PluginLua.cpp +++ b/src/Bindings/PluginLua.cpp @@ -1655,7 +1655,7 @@ int cPluginLua::CallFunctionFromForeignState( -AString cPluginLua::HandleWebRequest(const HTTPRequest * a_Request ) +AString cPluginLua::HandleWebRequest(const HTTPRequest * a_Request) { cCSLock Lock(m_CriticalSection); std::string RetVal = ""; diff --git a/src/Bindings/PluginLua.h b/src/Bindings/PluginLua.h index b2979a210..2cea644c1 100644 --- a/src/Bindings/PluginLua.h +++ b/src/Bindings/PluginLua.h @@ -144,7 +144,7 @@ public: virtual const AString GetWebTitle(void) const {return GetName(); } // cWebPlugin and WebAdmin stuff - virtual AString HandleWebRequest(const HTTPRequest * a_Request ) override; + virtual AString HandleWebRequest(const HTTPRequest * a_Request) override; bool AddWebTab(const AString & a_Title, lua_State * a_LuaState, int a_FunctionReference); // >> EXPORTED IN MANUALBINDINGS << /** Binds the command to call the function specified by a Lua function reference. Simply adds to CommandMap. */ diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp index 33ecb95ad..088b92a6d 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -72,7 +72,7 @@ void cPluginManager::FindPlugins(void) { PluginMap::iterator thiz = itr; ++thiz; - m_Plugins.erase( itr ); + m_Plugins.erase( itr); itr = thiz; continue; } @@ -1432,11 +1432,11 @@ cPluginManager::CommandResult cPluginManager::HandleCommand(cPlayer * a_Player, -cPlugin * cPluginManager::GetPlugin( const AString & a_Plugin ) const +cPlugin * cPluginManager::GetPlugin( const AString & a_Plugin) const { for (PluginMap::const_iterator itr = m_Plugins.begin(); itr != m_Plugins.end(); ++itr) { - if (itr->second == NULL ) continue; + if (itr->second == NULL) continue; if (itr->second->GetName().compare(a_Plugin) == 0) { return itr->second; diff --git a/src/Bindings/PluginManager.h b/src/Bindings/PluginManager.h index cffd8d04b..44a94e316 100644 --- a/src/Bindings/PluginManager.h +++ b/src/Bindings/PluginManager.h @@ -163,7 +163,7 @@ public: typedef std::map< AString, cPlugin * > PluginMap; typedef std::list< cPlugin * > PluginList; - cPlugin * GetPlugin( const AString & a_Plugin ) const; // tolua_export + cPlugin * GetPlugin( const AString & a_Plugin) const; // tolua_export const PluginMap & GetAllPlugins() const; // >> EXPORTED IN MANUALBINDINGS << // tolua_begin diff --git a/src/Bindings/WebPlugin.cpp b/src/Bindings/WebPlugin.cpp index a22826d1b..1178c127a 100644 --- a/src/Bindings/WebPlugin.cpp +++ b/src/Bindings/WebPlugin.cpp @@ -45,12 +45,12 @@ cWebPlugin::~cWebPlugin() std::list > cWebPlugin::GetTabNames(void) { std::list< std::pair< AString, AString > > NameList; - for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) + for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr) { std::pair< AString, AString > StringPair; StringPair.first = (*itr)->Title; StringPair.second = (*itr)->SafeTitle; - NameList.push_back( StringPair ); + NameList.push_back( StringPair); } return NameList; } @@ -69,7 +69,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest sWebPluginTab * Tab = NULL; if (Split.size() > 2) // If we got the tab name, show that page { - for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr ) + for (TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr) { if ((*itr)->SafeTitle.compare(Split[2]) == 0) // This is the one! { @@ -80,7 +80,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest } else // Otherwise show the first tab { - if (GetTabs().size() > 0 ) + if (GetTabs().size() > 0) Tab = *GetTabs().begin(); } @@ -100,14 +100,14 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest AString cWebPlugin::SafeString(const AString & a_String) { AString RetVal; - for (unsigned int i = 0; i < a_String.size(); ++i ) + for (unsigned int i = 0; i < a_String.size(); ++i) { char c = a_String[i]; - if (c == ' ' ) + if (c == ' ') { c = '_'; } - RetVal.push_back( c ); + RetVal.push_back( c); } return RetVal; } diff --git a/src/Bindings/WebPlugin.h b/src/Bindings/WebPlugin.h index 3587ac637..46bc0cd2d 100644 --- a/src/Bindings/WebPlugin.h +++ b/src/Bindings/WebPlugin.h @@ -19,9 +19,9 @@ public: // tolua_begin virtual const AString GetWebTitle(void) const = 0; - virtual AString HandleWebRequest(const HTTPRequest * a_Request ) = 0; + virtual AString HandleWebRequest(const HTTPRequest * a_Request) = 0; - static AString SafeString( const AString & a_String ); + static AString SafeString( const AString & a_String); // tolua_end struct sWebPluginTab @@ -37,7 +37,7 @@ public: typedef std::list< std::pair > TabNameList; TabNameList GetTabNames(); // >> EXPORTED IN MANUALBINDINGS << - std::pair< AString, AString > GetTabNameForRequest(const HTTPRequest* a_Request ); + std::pair< AString, AString > GetTabNameForRequest(const HTTPRequest* a_Request); private: TabList m_Tabs; -- cgit v1.2.3