]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix some whitespace issues
authorAttila Molnar <attilamolnar@hush.com>
Mon, 28 Dec 2015 15:59:03 +0000 (16:59 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Mon, 28 Dec 2015 15:59:03 +0000 (16:59 +0100)
include/consolecolors.h
include/extensible.h
include/hashcomp.h
include/mode.h
src/configreader.cpp
src/coremods/core_xline/cmd_kline.cpp
src/modules/m_alias.cpp
src/modules/m_cap.cpp
src/modules/m_repeat.cpp

index 9b7e0670afae1c68df0659e83ca870e50ca76272..d92be58bc706f9dafa78f9771ad671a1f2f1eda7 100644 (file)
@@ -29,70 +29,70 @@ extern HANDLE g_hStdout;
 
 inline std::ostream& con_green(std::ostream &s)
 {
-    SetConsoleTextAttribute(g_hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor);
-    return s;
+       SetConsoleTextAttribute(g_hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor);
+       return s;
 }
 
 inline std::ostream& con_red(std::ostream &s)
 {
-    SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY|g_wBackgroundColor);
-    return s;
+       SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY|g_wBackgroundColor);
+       return s;
 }
 
 inline std::ostream& con_white(std::ostream &s)
 {
-    SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|g_wBackgroundColor);
-    return s;
+       SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|g_wBackgroundColor);
+       return s;
 }
 
 inline std::ostream& con_white_bright(std::ostream &s)
 {
-    SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor);
-    return s;
+       SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor);
+       return s;
 }
 
 inline std::ostream& con_bright(std::ostream &s)
 {
-    SetConsoleTextAttribute(g_hStdout, FOREGROUND_INTENSITY|g_wBackgroundColor);
-    return s;
+       SetConsoleTextAttribute(g_hStdout, FOREGROUND_INTENSITY|g_wBackgroundColor);
+       return s;
 }
 
 inline std::ostream& con_reset(std::ostream &s)
 {
-    SetConsoleTextAttribute(g_hStdout, g_wOriginalColors);
-    return s;
+       SetConsoleTextAttribute(g_hStdout, g_wOriginalColors);
+       return s;
 }
 
 #else
 
 inline std::ostream& con_green(std::ostream &s)
 {
-    return s << "\033[1;32m";
+       return s << "\033[1;32m";
 }
 
 inline std::ostream& con_red(std::ostream &s)
 {
-    return s << "\033[1;31m";
+       return s << "\033[1;31m";
 }
 
 inline std::ostream& con_white(std::ostream &s)
 {
-    return s << "\033[0m";
+       return s << "\033[0m";
 }
 
 inline std::ostream& con_white_bright(std::ostream &s)
 {
-    return s << "\033[1m";
+       return s << "\033[1m";
 }
 
 inline std::ostream& con_bright(std::ostream &s)
 {
-    return s << "\033[1m";
+       return s << "\033[1m";
 }
 
 inline std::ostream& con_reset(std::ostream &s)
 {
-    return s << "\033[0m";
+       return s << "\033[0m";
 }
 
 #endif
index 1a51fdaafe54d62fa5dbb59d9921519bd8d5124c..9714e9654d3d2a026c3b1f13413718caaeba6bbb 100644 (file)
@@ -38,8 +38,8 @@ enum SerializeFormat
 class CoreExport ExtensionItem : public ServiceProvider, public usecountbase
 {
  public:
-    /** Extensible subclasses
-     */
+       /** Extensible subclasses
+        */
        enum ExtensibleType
        {
                EXT_USER,
index c99b5d64613b3364ab754e1689bbe6e1cd1fd451..87b2636fca0f1d96a07aa27ba95c3b7cac302106 100644 (file)
@@ -72,25 +72,25 @@ CoreExport extern unsigned const char rfc_case_sensitive_map[256];
 
 template<typename T> const T& SearchAndReplace(T& text, const T& pattern, const T& replace)
 {
-        T replacement;
-        if ((!pattern.empty()) && (!text.empty()))
-        {
-                for (std::string::size_type n = 0; n != text.length(); ++n)
-                {
-                        if (text.length() >= pattern.length() && text.substr(n, pattern.length()) == pattern)
-                        {
-                                /* Found the pattern in the text, replace it, and advance */
-                                replacement.append(replace);
-                                n = n + pattern.length() - 1;
-                        }
-                        else
-                        {
-                                replacement += text[n];
-                        }
-                }
-        }
-        text = replacement;
-        return text;
+       T replacement;
+       if ((!pattern.empty()) && (!text.empty()))
+       {
+               for (std::string::size_type n = 0; n != text.length(); ++n)
+               {
+                       if (text.length() >= pattern.length() && text.substr(n, pattern.length()) == pattern)
+                       {
+                               // Found the pattern in the text, replace it, and advance
+                               replacement.append(replace);
+                               n = n + pattern.length() - 1;
+                       }
+                       else
+                       {
+                               replacement += text[n];
+                       }
+               }
+       }
+       text = replacement;
+       return text;
 }
 
 /** The irc namespace contains a number of helper classes.
index d8884bf9fcf9a2f1f0513c24307af7734ee163e7..e7ac756ecdaa636faf524166a272776f3fcea400 100644 (file)
@@ -774,10 +774,10 @@ class CoreExport ModeParser : public fakederef<ModeParser>
        const ModeHandlerMap& GetModes(ModeType mt) const { return modehandlersbyname[mt]; }
 
        /** Show the list of a list mode to a user. Modules can deny the listing.
-     * @param user User to show the list to.
-     * @param chan Channel to show the list of.
-     * @param mh List mode to show the list of.
-     */
+        * @param user User to show the list to.
+        * @param chan Channel to show the list of.
+        * @param mh List mode to show the list of.
+        */
        void ShowListModeList(User* user, Channel* chan, ModeHandler* mh);
 };
 
index 092911c74660948e4436c020fb16650a9a644ceb..2c31fa0ae97f5e67774d1fca6f226502eaa11056 100644 (file)
@@ -626,11 +626,11 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
                ConfigTag *tag = (*it)->config;
                // Make sure our connection class allows motd colors
                if(!tag->getBool("allowmotdcolors"))
-                     continue;
+                       continue;
 
                ConfigFileCache::iterator file = this->Files.find(tag->getString("motd", "motd"));
                if (file != this->Files.end())
-                     InspIRCd::ProcessColors(file->second);
+                       InspIRCd::ProcessColors(file->second);
        }
 
        /* No old configuration -> initial boot, nothing more to do here */
@@ -697,7 +697,7 @@ void ServerConfig::ApplyModules(User* user)
                        if (user)
                                user->WriteNumeric(ERR_CANTUNLOADMODULE, "%s :Failed to unload module %s: %s", modname.c_str(), modname.c_str(), ServerInstance->Modules->LastError().c_str());
                        else
-                                ServerInstance->SNO->WriteGlobalSno('a', "Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str());
+                               ServerInstance->SNO->WriteGlobalSno('a', "Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str());
                }
        }
 
index 50ab883984d98dad2591fba89c634495aa493938..ee85fdd1da71af99e9b9fdc9f02df73c60ead6a9 100644 (file)
@@ -34,7 +34,7 @@ CommandKline::CommandKline(Module* parent)
  */
 CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User *user)
 {
-    std::string target = parameters[0];
+       std::string target = parameters[0];
 
        if (parameters.size() >= 3)
        {
@@ -49,11 +49,11 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User
                else
                        ih = ServerInstance->XLines->IdentSplit(target);
 
-        if (ih.first.empty())
-        {
-            user->WriteNotice("*** Target not found");
-            return CMD_FAILURE;
-        }
+               if (ih.first.empty())
+               {
+                       user->WriteNotice("*** Target not found");
+                       return CMD_FAILURE;
+               }
 
                InsaneBan::IPHostMatcher matcher;
                if (InsaneBan::MatchesEveryone(ih.first+"@"+ih.second, matcher, user, "K", "hostmasks"))
index 1076b0a9a12c88d113b27648bc13510dcaba4071..3a4bf5348c2de554d0323aaa62615cebc80f010c 100644 (file)
@@ -62,7 +62,7 @@ class ModuleAlias : public Module
        /* We cant use a map, there may be multiple aliases with the same name.
         * We can, however, use a fancy invention: the multimap. Maps a key to one or more values.
         *              -- w00t
-     */
+        */
        typedef insp::flat_multimap<std::string, Alias, irc::insensitive_swo> AliasMap;
 
        AliasMap Aliases;
index f74f27f1618ad4b772ffa91d3b1ff86347837589..09d5e604dd12c3e617c3b88a9b799f503a4cdabb 100644 (file)
@@ -194,7 +194,7 @@ class Cap::ManagerImpl : public Cap::Manager, public ReloadModule::EventListener
                        cap->set(user, false);
                }
 
-               ServerInstance->Modules.DelReferent(cap);               
+               ServerInstance->Modules.DelReferent(cap);
                cap->Unregister();
                caps.erase(cap->GetName());
        }
index 45b06865c7e15a465d907e925e9f3e70cd4f7657..21bca0f3fd323a537f3b22c9f64870534297c8c1 100644 (file)
@@ -110,7 +110,7 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> >
                {
                        mx[1][0] = i + 1;
                        for (unsigned int j = 0; j < l2; j++)
-                   mx[1][j + 1] = std::min(std::min(mx[1][j] + 1, mx[0][j + 1] + 1), mx[0][j] + ((s1[i] == s2[j]) ? 0 : 1));
+                               mx[1][j + 1] = std::min(std::min(mx[1][j] + 1, mx[0][j + 1] + 1), mx[0][j] + ((s1[i] == s2[j]) ? 0 : 1));
 
                        mx[0].swap(mx[1]);
                }