]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Commit patch from danieldg that makes a ton of stuff const-safe for latest warn-happy...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 13 Feb 2008 18:22:19 +0000 (18:22 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 13 Feb 2008 18:22:19 +0000 (18:22 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8922 e03df62e-2008-0410-955e-edbf42e46eb7

38 files changed:
include/channels.h
include/configreader.h
include/dynamic.h
include/inspircd.h
include/inspsocket.h
include/modules.h
include/usermanager.h
include/users.h
src/channels.cpp
src/commands/cmd_modules.cpp
src/commands/cmd_who.cpp
src/configreader.cpp
src/inspsocket.cpp
src/modules.cpp
src/modules/extra/m_httpclienttest.cpp
src/modules/extra/m_mysql.cpp
src/modules/extra/m_pgsql.cpp
src/modules/extra/m_sqlauth.cpp
src/modules/extra/m_sqlite3.cpp
src/modules/extra/m_sqllog.cpp
src/modules/extra/m_sqloper.cpp
src/modules/extra/m_sqlutils.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/extra/m_ssl_openssl.cpp
src/modules/extra/m_testclient.cpp
src/modules/extra/m_ziplink.cpp
src/modules/m_banexception.cpp
src/modules/m_http_client.cpp
src/modules/m_httpd.cpp
src/modules/m_httpd_stats.cpp
src/modules/m_inviteexception.cpp
src/modules/m_md5.cpp
src/modules/m_proxyscan.cpp
src/modules/m_sha256.cpp
src/modules/m_spanningtree/treesocket1.cpp
src/socket.cpp
src/usermanager.cpp
src/users.cpp

index 3419e4c69c0ef8abb63a84c1853e3acac0f9e58c..aa23d881664418b523077ca382bc01921c8d0dcf 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, char* text, ...);
+       void WriteChannel(User* user, const char* text, ...);
 
        /** Write to a channel, from a user, using std::string for text
         * @param user User whos details 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, char* text, ...);
+       void WriteAllExceptSender(User* user, bool serversource, char status, const char* text, ...);
 
        /** 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, char* text, ...);
+       void WriteAllExcept(User* user, bool serversource, char status, CUList &except_list, const char* text, ...);
 
        /** Write to all users on a channel except a specific user, using std::string for text.
         * Internally, this calls WriteAllExcept().
index fb187048b3f6a2030af6a96bf45ceebde33a212b..e74895e8bd1315d555f68a3e7c2353c373f3e70a 100644 (file)
@@ -68,10 +68,8 @@ class ValueItem
        /** Initialize with a bool */
        ValueItem(bool value);
        /** Initialize with a char pointer */
-       ValueItem(char* value);
+       ValueItem(const char* value);
        /** Change value to a char pointer */
-       void Set(char* value);
-       /** Change value to a const char pointer */
        void Set(const char* val);
        /** Change value to an int */
        void Set(int value);
@@ -166,11 +164,11 @@ typedef bool (*MultiNotify)(ServerConfig* conf, const char*);
 struct InitialConfig
 {
        /** Tag name */
-       char* tag;
+       const char* tag;
        /** Value name */
-       char* value;
+       const char* value;
        /** Default, if not defined */
-       char* default_value;
+       const char* default_value;
        /** Value containers */
        ValueContainerBase* val;
        /** Data types */
@@ -187,9 +185,9 @@ struct MultiConfig
        /** Tag name */
        const char*     tag;
        /** One or more items within tag */
-       char*           items[18];
+       const char*     items[18];
        /** One or more defaults for items within tags */
-       char*           items_default[18];
+       const char* items_default[18];
        /** One or more data types */
        int             datatype[18];
        /** Initialization function */
@@ -240,7 +238,7 @@ class CoreExport ServerConfig : public Extensible
 
        /** Check that there is only one of each configuration item
         */
-       bool CheckOnce(char* tag);
+       bool CheckOnce(const char* tag);
 
  public:
 
index 4cf299c1f33c554e9f2759cfda8da06f96d8602b..727ed11e1576b37856426e0f35840010aea97358 100644 (file)
@@ -23,7 +23,7 @@ class CoreExport DLLManager
 
        /** The last error string, or NULL
         */
-       char *err;
+       const char *err;
  
  public:
        /** This constructor loads the module using dlopen()
@@ -44,7 +44,7 @@ class CoreExport DLLManager
        /** Get the last error from dlopen() or dlsym().
         * @return The last error string, or NULL if no error has occured.
         */
-       char* LastError() 
+       const char* LastError()
        {
                 return err;
        }
index d1e6f4005ac5234754f43a8e77efb26d3474483c..5fd641c6b3b36d17ee70669c0b88cafee12279a1 100644 (file)
@@ -478,7 +478,7 @@ class CoreExport InspIRCd : public classbase
         * @param addr The address to bind to (IP only)
         * @return True if the port was bound successfully
         */
-       bool BindSocket(int sockfd, int port, char* addr, bool dolisten = true);
+       bool BindSocket(int sockfd, int port, const char* addr, bool dolisten = true);
 
        /** Adds a server name to the list of servers we've seen
         * @param The servername to add
index 77c283f7fcb9109f9fe9333089593a62aadbf521..d33cde5e82752229e30a18afde7ffff7d0193e5c 100644 (file)
@@ -318,7 +318,7 @@ class CoreExport BufferedSocket : public EventHandler
         * into a char* array which can be up to
         * 16 kilobytes in length.
         */
-       virtual char* Read();
+       virtual const char* Read();
 
        /**
         * Returns the IP address associated with
index 09b1f954b0e45fbccb696710f0525906bcffe8e9..6a08aaec604cac96e39b4307c37afaa0f13da508 100644 (file)
@@ -335,7 +335,7 @@ class CoreExport Request : public ModuleMessage
         * sent the request to. It is up to your module to know what this data is and
         * how to deal with it.
         */
-       char* Send();
+       const char* Send();
 };
 
 
@@ -1195,7 +1195,7 @@ class CoreExport Module : public Extensible
         * may be able to use for pre-determined purposes (e.g. the results of an SQL query, etc).
         * @param request The Request class being received
         */
-       virtual char* OnRequest(Request* request);
+       virtual const char* OnRequest(Request* request);
 
        /** Called whenever a password check is to be made. Replaces the old OldOperCompare API.
         * The password field (from the config file) is in 'password' and is to be compared against
index 33b97129a9bf1ad143d2757e596bbe39b7fd3026..0fe418ba3fb25dbf02972049fa176b7c983d7da3 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(char* text, ...);
+       void ServerNoticeAll(const char* text, ...);
 
        /** Send a server message (PRIVMSG) to all local users
         * @param text The text format string to send
         * @param ... The format arguments
         */
-       void ServerPrivmsgAll(char* text, ...);
+       void ServerPrivmsgAll(const char* text, ...);
 
        /** Send text to all users with a specific set of modes
         * @param modes The modes to check against, without a +, e.g. 'og'
index 507fdf97bb3d969d6a011f786d00cc7d52029492..a63dd7cc67a95b882eb29a5e985cc9f3eaea19ff 100644 (file)
@@ -1033,7 +1033,7 @@ class CoreExport User : public connection
         * @param text The text format string to send
         * @param ... Format arguments
         */
-       void SendAll(const char* command, char* text, ...);
+       void SendAll(const char* command, const char* text, ...);
 
        /** Compile a channel list for this user, and send it to the user 'source'
         * Used internally by WHOIS
index bb388e21e032f79de4e924b1eb940de7b03aa75e..2140a37aea1ae9919f841bbcbd23ad39ff5de95d 100644 (file)
@@ -624,7 +624,7 @@ long Channel::KickUser(User *src, User *user, const char* reason)
        return this->GetUserCounter();
 }
 
-void Channel::WriteChannel(User* user, char* text, ...)
+void Channel::WriteChannel(User* user, const char* text, ...)
 {
        char textbuffer[MAXBUF];
        va_list argsPtr;
@@ -689,7 +689,7 @@ void Channel::WriteChannelWithServ(const char* ServName, const std::string &text
 
 /* write formatted text from a source user to all users on a channel except
  * for the sender (for privmsg etc) */
-void Channel::WriteAllExceptSender(User* user, bool serversource, char status, char* text, ...)
+void Channel::WriteAllExceptSender(User* user, bool serversource, char status, const char* text, ...)
 {
        char textbuffer[MAXBUF];
        va_list argsPtr;
@@ -704,7 +704,7 @@ void Channel::WriteAllExceptSender(User* user, bool serversource, char status, c
        this->WriteAllExceptSender(user, serversource, status, std::string(textbuffer));
 }
 
-void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList &except_list, char* text, ...)
+void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList &except_list, const char* text, ...)
 {
        char textbuffer[MAXBUF];
        va_list argsPtr;
index 2ba91b86708635376a4e37a1314c5486f0d19ba9..7649dbc9145530538e402e0edd07d71db625e0d3 100644 (file)
@@ -15,7 +15,7 @@
 #include "wildcard.h"
 #include "commands/cmd_modules.h"
 
-char* itab[] = {
+const char* itab[] = {
        "OnUserConnect", "OnUserQuit", "OnUserDisconnect", "OnUserJoin", "OnUserPart", "OnRehash", "OnServerRaw",
        "OnUserPreJoin", "OnUserPreKick", "OnUserKick", "OnOper", "OnInfo", "OnWhois", "OnUserPreInvite",
        "OnUserInvite", "OnUserPreMessage", "OnUserPreNotice", "OnUserPreNick", "OnUserMessage", "OnUserNotice", "OnMode",
index c31a3cea2cb8b101a522f6495f4354758151419e..a54623672f834269c4c4ed24278b5d020ac1ffea 100644 (file)
@@ -15,7 +15,7 @@
 #include "wildcard.h"
 #include "commands/cmd_who.h"
 
-static char *get_first_visible_channel(User *u)
+static const char *get_first_visible_channel(User *u)
 {
        UCListIter i = u->chans.begin();
        if (i != u->chans.end())
index 9f7a5988523c6699bc27d7099e36ed48e97128d6..fe02bc2bd462a33f29d1a22e3a72026fe75e5122 100644 (file)
@@ -160,7 +160,7 @@ void ServerConfig::Send005(User* user)
                user->WriteServ("005 %s %s", user->nick, line->c_str());
 }
 
-bool ServerConfig::CheckOnce(char* tag)
+bool ServerConfig::CheckOnce(const char* tag)
 {
        int count = ConfValueEnum(this->config_data, tag);
 
@@ -800,7 +800,7 @@ void ServerConfig::Read(bool bail, User* user, int pass)
        errstr.clear();
 
        /* These tags MUST occur and must ONLY occur once in the config file */
-       static char* Once[] = { "server", "admin", "files", "power", "options", NULL };
+       static const char* Once[] = { "server", "admin", "files", "power", "options", NULL };
 
        /* These tags can occur ONCE or not at all */
        InitialConfig Values[] = {
@@ -2124,12 +2124,7 @@ ValueItem::ValueItem(bool value)
        v = n.str();
 }
 
-ValueItem::ValueItem(char* value)
-{
-       v = value;
-}
-
-void ValueItem::Set(char* value)
+ValueItem::ValueItem(const char* value)
 {
        v = value;
 }
index d412b961cd373ad76fed689853d8758c50336d08..17aaa220dc18c9ed75938e27088649d99099e3ad 100644 (file)
@@ -385,7 +385,7 @@ std::string BufferedSocket::GetIP()
        return this->IP;
 }
 
-char* BufferedSocket::Read()
+const char* BufferedSocket::Read()
 {
        if (!Instance->SE->BoundsCheckFd(this))
                return NULL;
index 64b560d892a63752c050236177e32bf7cacbcbb9..6b5ecb0cc395ffd6c31be5598af9c93c43396d7d 100644 (file)
@@ -66,7 +66,7 @@ Module* Request::GetDest()
        return this->dest;
 }
 
-char* Request::Send()
+const char* Request::Send()
 {
        if (this->dest)
        {
@@ -150,7 +150,7 @@ int         Module::OnChangeLocalUserHost(User*, const std::string&) { return 0; }
 int            Module::OnChangeLocalUserGECOS(User*, const std::string&) { return 0; }
 int            Module::OnLocalTopicChange(User*, Channel*, const std::string&) { return 0; }
 void           Module::OnEvent(Event*) { return; }
-char*          Module::OnRequest(Request*) { return NULL; }
+const char*            Module::OnRequest(Request*) { return NULL; }
 int            Module::OnPassCompare(Extensible* ex, const std::string &password, const std::string &input, const std::string& hashtype) { return 0; }
 void           Module::OnGlobalOper(User*) { }
 void           Module::OnPostConnect(User*) { }
index d76fcb970586c7fdf3c3bc3752f862e4639477b0..382546196f4e85dc1011857e5ac5445e6178f1db 100644 (file)
@@ -59,7 +59,7 @@ public:
                        ServerInstance->Log(DEBUG,"module not found, load it!!");
        }
 
-       char* OnRequest(Request* req)
+       virtual const char* OnRequest(Request* req)
        {
                HTTPClientResponse* resp = (HTTPClientResponse*)req;
                if(!strcmp(resp->GetId(), HTTP_CLIENT_RESPONSE))
index 3a6f2afee692f557141bba4ac6a0d80d914549e6..8fa717f78ffad235ba10330874302aaaddf1d890 100644 (file)
@@ -762,7 +762,7 @@ class ModuleSQL : public Module
                return ++currid;
        }
 
-       char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                if(strcmp(SQLREQID, request->GetId()) == 0)
                {
index 8320c94087f46b4f04e63b040fbb6328cc68c19c..a77e1ac90c1372fba6ad11c8c9ef8242ee9922a0 100644 (file)
@@ -907,7 +907,7 @@ class ModulePgSQL : public Module
                ServerInstance->Timers->AddTimer(retimer);
        }
 
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                if(strcmp(SQLREQID, request->GetId()) == 0)
                {
index 2fd83c3d1afe1e1e533350b8903c53e39a3d81a1..e73abe0cc54952815205c7171c3990822563962c 100644 (file)
@@ -126,7 +126,7 @@ public:
                }
        }
        
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                if(strcmp(SQLRESID, request->GetId()) == 0)
                {
index 2c2d6ecf5e022b5f1403da05fde9ece603ef4e88..1e62eb9710ba6a3397876f1b067382592b3b9714 100644 (file)
@@ -613,7 +613,7 @@ class ModuleSQLite3 : public Module
                ReadConf();
        }
 
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                if(strcmp(SQLREQID, request->GetId()) == 0)
                {
index 799744c26da56e24edf2c7ef274e9128bf7f9348..7bb5ea1f190cba2e56af7f92db53d9b1d5cc851c 100644 (file)
@@ -223,7 +223,7 @@ class ModuleSQLLog : public Module
                ReadConfig();
        }
 
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                if(strcmp(SQLRESID, request->GetId()) == 0)
                {
index 02ce959f6baf928423fd0b0bf72818b6d4ca8607..22034303d26995ab6212750c8c05ec5e5bb64589 100644 (file)
@@ -133,7 +133,7 @@ public:
                }
        }
        
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                if (strcmp(SQLRESID, request->GetId()) == 0)
                {
index 872b3af8e9fdb34b0821ac014ff5fdde072b1e50..30fcf968e8d22b58611ae04c39308bedbde61733 100644 (file)
@@ -48,7 +48,7 @@ public:
        }       
 
 
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                if(strcmp(SQLUTILAU, request->GetId()) == 0)
                {
index e2bf9cfac9c36f1287fab10935bcac3a9898ad15..e1f4b8451982848b2ad8c87e6d8ea4a3bcda26e0 100644 (file)
@@ -297,7 +297,7 @@ class ModuleSSLGnuTLS : public Module
                output.append(" SSL=" + sslports);
        }
 
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                ISHRequest* ISR = (ISHRequest*)request;
                if (strcmp("IS_NAME", request->GetId()) == 0)
@@ -306,10 +306,10 @@ class ModuleSSLGnuTLS : public Module
                }
                else if (strcmp("IS_HOOK", request->GetId()) == 0)
                {
-                       char* ret = "OK";
+                       const char* ret = "OK";
                        try
                        {
-                               ret = ServerInstance->Config->AddIOHook((Module*)this, (BufferedSocket*)ISR->Sock) ? (char*)"OK" : NULL;
+                               ret = ServerInstance->Config->AddIOHook((Module*)this, (BufferedSocket*)ISR->Sock) ? "OK" : NULL;
                        }
                        catch (ModuleException &e)
                        {
@@ -319,15 +319,15 @@ class ModuleSSLGnuTLS : public Module
                }
                else if (strcmp("IS_UNHOOK", request->GetId()) == 0)
                {
-                       return ServerInstance->Config->DelIOHook((BufferedSocket*)ISR->Sock) ? (char*)"OK" : NULL;
+                       return ServerInstance->Config->DelIOHook((BufferedSocket*)ISR->Sock) ? "OK" : NULL;
                }
                else if (strcmp("IS_HSDONE", request->GetId()) == 0)
                {
                        if (ISR->Sock->GetFd() < 0)
-                               return (char*)"OK";
+                               return "OK";
 
                        issl_session* session = &sessions[ISR->Sock->GetFd()];
-                       return (session->status == ISSL_HANDSHAKING_READ || session->status == ISSL_HANDSHAKING_WRITE) ? NULL : (char*)"OK";
+                       return (session->status == ISSL_HANDSHAKING_READ || session->status == ISSL_HANDSHAKING_WRITE) ? NULL : "OK";
                }
                else if (strcmp("IS_ATTACH", request->GetId()) == 0)
                {
index faeb24410f580fde3f59b156f94997e1abd71f36..667b2a5cd3ab0665cd7cc0491527d24eacab8054 100644 (file)
@@ -343,7 +343,7 @@ class ModuleSSLOpenSSL : public Module
        }
 
 
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                ISHRequest* ISR = (ISHRequest*)request;
                if (strcmp("IS_NAME", request->GetId()) == 0)
@@ -352,10 +352,10 @@ class ModuleSSLOpenSSL : public Module
                }
                else if (strcmp("IS_HOOK", request->GetId()) == 0)
                {
-                       char* ret = "OK";
+                       const char* ret = "OK";
                        try
                        {
-                               ret = ServerInstance->Config->AddIOHook((Module*)this, (BufferedSocket*)ISR->Sock) ? (char*)"OK" : NULL;
+                               ret = ServerInstance->Config->AddIOHook((Module*)this, (BufferedSocket*)ISR->Sock) ? "OK" : NULL;
                        }
                        catch (ModuleException &e)
                        {
@@ -366,15 +366,15 @@ class ModuleSSLOpenSSL : public Module
                }
                else if (strcmp("IS_UNHOOK", request->GetId()) == 0)
                {
-                       return ServerInstance->Config->DelIOHook((BufferedSocket*)ISR->Sock) ? (char*)"OK" : NULL;
+                       return ServerInstance->Config->DelIOHook((BufferedSocket*)ISR->Sock) ? "OK" : NULL;
                }
                else if (strcmp("IS_HSDONE", request->GetId()) == 0)
                {
                        if (ISR->Sock->GetFd() < 0)
-                               return (char*)"OK";
+                               return "OK";
 
                        issl_session* session = &sessions[ISR->Sock->GetFd()];
-                       return (session->status == ISSL_HANDSHAKING) ? NULL : (char*)"OK";
+                       return (session->status == ISSL_HANDSHAKING) ? NULL : "OK";
                }
                else if (strcmp("IS_ATTACH", request->GetId()) == 0)
                {
index 2a110380c93f42890e3f1dfe7d6e2c35bc80f705..fb0a093ee92eccc94b3fc6e90580502dd6d18e16 100644 (file)
@@ -57,7 +57,7 @@ public:
                }
        }
        
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                if(strcmp(SQLRESID, request->GetId()) == 0)
                {
index 79a4e5b08e0e1a2463d8d628145039ec4313d5bb..83131fcb38164d46f487221d9f1a44bce108d6a6 100644 (file)
@@ -170,7 +170,7 @@ class ModuleZLib : public Module
 
 
        /* Handle BufferedSocketHook API requests */
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                ISHRequest* ISR = (ISHRequest*)request;
                if (strcmp("IS_NAME", request->GetId()) == 0)
index 36cb4a7115379c092ab684a886b968b9955ffbfb..6d30d617519e84f3b3205862f8bf5033f14358ba 100644 (file)
@@ -106,7 +106,7 @@ public:
                be->DoRehash();
        }
 
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                ListModeRequest* LM = (ListModeRequest*)request;
                if (strcmp("LM_CHECKLIST", request->GetId()) == 0)
index 065cf40556325fb24f0bac57000bdadb72d58224..4cb7b28480a230be515bcbf41c6c8c1691f28058 100644 (file)
@@ -103,7 +103,7 @@ class ModuleHTTPClient : public Module
        }
 
 
-       char* OnRequest(Request *req)
+       virtual const char* OnRequest(Request *req)
        {
                HTTPClientRequest *httpreq = (HTTPClientRequest *)req;
                if (!strcmp(httpreq->GetId(), HTTP_CLIENT_REQUEST))
@@ -298,7 +298,7 @@ bool HTTPSocket::OnConnected()
 bool HTTPSocket::OnDataReady()
 {
        Instance->Log(DEBUG,"HTTPSocket::OnDataReady() for %s", url.url.c_str());
-       char *sdata = this->Read();
+       const char *sdata = this->Read();
 
        if (!sdata)
                return false;
index efae473d99d11d3d2317dc5e275ac5653152abef..56a24119f254b7ebfb3e9a4d35815af88b80d923 100644 (file)
@@ -270,7 +270,7 @@ class HttpServerSocket : public BufferedSocket
 
        virtual bool OnDataReady()
        {
-               char* data = this->Read();
+               const char* data = this->Read();
 
                /* Check that the data read is a valid pointer and it has some content */
                if (!data || !*data)
@@ -478,7 +478,7 @@ class ModuleHttpServer : public Module
                ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
-       char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                claimed = true;
                HTTPDocument* doc = (HTTPDocument*)request->GetData();
index 63ddedcb87b51f020d4038838d12a72c81b5b293..50d13398bd102ebec540127dbd500913013330de 100644 (file)
@@ -225,7 +225,7 @@ class ModuleHttpStats : public Module
                this->changed = true;
        }
 
-       char* OnRequest(Request* request)
+       const char* OnRequest(Request* request)
        {
                return NULL;
        }
index a592f6cddc4ed2ba0dabac4486df69470a347f1c..503ceedd48dd0412c9e34f7caef4cd0612063fcd 100644 (file)
@@ -83,7 +83,7 @@ public:
                return 0;               
        }
 
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                ListModeRequest* LM = (ListModeRequest*)request;
                if (strcmp("LM_CHECKLIST", request->GetId()) == 0)
index b882583684757aa85c5a9d4bec9daafcf9ffc587..8774b43f94d21a1e4e043eb3bb6a703ddbf23b8a 100644 (file)
@@ -278,7 +278,7 @@ class ModuleMD5 : public Module
        }
 
        
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                HashRequest* MD5 = (HashRequest*)request;
 
index 328b9261230e8c8f619216bcd6467c27068a7a18..f65382ac109f627e1abb1b829cb69bf4ee51878a 100644 (file)
@@ -76,7 +76,7 @@ class ProxySocket : public EventHandler
        int rlen;
        bool done;
  public:
-       ProxySocket(InspIRCd *Server, User* u, const std::string &bindip, int port, char *cstr, int mclen, char *rstr, int mrlen)
+       ProxySocket(InspIRCd *Server, User* u, const std::string &bindip, int port, const char *cstr, int mclen, const char *rstr, int mrlen)
        {
                user = u;
                ServerInstance = Server;
index febfd88209bd17886ee09739ff8cfeee4b2319cf..b80e3d5bbb508c6cb76daa0e1ab751dd2806428b 100644 (file)
@@ -271,7 +271,7 @@ class ModuleSHA256 : public Module
        }
 
 
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                HashRequest* SHA = (HashRequest*)request;
                if (strcmp("KEY", request->GetId()) == 0)
index ddb781276efefa92508f93dc807894a33b5363e5..34b8e112d83f8f859fd4d5ec6b54ff1ff24fc76c 100644 (file)
@@ -258,7 +258,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
  */
 bool TreeSocket::OnDataReady()
 {
-       char* data = this->Read();
+       const char* data = this->Read();
        /* Check that the data read is a valid pointer and it has some content */
        if (data && *data)
        {
index b9e22c94903c1f79b891de20fcc18ff555a52f8c..81f2a6f27d8a3509cc8b4ab958ddd3871fe22271 100644 (file)
@@ -309,7 +309,7 @@ bool irc::sockets::MatchCIDR(const char* address, const char* cidr_mask, bool ma
  * It can only bind to IP addresses, if you wish to bind to hostnames
  * you should first resolve them using class 'Resolver'.
  */ 
-bool InspIRCd::BindSocket(int sockfd, int port, char* addr, bool dolisten)
+bool InspIRCd::BindSocket(int sockfd, int port, const char* addr, bool dolisten)
 {
        /* We allocate 2 of these, because sockaddr_in6 is larger than sockaddr (ugh, hax) */
        sockaddr* servaddr = new sockaddr[2];
@@ -318,7 +318,7 @@ bool InspIRCd::BindSocket(int sockfd, int port, char* addr, bool dolisten)
        int ret, size;
 
        if (*addr == '*')
-               *addr = 0;
+               addr = "";
 
 #ifdef IPV6
        if (*addr)
index 5ee84590b8b1b667733420927e6ad3fde743a958..ca9736f1e9e41879effb892cac2f7c85cdb82297 100644 (file)
@@ -271,7 +271,7 @@ unsigned int UserManager::LocalUserCount()
        return (this->local_users.size() - this->UnregisteredUserCount());
 }
 
-void UserManager::ServerNoticeAll(char* text, ...)
+void UserManager::ServerNoticeAll(const char* text, ...)
 {
        if (!text)
                return;
@@ -292,7 +292,7 @@ void UserManager::ServerNoticeAll(char* text, ...)
        }
 }
 
-void UserManager::ServerPrivmsgAll(char* text, ...)
+void UserManager::ServerPrivmsgAll(const char* text, ...)
 {
        if (!text)
                return;
index e81a3e2537cabf3727e0e0692b505cbd2d67f96d..404e1f5a95f8e672f20ab5cf1496cebf2a2cd90b 100644 (file)
@@ -1450,7 +1450,7 @@ bool User::ChangeIdent(const char* newident)
        return true;
 }
 
-void User::SendAll(const char* command, char* text, ...)
+void User::SendAll(const char* command, const char* text, ...)
 {
        char textbuffer[MAXBUF];
        char formatbuffer[MAXBUF];