]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Commit -Wformat=2 -Wmissing-format-attributes, printf-like functions in inspircd...
authoraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 30 Mar 2008 02:48:54 +0000 (02:48 +0000)
committeraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 30 Mar 2008 02:48:54 +0000 (02:48 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9217 e03df62e-2008-0410-955e-edbf42e46eb7

33 files changed:
configure
include/channels.h
include/inspircd.h
include/logger.h
include/snomasks.h
include/usermanager.h
include/users.h
src/commands/cmd_list.cpp
src/commands/cmd_lusers.cpp
src/commands/cmd_modules.cpp
src/commands/cmd_topic.cpp
src/commands/cmd_whois.cpp
src/configreader.cpp
src/dns.cpp
src/inspircd.cpp
src/modules/extra/m_rline.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/extra/m_ssl_openssl.cpp
src/modules/m_banredirect.cpp
src/modules/m_dccallow.cpp
src/modules/m_delayjoin.cpp
src/modules/m_http_client.cpp
src/modules/m_invisible.cpp
src/modules/m_operlevels.cpp
src/modules/m_restrictchans.cpp
src/modules/m_securelist.cpp
src/modules/m_silence.cpp
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/main.h
src/modules/m_svshold.cpp
src/modules/m_xmlsocket.cpp
src/users.cpp
src/xline.cpp

index 781b098a6844716122b5a71d3ee31f4aa758b394..56a85dac6e9689036d1dd9bf4f2e336e3c898cea 100755 (executable)
--- a/configure
+++ b/configure
@@ -559,8 +559,8 @@ sub svnupdate
        if (scalar(@conflicted) > 0)
        {
                print STDERR "\e[0;33;1mERROR:\e[0m You have local modifications which conflicted with the updates from SVN\n";
-               printf STDERR "Configure is not able to complete the update. Please resolve these conflicts, then run ./configure -%supdate", (($coredirchanged || $configurechanged) ? "" : "mod");
-               print "Conflicted files: " . join ", ", @conflicted;
+               printf STDERR "Configure is not able to complete the update. Please resolve these conflicts, then run ./configure -%supdate\n", (($coredirchanged || $configurechanged) ? "" : "mod");
+               print "Conflicted files: " . join ", ", @conflicted . "\n";
                exit 1;
        }
        if ($configurechanged || $coredirchanged)
@@ -1133,8 +1133,8 @@ sub getosflags {
 
        # Beware: Linux sets it's own cflags below for some retarded reason
        $config{LDLIBS} = "-pthread -lstdc++";
-       $config{FLAGS}  = "-fPIC -Woverloaded-virtual -Wshadow -Wall $config{OPTIMISATI}";
-       $config{DEVELOPER} = "-fPIC -Woverloaded-virtual -Wshadow -Wall -g";
+       $config{FLAGS}  = "-fPIC -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall $config{OPTIMISATI}";
+       $config{DEVELOPER} = "-fPIC -Woverloaded-virtual -Wshadow -Wall -Wformat=2 -Wmissing-format-attribute -g";
        $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared" unless defined $opt_disablerpath;
        $config{MAKEPROG} = "make";
 
@@ -1160,7 +1160,7 @@ sub getosflags {
 
        if ($config{OSNAME} =~ /Linux/i) {
                $config{LDLIBS} = "-ldl -lstdc++ -pthread";
-               $config{FLAGS}  = "-fPIC -Woverloaded-virtual -Wshadow -Wall $config{OPTIMISATI}";
+#              $config{FLAGS}  = "-fPIC -Woverloaded-virtual -Wshadow -Wall $config{OPTIMISATI}";
                $config{FLAGS}  .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
                $config{LDLIBS} .= " " . $ENV{LDLIBS} if exists($ENV{LDLIBS});
                $config{MAKEPROG} = "make";
index 50076fd86b6b1771b618bd95fba303d9d01b9bd1..693f429f4966f5814dcc91fe3a989d8b5b8b1759 100644 (file)
@@ -371,7 +371,7 @@ class CoreExport Channel : public Extensible
         * @param text A printf-style format string which builds the output line without prefix
         * @param ... Zero or more POD types
         */
-       void WriteChannel(User* user, const char* text, ...);
+       void WriteChannel(User* user, const char* text, ...) CUSTOM_PRINTF(3, 4);
 
        /** Write to a channel, from a user, using std::string for text
         * @param user User whos details to prefix the line with
@@ -384,7 +384,7 @@ class CoreExport Channel : public Extensible
         * @param text A printf-style format string which builds the output line without prefix
         * @param ... Zero or more POD type
         */
-       void WriteChannelWithServ(const char* ServName, const char* text, ...);
+       void WriteChannelWithServ(const char* ServName, const char* text, ...) CUSTOM_PRINTF(3, 4);
 
        /** Write to a channel, from a server, using std::string for text
         * @param ServName Server name to prefix the line with
@@ -401,7 +401,7 @@ class CoreExport Channel : public Extensible
         * @param text A printf-style format string which builds the output line without prefix
         * @param ... Zero or more POD type
         */
-       void WriteAllExceptSender(User* user, bool serversource, char status, const char* text, ...);
+       void WriteAllExceptSender(User* user, bool serversource, char status, const char* text, ...) CUSTOM_PRINTF(5, 6);
 
        /** Write to all users on a channel except a list of users, using va_args for text
         * @param user User whos details to prefix the line with, and to omit from receipt of the message
@@ -412,7 +412,7 @@ class CoreExport Channel : public Extensible
         * @param text A printf-style format string which builds the output line without prefix
         * @param ... Zero or more POD type
         */
-       void WriteAllExcept(User* user, bool serversource, char status, CUList &except_list, const char* text, ...);
+       void WriteAllExcept(User* user, bool serversource, char status, CUList &except_list, const char* text, ...) CUSTOM_PRINTF(6, 7);
 
        /** Write to all users on a channel except a specific user, using std::string for text.
         * Internally, this calls WriteAllExcept().
index 84995710dcfdeb4995c98800ed22f97a4fb26aff..9798af4f29bb7599450893815b1bb6c9ee05b840 100644 (file)
 #undef ERROR
 #endif
 
+#ifdef __GNUC__
+#define CUSTOM_PRINTF(STRING, FIRST) __attribute__((format(printf, STRING, FIRST)))
+#else
+#define CUSTOM_PRINTF(STRING, FIRST)
+#endif
+
 // Required system headers.
 #include <time.h>
 #include <stdarg.h>
@@ -796,7 +802,7 @@ class CoreExport InspIRCd : public classbase
         * @param text Format string of to write to the log
         * @param ... Format arguments of text to write to the log
         */
-       void Log(int level, const char* text, ...);
+       void Log(int level, const char* text, ...) CUSTOM_PRINTF(3, 4);
 
        /** Output a log message to the ircd.log file
         * The text will only be output if the current loglevel
@@ -821,7 +827,7 @@ class CoreExport InspIRCd : public classbase
         * @param format Format string for the numeric
         * @param ... Parameters for the format string
         */
-       void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...);
+       void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...) CUSTOM_PRINTF(5, 6);
 
        /** Quit a user for excess flood, and if they are not
         * fully registered yet, temporarily zline their IP.
index 596f98aeedc17a6d5c97a343c144b7a567f659df..25dcea85ff23e423cbc8e2091b79df9d94104a7a 100644 (file)
@@ -253,7 +253,7 @@ class CoreExport LogManager : public classbase
         * @param loglevel Log message level (DEBUG, VERBOSE, DEFAULT, SPARSE, NONE)
         * @param msg The format of the message to be logged. See your C manual on printf() for details.
         */
-       void Log(const std::string &type, int loglevel, const char *fmt, ...);
+       void Log(const std::string &type, int loglevel, const char *fmt, ...) CUSTOM_PRINTF(4, 5);
 };
 
 #endif
index 9541715e326a358e5dc27ad330ea5d05ced6b28f..6e3f75d7a1e6b9b9fc5c8a2c00bebd1c44bb6987 100644 (file)
@@ -100,7 +100,7 @@ class CoreExport SnomaskManager : public Extensible
         * @param text A format string containing text to send
         * @param ... Format arguments
         */
-       void WriteToSnoMask(char letter, const char* text, ...);
+       void WriteToSnoMask(char letter, const char* text, ...) CUSTOM_PRINTF(3, 4);
 
        /** Called once per 5 seconds from the mainloop, this flushes any cached
         * snotices. The way the caching works is as follows:
index 6016a24622fecb0ae681fd79e9a6b3a4652a0ce4..552fb4136386072ef8e0d2828760b4422bc25aad 100644 (file)
@@ -138,13 +138,13 @@ class CoreExport UserManager : public classbase
         * @param text The text format string to send
         * @param ... The format arguments
         */
-       void ServerNoticeAll(const char* text, ...);
+       void ServerNoticeAll(const char* text, ...) CUSTOM_PRINTF(2, 3);
 
        /** Send a server message (PRIVMSG) to all local users
         * @param text The text format string to send
         * @param ... The format arguments
         */
-       void ServerPrivmsgAll(const char* text, ...);
+       void ServerPrivmsgAll(const char* text, ...) CUSTOM_PRINTF(2, 3);
 
        /** Send text to all users with a specific set of modes
         * @param modes The modes to check against, without a +, e.g. 'og'
@@ -154,7 +154,7 @@ class CoreExport UserManager : public classbase
         * @param text The text format string to send
         * @param ... The format arguments
         */
-       void WriteMode(const char* modes, int flags, const char* text, ...);
+       void WriteMode(const char* modes, int flags, const char* text, ...) CUSTOM_PRINTF(4, 5);
 };
 
 #endif
index 74b55202d5db4375a67119711245e07923bb1b94..29db518b799a78460300a4e8f089e50d7ea0e525 100644 (file)
@@ -931,7 +931,7 @@ class CoreExport User : public connection
         * @param text The format string for text to send to the user
         * @param ... POD-type format arguments
         */
-       void Write(const char *text, ...);
+       void Write(const char *text, ...) CUSTOM_PRINTF(2, 3);
 
        /** Write text to this user, appending CR/LF and prepending :server.name
         * @param text A std::string to send to the user
@@ -942,9 +942,9 @@ class CoreExport User : public connection
         * @param text The format string for text to send to the user
         * @param ... POD-type format arguments
         */
-       void WriteServ(const char* text, ...);
+       void WriteServ(const char* text, ...) CUSTOM_PRINTF(2, 3);
 
-       void WriteNumeric(unsigned int numeric, const char* text, ...);
+       void WriteNumeric(unsigned int numeric, const char* text, ...) CUSTOM_PRINTF(3, 4);
 
        void WriteNumeric(unsigned int numeric, const std::string &text);
 
@@ -959,7 +959,7 @@ class CoreExport User : public connection
         * @param text The format string for text to send to the user
         * @param ... POD-type format arguments
         */
-       void WriteFrom(User *user, const char* text, ...);
+       void WriteFrom(User *user, const char* text, ...) CUSTOM_PRINTF(3, 4);
 
        /** Write text to the user provided in the first parameter, appending CR/LF, and prepending THIS user's :nick!user@host.
         * @param dest The user to route the message to
@@ -972,7 +972,7 @@ class CoreExport User : public connection
         * @param text The format string for text to send to the user
         * @param ... POD-type format arguments
         */
-       void WriteTo(User *dest, const char *data, ...);
+       void WriteTo(User *dest, const char *data, ...) CUSTOM_PRINTF(3, 4);
 
        /** Write to all users that can see this user (including this user in the list), appending CR/LF
         * @param text A std::string to send to the users
@@ -983,13 +983,13 @@ class CoreExport User : public connection
         * @param text The format string for text to send to the users
         * @param ... POD-type format arguments
         */
-       void WriteCommon(const char* text, ...);
+       void WriteCommon(const char* text, ...) CUSTOM_PRINTF(2, 3);
 
        /** Write to all users that can see this user (not including this user in the list), appending CR/LF
         * @param text The format string for text to send to the users
         * @param ... POD-type format arguments
         */
-       void WriteCommonExcept(const char* text, ...);
+       void WriteCommonExcept(const char* text, ...) CUSTOM_PRINTF(2, 3);
 
        /** Write to all users that can see this user (not including this user in the list), appending CR/LF
         * @param text A std::string to send to the users
@@ -1008,7 +1008,7 @@ class CoreExport User : public connection
         * @param text The format string to send in the WALLOPS message
         * @param ... Format arguments
         */
-       void WriteWallOps(const char* text, ...);
+       void WriteWallOps(const char* text, ...) CUSTOM_PRINTF(2, 3);
 
        /** Write a WALLOPS message from this user to all local opers.
         * If this user is not opered, the function will return without doing anything.
@@ -1058,7 +1058,7 @@ class CoreExport User : public connection
         * @param text The text format string to send
         * @param ... Format arguments
         */
-       void SendAll(const char* command, const char* text, ...);
+       void SendAll(const char* command, const char* text, ...) CUSTOM_PRINTF(3, 4);
 
        /** Compile a channel list for this user, and send it to the user 'source'
         * Used internally by WHOIS
index 764297f5842decd7a8f526a4e9976511a81e8c9e..2c7971edd33acea5f51b577a1492739a6e304d50 100644 (file)
@@ -64,13 +64,13 @@ CmdResult CommandList::Handle (const char* const* parameters, int pcnt, User *us
                bool n = i->second->HasUser(user);
                if ((i->second->IsModeSet('p')) && (!n))
                {
-                       user->WriteNumeric(322, "%s *",user->nick,i->second->name);
+                       user->WriteNumeric(322, "%s *",user->nick);
                }
                else
                {
                        if (((!(i->second->IsModeSet('p'))) && (!(i->second->IsModeSet('s')))) || (n))
                        {
-                               user->WriteNumeric(322, "%s %s %d :[+%s] %s",user->nick,i->second->name,users,i->second->ChanModes(n),i->second->topic);
+                               user->WriteNumeric(322, "%s %s %ld :[+%s] %s",user->nick,i->second->name,users,i->second->ChanModes(n),i->second->topic);
                        }
                }
        }
index 95f2b15295b7a7c2a6de99b6426766794c01bf0a..313e2d2b5440f451ce7f0f91fb6ab4830bf11835 100644 (file)
@@ -31,7 +31,7 @@ CmdResult CommandLusers::Handle (const char* const*, int, User *user)
        if (ServerInstance->Users->UnregisteredUserCount())
                user->WriteNumeric(253, "%s %d :unknown connections",user->nick,ServerInstance->Users->UnregisteredUserCount());
        if (ServerInstance->ChannelCount())
-               user->WriteNumeric(254, "%s %d :channels formed",user->nick,ServerInstance->ChannelCount());
+               user->WriteNumeric(254, "%s %ld :channels formed",user->nick,ServerInstance->ChannelCount());
        if (ServerInstance->Users->LocalUserCount())
                user->WriteNumeric(255, "%s :I have %d clients and 0 servers",user->nick,ServerInstance->Users->LocalUserCount());
 
index eac31edd0983e1f1dfbe6c3808d6a3bafb1e0da3..4e4679ce4dd99d1f4a4e9c9059bfa17fab01a0d3 100644 (file)
@@ -62,7 +62,7 @@ CmdResult CommandModules::Handle (const char* const*, int, User *user)
                strlcpy(modulename,module_names[i].c_str(),256);
                if (IS_OPER(user))
                {
-                       user->WriteNumeric(702, "%s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick,m,V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2);
+                       user->WriteNumeric(702, "%s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick,(unsigned long)m,V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2);
                }
                else
                {
index f271a597d6a998395539222084a0e999d5e14c5b..2f1e2ea8c3544e2a2f6f01d3c2dd11e7caa8647a 100644 (file)
@@ -37,7 +37,7 @@ CmdResult CommandTopic::Handle (const char* const* parameters, int pcnt, User *u
                        if (Ptr->topicset)
                        {
                                user->WriteNumeric(332, "%s %s :%s", user->nick, Ptr->name, Ptr->topic);
-                               user->WriteNumeric(333, "%s %s %s %d", user->nick, Ptr->name, Ptr->setby, Ptr->topicset);
+                               user->WriteNumeric(333, "%s %s %s %ld", user->nick, Ptr->name, Ptr->setby, Ptr->topicset);
                        }
                        else
                        {
index b0ce2b320fd7c889cfa9edbd50eeeb91f25588e7..b72fd73e539a5d675c3de44274a17145bb6d7f52 100644 (file)
@@ -72,7 +72,7 @@ void do_whois(InspIRCd* ServerInstance, User* user, User* dest,unsigned long sig
                 */
                if ((idle) || (signon))
                {
-                       ServerInstance->SendWhoisLine(user, dest, 317, "%s %s %d %d :seconds idle, signon time",user->nick, dest->nick, idle, signon);
+                       ServerInstance->SendWhoisLine(user, dest, 317, "%s %s %lu %lu :seconds idle, signon time",user->nick, dest->nick, idle, signon);
                }
 
                ServerInstance->SendWhoisLine(user, dest, 318, "%s %s :End of /WHOIS list.",user->nick, dest->nick);
index cba015ec9b6ee6c3fdf77de8518977ecacd0f578..35c65fede790600a1058365dd40a2013f18945bd 100644 (file)
@@ -741,7 +741,7 @@ void ServerConfig::ReportConfigError(const std::string &errormessage, bool bail,
                        ServerInstance->SNO->WriteToSnoMask('A', "There were errors in the configuration file:");
                        while (start < errors.length())
                        {
-                               ServerInstance->SNO->WriteToSnoMask('A', errors.substr(start, 360).c_str());
+                               ServerInstance->SNO->WriteToSnoMask('A', errors.substr(start, 360));
                                start += 360;
                        }
                }
index 447b90781ba0d8436053ae2422fcc82fd4b39618..4bb2da02083ffe7a5c3f0958fca1ccb0c9ff4101 100644 (file)
@@ -1116,7 +1116,7 @@ void DNS::HandleEvent(EventType, int)
 /** Add a derived Resolver to the working set */
 bool DNS::AddResolverClass(Resolver* r)
 {
-       ServerInstance->Logs->Log("RESOLVER",DEBUG,"AddResolverClass %08lx", r);
+       ServerInstance->Logs->Log("RESOLVER",DEBUG,"AddResolverClass 0x%08lx", (unsigned long)r);
        /* Check the pointers validity and the id's validity */
        if ((r) && (r->GetId() > -1))
        {
index 0e5e1120785d34a70ac1c77336007c10de204b47..8d7046ef64182425ed726e0d8b8a708b157e0786 100644 (file)
@@ -678,7 +678,7 @@ int InspIRCd::Run()
                {
                        if (TIME < OLDTIME)
                        {
-                               SNO->WriteToSnoMask('A', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",OLDTIME-TIME);
+                               SNO->WriteToSnoMask('A', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %ld secs.",OLDTIME-TIME);
                        }
 
                        if ((TIME % 3600) == 0)
index 1b2cad8fde2ffbcbf22c6a7c523403eda353148a..db0a64c05960628f67ebac00a928421fd31c56b3 100644 (file)
@@ -91,7 +91,7 @@ class CoreExport RLine : public XLine
 
        void DisplayExpiry()
        {
-               ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed R-Line %s (set by %s %d seconds ago)", this->matchtext.c_str(), this->source, this->duration);
+               ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed R-Line %s (set by %s %ld seconds ago)", this->matchtext.c_str(), this->source, this->duration);
        }
 
        const char* Displayable()
index 6ee124f222f50e7479b3a9aad678a69be9dda83a..81d919ad642bfef856ce3bd22f808dc8270e704a 100644 (file)
@@ -172,13 +172,13 @@ class ModuleSSLGnuTLS : public Module
                                                for (size_t i = 0; i < ServerInstance->Config->ports.size(); i++)
                                                        if ((ServerInstance->Config->ports[i]->GetPort() == portno) && (ServerInstance->Config->ports[i]->GetIP() == addr))
                                                                ServerInstance->Config->ports[i]->SetDescription("ssl");
-                                               ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", portno);
+                                               ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %ld", portno);
 
                                                sslports.append((addr.empty() ? "*" : addr)).append(":").append(ConvToStr(portno)).append(";");
                                        }
                                        catch (ModuleException &e)
                                        {
-                                               ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d: %s. Maybe it's already hooked by the same port on a different IP, or you have an other SSL or similar module loaded?", portno, e.GetReason());
+                                               ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %ld: %s. Maybe it's already hooked by the same port on a different IP, or you have an other SSL or similar module loaded?", portno, e.GetReason());
                                        }
                                }
                        }
index c4bc180e5f49b209ce9b802003e407f535a92754..c8fdefe627c181ea9a4495cde33a1a4b7f4893fa 100644 (file)
@@ -195,13 +195,13 @@ class ModuleSSLOpenSSL : public Module
                                                 for (size_t i = 0; i < ServerInstance->Config->ports.size(); i++)
                                                         if ((ServerInstance->Config->ports[i]->GetPort() == portno) && (ServerInstance->Config->ports[i]->GetIP() == addr))
                                                                 ServerInstance->Config->ports[i]->SetDescription("ssl");
-                                                ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", portno);
+                                                ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %ld", portno);
 
                                                 sslports.append((addr.empty() ? "*" : addr)).append(":").append(ConvToStr(portno)).append(";");
                                         }
                                         catch (ModuleException &e)
                                         {
-                                                ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d: %s. Maybe it's already hooked by the same port on a different IP, or you have an other SSL or similar module loaded?", portno, e.GetReason());
+                                                ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %ld: %s. Maybe it's already hooked by the same port on a different IP, or you have an other SSL or similar module loaded?", portno, e.GetReason());
                                         }
                                 }
                         }
index 047c55e7f9f292a3eefe0172b3365fa2d7ccdb4f..bb59cde3db36b9fc3fbb8cfbb666b97a7d63204c 100644 (file)
@@ -64,7 +64,7 @@ class BanRedirect : public ModeWatcher
                
                        if(adding && (channel->bans.size() > static_cast<unsigned>(maxbans)))
                        {
-                               source->WriteNumeric(478, "%s %s :Channel ban list for %s is full (maximum entries for this channel is %d)", source->nick, channel->name, channel->name, maxbans);
+                               source->WriteNumeric(478, "%s %s :Channel ban list for %s is full (maximum entries for this channel is %ld)", source->nick, channel->name, channel->name, maxbans);
                                return false;
                        }
                        
index 1f2b6227a29c72697d6fee640360b1d19f792f89..747616bc0a5d611fdfcfd733fbde91b3a30c4f16 100644 (file)
@@ -172,7 +172,7 @@ class CommandDccallow : public Command
                        
                                        if (length > 0)
                                        {
-                                               user->WriteNumeric(993, "%s %s :Added %s to DCCALLOW list for %d seconds", user->nick, user->nick, target->nick, length);
+                                               user->WriteNumeric(993, "%s %s :Added %s to DCCALLOW list for %ld seconds", user->nick, user->nick, target->nick, length);
                                        }
                                        else
                                        {
index 126221dd22f1f84d020b23a1f0e7ee917895eee9..88a654cc7301afc24742241aa2dfddc2a20059fd 100644 (file)
@@ -188,7 +188,7 @@ class ModuleDelayJoin : public Module
                user->Shrink("delayjoin");
        }
 
-       void WriteCommonFrom(User *user, Channel* channel, const char* text, ...)
+       void WriteCommonFrom(User *user, Channel* channel, const char* text, ...) CUSTOM_PRINTF(4, 5)
        {
                va_list argsPtr;
                char textbuffer[MAXBUF];
index 9cf6e45b4fcc2c72062e79b316d3b07e6cbbe1e5..ef3cf5c33af8fb6aa425477f379b5982abf5e5ba 100644 (file)
@@ -260,7 +260,7 @@ void HTTPSocket::Connect(const std::string &ip)
 {
        this->response = new HTTPClientResponse((Module*)Mod, req.GetSource() , url.url, 0, "");
 
-       Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::Connect(%s) response=%08lx", ip.c_str(), response);
+       Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::Connect(%s) response=%08lx", ip.c_str(), (unsigned long)response);
        strlcpy(this->IP, ip.c_str(), MAXBUF);
        strlcpy(this->host, ip.c_str(), MAXBUF);
 
@@ -354,7 +354,7 @@ void HTTPSocket::OnClose()
        if (!closed)
        {
                closed = true;
-               Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::OnClose response=%08lx", response);
+               Instance->Logs->Log("m_http_client",DEBUG,"HTTPSocket::OnClose response=%08lx", (unsigned long)response);
                std::string e;
                if (data.empty())
                        {
index 685dc209afe333af2e04a80b48ef78ac340f8d11..b903941647d60bd6e9c97fb3d695c1c0b01d091e 100644 (file)
@@ -258,7 +258,7 @@ class ModuleInvisible : public Module
        }
 
        /* Fix by Eric @ neowin.net, thanks :) -- Brain */
-       void WriteCommonFrom(User *user, Channel* channel, const char* text, ...)
+       void WriteCommonFrom(User *user, Channel* channel, const char* text, ...) CUSTOM_PRINTF(4,5)
        {
                va_list argsPtr;
                char textbuffer[MAXBUF];
index 972f7844144e599bf351037478b1e7fca9525e4e..b436b953bb21dad3931003ba2e8cf7919c0d1f45 100644 (file)
@@ -74,7 +74,7 @@ class ModuleOperLevels : public Module
                                }
                                if (dest_level > source_level)
                                {
-                                       ServerInstance->SNO->WriteToSnoMask('A', "Oper %s (level %d) attempted to /kill a higher oper: %s (level %d): Reason: %s",source->nick,source_level,dest->nick,dest_level,reason.c_str());
+                                       ServerInstance->SNO->WriteToSnoMask('A', "Oper %s (level %ld) attempted to /kill a higher oper: %s (level %ld): Reason: %s",source->nick,source_level,dest->nick,dest_level,reason.c_str());
                                        dest->WriteServ("NOTICE %s :Oper %s attempted to /kill you!",dest->nick,source->nick);
                                        source->WriteNumeric(481, "%s :Permission Denied - Oper %s is a higher level than you",source->nick,dest->nick);
                                        return 1;
index b2c4273e3abe04530322fdc1d75ac739393e67c8..8543e97193167f88e0dcc64c8bd78d4d5ad79888 100644 (file)
@@ -60,7 +60,7 @@ class ModuleRestrictChans : public Module
                        // channel does not yet exist (record is null, about to be created IF we were to allow it)
                        if (!chan)
                        {
-                               user->WriteNumeric(530, "%s %s :Only IRC operators may create new channels",user->nick,cname,cname);
+                               user->WriteNumeric(530, "%s %s :Only IRC operators may create new channels",user->nick,cname);
                                return 1;
                        }
                }
index 3974cf01703de373af833f35dea87dde89e663d9..95227e770bb9f2d083585e48c06b9425079a5791 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 %d seconds of connecting. Please try again later.",user->nick, WaitTime);
+                       user->WriteServ("NOTICE %s :*** You cannot list within the first %ld seconds of connecting. Please try again later.",user->nick, 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 4ff26aca625ab29ee05eb0c49d54fcc77c3697d9..165f00df9096f7eb541aa20eb239c63ce1ac2c08 100644 (file)
@@ -110,7 +110,7 @@ class CommandSilence : public Command
                                }
                                if (sl->size() >= maxsilence)
                                {
-                                       user->WriteNumeric(952, "%s %s :Your silence list is full",user->nick, user->nick, mask.c_str());
+                                       user->WriteNumeric(952, "%s %s :Your silence list is full",user->nick, user->nick);
                                        return CMD_FAILURE;
                                }
                                sl->insert(std::make_pair<irc::string, time_t>(mask.c_str(), ServerInstance->Time()));
index 067b729ad9842cfa3ce87669c811e83433c29b04..b37edf583c776c483494c725bb22120828037b7f 100644 (file)
@@ -153,7 +153,7 @@ void ModuleSpanningTree::HandleLusers(const char* const* parameters, int pcnt, U
                user->WriteNumeric(253, "%s %d :unknown connections",user->nick,ServerInstance->Users->UnregisteredUserCount());
        
        if (ServerInstance->ChannelCount())
-               user->WriteNumeric(254, "%s %d :channels formed",user->nick,ServerInstance->ChannelCount());
+               user->WriteNumeric(254, "%s %ld :channels formed",user->nick,ServerInstance->ChannelCount());
        
        user->WriteNumeric(255, "%s :I have %d clients and %d servers",user->nick,ServerInstance->Users->LocalUserCount(),ulined_local_count ? this->CountLocalServs() - ulined_local_count : this->CountLocalServs());
        user->WriteNumeric(265, "%s :Current Local Users: %d  Max: %d",user->nick,ServerInstance->Users->LocalUserCount(),max_local);
index 4002ad61e3f5a5545eeb9df5b4037515c801d61c..a3d249a5107378e67c01351a494f7044b01c33bd 100644 (file)
@@ -134,7 +134,7 @@ class ModuleSpanningTree : public Module
 
        /** Attempt to send a message to a user
         */
-       void RemoteMessage(User* user, const char* format, ...);
+       void RemoteMessage(User* user, const char* format, ...) CUSTOM_PRINTF(3, 4);
 
        /** Returns oper-specific MAP information
         */
index b176d4a50ca3cdc7f68d39b54e9988b0f948e984..c5538dabd636c5968052565036fd86ecbaadf230 100644 (file)
@@ -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 %u seconds ago expired", (*iter)->length, (*iter)->nickname.c_str(), (*iter)->reason.c_str(), ServerInstance->Time() - (*iter)->set_on);
+                                       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);
                                        HoldMap.erase(assign((*iter)->nickname));
                                        delete *iter;
                                        safeiter = iter;
index f3bd530f7a19a0629e5cc4f79bc6c5f74936edce..821a8363b67e3a51059eb5bdd0f75438f2037630 100644 (file)
@@ -71,7 +71,7 @@ class ModuleXMLSocket : public Module
                                        }
                                        catch (ModuleException &e)
                                        {
-                                               ServerInstance->Logs->Log("m_xmlsocket",DEFAULT, "m_xmlsocket.so: FAILED to enable XMLSocket on port %d: %s. Maybe you have another similar module loaded?", portno, e.GetReason());
+                                               ServerInstance->Logs->Log("m_xmlsocket",DEFAULT, "m_xmlsocket.so: FAILED to enable XMLSocket on port %ld: %s. Maybe you have another similar module loaded?", portno, e.GetReason());
                                        }
                                }
                        }
index f8a95af49a195197042218fb16176f955030c39d..f8a1bd330a77b9a3941e0325bf7e9718c259d3fc 100644 (file)
@@ -224,7 +224,7 @@ User::~User()
        if (this->MyClass)
        {
                this->MyClass->RefCount--;
-               ServerInstance->Logs->Log("USERS", DEBUG, "User destructor -- connect refcount now: %u", this->MyClass->RefCount);
+               ServerInstance->Logs->Log("USERS", DEBUG, "User destructor -- connect refcount now: %lu", this->MyClass->RefCount);
        }
        if (this->AllowedOperCommands)
        {
@@ -520,7 +520,7 @@ bool User::AddBuffer(std::string a)
                if (this->MyClass && (recvq.length() > this->MyClass->GetRecvqMax()))
                {
                        this->SetWriteError("RecvQ exceeded");
-                       ServerInstance->SNO->WriteToSnoMask('A', "User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->MyClass->GetRecvqMax());
+                       ServerInstance->SNO->WriteToSnoMask('A', "User %s RecvQ of %d exceeds connect class maximum of %lu",this->nick,recvq.length(),this->MyClass->GetRecvqMax());
                        return false;
                }
 
@@ -597,7 +597,7 @@ void User::AddWriteBuf(const std::string &data)
                 * to repeatedly add the text to the sendq!
                 */
                this->SetWriteError("SendQ exceeded");
-               ServerInstance->SNO->WriteToSnoMask('A', "User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->MyClass->GetSendqMax());
+               ServerInstance->SNO->WriteToSnoMask('A', "User %s SendQ of %d exceeds connect class maximum of %lu",this->nick,sendq.length() + data.length(),this->MyClass->GetSendqMax());
                return;
        }
 
@@ -1708,7 +1708,7 @@ ConnectClass* User::SetClass(const std::string &explicit_name)
                /* deny change if change will take class over the limit */
                if (found->limit && (found->RefCount + 1 >= found->limit))
                {
-                       ServerInstance->Logs->Log("USERS", DEBUG, "OOPS: Connect class limit (%u) hit, denying", found->limit);
+                       ServerInstance->Logs->Log("USERS", DEBUG, "OOPS: Connect class limit (%lu) hit, denying", found->limit);
                        return this->MyClass;
                }
 
@@ -1718,12 +1718,12 @@ ConnectClass* User::SetClass(const std::string &explicit_name)
                        if (found == this->MyClass) // no point changing this shit :P
                                return this->MyClass;
                        this->MyClass->RefCount--;
-                       ServerInstance->Logs->Log("USERS", DEBUG, "Untying user from connect class -- refcount: %u", this->MyClass->RefCount);
+                       ServerInstance->Logs->Log("USERS", DEBUG, "Untying user from connect class -- refcount: %lu", this->MyClass->RefCount);
                }
 
                this->MyClass = found;
                this->MyClass->RefCount++;
-               ServerInstance->Logs->Log("USERS", DEBUG, "User tied to new class -- connect refcount now: %u", this->MyClass->RefCount);
+               ServerInstance->Logs->Log("USERS", DEBUG, "User tied to new class -- connect refcount now: %lu", this->MyClass->RefCount);
        }
 
        return this->MyClass;
index 19a15decf27b6e632a5637712759b58ceac9ff50..3f0ddbf2b14104ae6f34db8d7c957a96454f93a6 100644 (file)
@@ -552,27 +552,27 @@ void ELine::OnAdd()
 
 void ELine::DisplayExpiry()
 {
-       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed E-Line %s@%s (set by %s %d seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
+       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed E-Line %s@%s (set by %s %ld seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
 }
 
 void QLine::DisplayExpiry()
 {
-       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed Q-Line %s (set by %s %d seconds ago)",this->nick,this->source,this->duration);
+       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed Q-Line %s (set by %s %ld seconds ago)",this->nick,this->source,this->duration);
 }
 
 void ZLine::DisplayExpiry()
 {
-       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed Z-Line %s (set by %s %d seconds ago)",this->ipaddr,this->source,this->duration);
+       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed Z-Line %s (set by %s %ld seconds ago)",this->ipaddr,this->source,this->duration);
 }
 
 void KLine::DisplayExpiry()
 {
-       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed K-Line %s@%s (set by %s %d seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
+       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed K-Line %s@%s (set by %s %ld seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
 }
 
 void GLine::DisplayExpiry()
 {
-       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed G-Line %s@%s (set by %s %d seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
+       ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed G-Line %s@%s (set by %s %ld seconds ago)",this->identmask,this->hostmask,this->source,this->duration);
 }
 
 const char* ELine::Displayable()