]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
DOH! Fix my muppetry of a segfault, and fix some warnings
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Apr 2008 18:45:54 +0000 (18:45 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Apr 2008 18:45:54 +0000 (18:45 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9273 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_securelist.cpp
src/modules/m_spanningtree/fjoin.cpp
src/modules/m_spanningtree/fmode.cpp
src/modules/m_svshold.cpp
src/modules/m_watch.cpp
src/socketengines/socketengine_kqueue.cpp

index 95227e770bb9f2d083585e48c06b9425079a5791..829a6514abf9028b250604a5696d17e2a3ef6561 100644 (file)
@@ -68,7 +68,7 @@ class ModuleSecureList : public Module
                                        return 0;
 
                        /* Not exempt, BOOK EM DANNO! */
-                       user->WriteServ("NOTICE %s :*** You cannot list within the first %ld seconds of connecting. Please try again later.",user->nick, WaitTime);
+                       user->WriteServ("NOTICE %s :*** You cannot list within the first %lu seconds of connecting. Please try again later.",user->nick, (unsigned long) WaitTime);
                        /* Some crap clients (read: mIRC, various java chat applets) muck up if they don't
                         * receive these numerics whenever they send LIST, so give them an empty LIST to mull over.
                         */
index 0f33d65bdeebb753be2c70a0222a7fbbd572031f..0bddb4da7a6539b04980fc804d9d66420234fe2a 100644 (file)
@@ -96,7 +96,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
        {
                std::deque<std::string> param_list;
                if (Utils->AnnounceTSChange && chan)
-                       chan->WriteChannelWithServ(Instance->Config->ServerName, "NOTICE %s :TS for %s changed from %lu to %lu", chan->name, chan->name, ourTS, TS);
+                       chan->WriteChannelWithServ(Instance->Config->ServerName, "NOTICE %s :TS for %s changed from %lu to %lu", chan->name, chan->name, (unsigned long) ourTS, (unsigned long) TS);
                ourTS = TS;
                if (!created)
                {
index 260b4523cb32c3eff86ac05825ee9d9ffaf08b11..94a5c1dce0e1b5da3900f445e7e2c4aedb642d20 100644 (file)
@@ -100,7 +100,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
        if (TS <= ourTS)
        {
                if ((TS < ourTS) && (!dst))
-                       Instance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG *** Channel TS sent in FMODE to %s is %lu which is not equal to %lu!", params[0].c_str(), TS, ourTS);
+                       Instance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG *** Channel TS sent in FMODE to %s is %lu which is not equal to %lu!", params[0].c_str(), (unsigned long) TS, (unsigned long) ourTS);
 
                if (smode)
                {
index c5538dabd636c5968052565036fd86ecbaadf230..4a650fb1fc3d3afaa598d70960eb38ff9314fdf2 100644 (file)
@@ -82,7 +82,7 @@ class CommandSvshold : public Command
                                                if ((*iter)->length)
                                                {
                                                        remaining = ((*iter)->set_on + (*iter)->length) - ServerInstance->Time();
-                                                       user->WriteServ( "386 %s %s :Removed SVSHOLD with %lu seconds left before expiry (%s)", user->nick, (*iter)->nickname.c_str(), remaining, (*iter)->reason.c_str());
+                                                       user->WriteServ( "386 %s %s :Removed SVSHOLD with %lu seconds left before expiry (%s)", user->nick, (*iter)->nickname.c_str(), (unsigned long)remaining, (*iter)->reason.c_str());
                                                }
                                                else
                                                {
@@ -113,7 +113,7 @@ class CommandSvshold : public Command
                                        return CMD_FAILURE;
                                }
 
-                               long length = ServerInstance->Duration(parameters[1]);
+                               unsigned long length = ServerInstance->Duration(parameters[1]);
                                std::string reason = (pcnt > 2) ? parameters[2] : "No reason supplied";
                                
                                SVSHold* S = new SVSHold(parameters[0], user->nick, ServerInstance->Time(), length, reason);
@@ -261,7 +261,7 @@ class ModuleSVSHold : public Module
                                if ((*iter)->set_on + (*iter)->length <= ServerInstance->Time())
                                {
                                        ServerInstance->Logs->Log("m_svshold",DEBUG, "m_svshold.so: hold on %s expired, removing...", (*iter)->nickname.c_str());
-                                       ServerInstance->SNO->WriteToSnoMask('A',"%li second SVSHOLD on %s (%s) set %ld seconds ago expired", (*iter)->length, (*iter)->nickname.c_str(), (*iter)->reason.c_str(), ServerInstance->Time() - (*iter)->set_on);
+                                       ServerInstance->SNO->WriteToSnoMask('A',"%lu second SVSHOLD on %s (%s) set %lu seconds ago expired", (unsigned long) (*iter)->length, (*iter)->nickname.c_str(), (*iter)->reason.c_str(), (unsigned long) ServerInstance->Time() - (*iter)->set_on);
                                        HoldMap.erase(assign((*iter)->nickname));
                                        delete *iter;
                                        safeiter = iter;
index ac0b5affbafdc9ae6bca9ce9e811539fb31e5950..19521dba6deef73bd7268daa7f218a8ed702aaf6 100644 (file)
@@ -241,7 +241,7 @@ class CommandWatch : public Command
                                user->WriteNumeric(604, "%s %s %s :is online",user->nick, nick, (*wl)[nick].c_str());
                                if (IS_AWAY(target))
                                {
-                                       user->WriteNumeric(609, "%s %s %s %s %ld :is away", user->nick, target->nick, target->ident, target->dhost, target->awaytime);
+                                       user->WriteNumeric(609, "%s %s %s %s %lu :is away", user->nick, target->nick, target->ident, target->dhost, (unsigned long) target->awaytime);
                                }
                        }
                        else
@@ -320,7 +320,7 @@ class CommandWatch : public Command
                                                                User *targ = ServerInstance->FindNick(q->first.c_str());
                                                                if (IS_AWAY(targ))
                                                                {
-                                                                       user->WriteNumeric(609, "%s %s %s %s %ld :is away", user->nick, targ->nick, targ->ident, targ->dhost, targ->awaytime);
+                                                                       user->WriteNumeric(609, "%s %s %s %s %lu :is away", user->nick, targ->nick, targ->ident, targ->dhost, (unsigned long) targ->awaytime);
                                                                }
                                                        }
                                                        else
@@ -433,7 +433,7 @@ class Modulewatch : public Module
                        for (std::deque<User*>::iterator n = x->second.begin(); n != x->second.end(); n++)
                        {
                                if (!user->Visibility || user->Visibility->VisibleTo(user))
-                                       (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick ,user->nick, user->ident, user->dhost, ServerInstance->Time());
+                                       (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick ,user->nick, user->ident, user->dhost, (unsigned long) ServerInstance->Time());
 
                                watchlist* wl;
                                if ((*n)->GetExt("watchlist", wl))
@@ -503,7 +503,7 @@ class Modulewatch : public Module
                        for (std::deque<User*>::iterator n = x->second.begin(); n != x->second.end(); n++)
                        {
                                if (!user->Visibility || user->Visibility->VisibleTo(user))
-                                       (*n)->WriteNumeric(600, "%s %s %s %s %lu :arrived online", (*n)->nick, user->nick, user->ident, user->dhost, user->age);
+                                       (*n)->WriteNumeric(600, "%s %s %s %s %lu :arrived online", (*n)->nick, user->nick, user->ident, user->dhost, (unsigned long) user->age);
 
                                watchlist* wl;
                                if ((*n)->GetExt("watchlist", wl))
@@ -526,7 +526,7 @@ class Modulewatch : public Module
                                if ((*n)->GetExt("watchlist", wl))
                                {
                                        if (!user->Visibility || user->Visibility->VisibleTo(user))
-                                               (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick, oldnick.c_str(), user->ident, user->dhost, user->age);
+                                               (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick, oldnick.c_str(), user->ident, user->dhost, (unsigned long) user->age);
                                        (*wl)[oldnick.c_str()] = "";
                                }
                        }
index 5fabb5b8de62be950c465e2888f2dccd767b3c98..f21d2e7105a99f648fe985b4014b7d237a966649 100644 (file)
@@ -22,8 +22,9 @@
 KQueueEngine::KQueueEngine(InspIRCd* Instance) : SocketEngine(Instance)
 {
        this->RecoverFromFork();
-       ref = new EventHandler* [GetMaxFds()];
        ke_list = new struct kevent[GetMaxFds()];
+       ref = new EventHandler* [GetMaxFds()];
+       memset(ref, 0, GetMaxFds() * sizeof(EventHandler*));
 }
 
 void KQueueEngine::RecoverFromFork()
@@ -43,7 +44,6 @@ void KQueueEngine::RecoverFromFork()
                ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE);
        }
        CurrentSetSize = 0;
-       memset(ref, 0, GetMaxFds() * sizeof(EventHandler*));
 }
 
 KQueueEngine::~KQueueEngine()