]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
ModResult conversion: Change return type of all module functions
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 10659ae5fca6d35095b7082ac9cf5bf32260013d..0ec8db966601540fe60e04324e8a958c8b65eef1 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *         the file COPYING for details.
@@ -55,7 +55,7 @@ User* InspIRCd::FindNick(const char* nick)
                return FindUUID(nick);
 
        user_hash::iterator iter = this->Users->clientlist->find(nick);
-       
+
        if (iter == this->Users->clientlist->end())
                return NULL;
 
@@ -150,11 +150,11 @@ long InspIRCd::ChannelCount()
 
 bool InspIRCd::IsValidMask(const std::string &mask)
 {
-       char* dest = (char*)mask.c_str();
+       const char* dest = mask.c_str();
        int exclamation = 0;
        int atsign = 0;
 
-       for (char* i = dest; *i; i++)
+       for (const char* i = dest; *i; i++)
        {
                /* out of range character, bad mask */
                if (*i < 32 || *i > 126)
@@ -204,7 +204,7 @@ bool IsChannelHandler::Call(const char *chname, size_t max)
                c++;
        }
 
-       size_t len = c - chname;        
+       size_t len = c - chname;
        /* too long a name - note funky pointer arithmetic here. */
        if (len > max)
        {
@@ -219,7 +219,7 @@ bool IsNickHandler::Call(const char* n, size_t max)
 {
        if (!n || !*n)
                return false;
+
        unsigned int p = 0;
        for (const char* i = n; *i; i++, p++)
        {
@@ -340,22 +340,12 @@ void InspIRCd::CheckRoot()
        }
 }
 
-void InspIRCd::CheckDie()
-{
-       if (*Config->DieValue)
-       {
-               printf("WARNING: %s\n\n",Config->DieValue);
-               this->Logs->Log("CONFIG",DEFAULT,"Died because of <die> tag: %s",Config->DieValue);
-               Exit(EXIT_STATUS_DIETAG);
-       }
-}
-
 void InspIRCd::SendWhoisLine(User* user, User* dest, int numeric, const std::string &text)
 {
        std::string copy_text = text;
 
-       int MOD_RESULT = 0;
-       FOREACH_RESULT_I(this, I_OnWhoisLine, OnWhoisLine(user, dest, numeric, copy_text));
+       ModResult MOD_RESULT;
+       FIRST_MOD_RESULT(this, OnWhoisLine, MOD_RESULT, (user, dest, numeric, copy_text));
 
        if (!MOD_RESULT)
                user->WriteServ("%d %s", numeric, copy_text.c_str());
@@ -443,7 +433,7 @@ void InspIRCd::AddExtBanChar(char c)
 {
        std::string &tok = Config->data005;
        std::string::size_type ebpos;
-       
+
        if ((ebpos = tok.find(" EXTBAN=,")) == std::string::npos)
        {
                tok.append(" EXTBAN=,");