summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-13 18:22:19 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-13 18:22:19 +0000
commitbfaf7e3b27981a5144faba6d17c6e29fac735dbb (patch)
treebdec845abe8e5fcf617657f1e2473aed1a8fdec6
parent0ec05c9bb346c1e20f9ab42d56eb17f03991b106 (diff)
Commit patch from danieldg that makes a ton of stuff const-safe for latest warn-happy trigger-happy gcc4 (thanks)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8922 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/channels.h6
-rw-r--r--include/configreader.h16
-rw-r--r--include/dynamic.h4
-rw-r--r--include/inspircd.h2
-rw-r--r--include/inspsocket.h2
-rw-r--r--include/modules.h4
-rw-r--r--include/usermanager.h4
-rw-r--r--include/users.h2
-rw-r--r--src/channels.cpp6
-rw-r--r--src/commands/cmd_modules.cpp2
-rw-r--r--src/commands/cmd_who.cpp2
-rw-r--r--src/configreader.cpp11
-rw-r--r--src/inspsocket.cpp2
-rw-r--r--src/modules.cpp4
-rw-r--r--src/modules/extra/m_httpclienttest.cpp2
-rw-r--r--src/modules/extra/m_mysql.cpp2
-rw-r--r--src/modules/extra/m_pgsql.cpp2
-rw-r--r--src/modules/extra/m_sqlauth.cpp2
-rw-r--r--src/modules/extra/m_sqlite3.cpp2
-rw-r--r--src/modules/extra/m_sqllog.cpp2
-rw-r--r--src/modules/extra/m_sqloper.cpp2
-rw-r--r--src/modules/extra/m_sqlutils.cpp2
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp12
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp12
-rw-r--r--src/modules/extra/m_testclient.cpp2
-rw-r--r--src/modules/extra/m_ziplink.cpp2
-rw-r--r--src/modules/m_banexception.cpp2
-rw-r--r--src/modules/m_http_client.cpp4
-rw-r--r--src/modules/m_httpd.cpp4
-rw-r--r--src/modules/m_httpd_stats.cpp2
-rw-r--r--src/modules/m_inviteexception.cpp2
-rw-r--r--src/modules/m_md5.cpp2
-rw-r--r--src/modules/m_proxyscan.cpp2
-rw-r--r--src/modules/m_sha256.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp2
-rw-r--r--src/socket.cpp4
-rw-r--r--src/usermanager.cpp4
-rw-r--r--src/users.cpp2
38 files changed, 68 insertions, 75 deletions
diff --git a/include/channels.h b/include/channels.h
index 3419e4c69..aa23d8816 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -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().
diff --git a/include/configreader.h b/include/configreader.h
index fb187048b..e74895e8b 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -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:
diff --git a/include/dynamic.h b/include/dynamic.h
index 4cf299c1f..727ed11e1 100644
--- a/include/dynamic.h
+++ b/include/dynamic.h
@@ -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;
}
diff --git a/include/inspircd.h b/include/inspircd.h
index d1e6f4005..5fd641c6b 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -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
diff --git a/include/inspsocket.h b/include/inspsocket.h
index 77c283f7f..d33cde5e8 100644
--- a/include/inspsocket.h
+++ b/include/inspsocket.h
@@ -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
diff --git a/include/modules.h b/include/modules.h
index 09b1f954b..6a08aaec6 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -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
diff --git a/include/usermanager.h b/include/usermanager.h
index 33b97129a..0fe418ba3 100644
--- a/include/usermanager.h
+++ b/include/usermanager.h
@@ -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'
diff --git a/include/users.h b/include/users.h
index 507fdf97b..a63dd7cc6 100644
--- a/include/users.h
+++ b/include/users.h
@@ -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
diff --git a/src/channels.cpp b/src/channels.cpp
index bb388e21e..2140a37ae 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -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;
diff --git a/src/commands/cmd_modules.cpp b/src/commands/cmd_modules.cpp
index 2ba91b867..7649dbc91 100644
--- a/src/commands/cmd_modules.cpp
+++ b/src/commands/cmd_modules.cpp
@@ -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",
diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp
index c31a3cea2..a54623672 100644
--- a/src/commands/cmd_who.cpp
+++ b/src/commands/cmd_who.cpp
@@ -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())
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 9f7a59885..fe02bc2bd 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -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;
}
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index d412b961c..17aaa220d 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -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;
diff --git a/src/modules.cpp b/src/modules.cpp
index 64b560d89..6b5ecb0cc 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -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*) { }
diff --git a/src/modules/extra/m_httpclienttest.cpp b/src/modules/extra/m_httpclienttest.cpp
index d76fcb970..382546196 100644
--- a/src/modules/extra/m_httpclienttest.cpp
+++ b/src/modules/extra/m_httpclienttest.cpp
@@ -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))
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index 3a6f2afee..8fa717f78 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -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)
{
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index 8320c9408..a77e1ac90 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -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)
{
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp
index 2fd83c3d1..e73abe0cc 100644
--- a/src/modules/extra/m_sqlauth.cpp
+++ b/src/modules/extra/m_sqlauth.cpp
@@ -126,7 +126,7 @@ public:
}
}
- virtual char* OnRequest(Request* request)
+ virtual const char* OnRequest(Request* request)
{
if(strcmp(SQLRESID, request->GetId()) == 0)
{
diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp
index 2c2d6ecf5..1e62eb971 100644
--- a/src/modules/extra/m_sqlite3.cpp
+++ b/src/modules/extra/m_sqlite3.cpp
@@ -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)
{
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp
index 799744c26..7bb5ea1f1 100644
--- a/src/modules/extra/m_sqllog.cpp
+++ b/src/modules/extra/m_sqllog.cpp
@@ -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)
{
diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp
index 02ce959f6..22034303d 100644
--- a/src/modules/extra/m_sqloper.cpp
+++ b/src/modules/extra/m_sqloper.cpp
@@ -133,7 +133,7 @@ public:
}
}
- virtual char* OnRequest(Request* request)
+ virtual const char* OnRequest(Request* request)
{
if (strcmp(SQLRESID, request->GetId()) == 0)
{
diff --git a/src/modules/extra/m_sqlutils.cpp b/src/modules/extra/m_sqlutils.cpp
index 872b3af8e..30fcf968e 100644
--- a/src/modules/extra/m_sqlutils.cpp
+++ b/src/modules/extra/m_sqlutils.cpp
@@ -48,7 +48,7 @@ public:
}
- virtual char* OnRequest(Request* request)
+ virtual const char* OnRequest(Request* request)
{
if(strcmp(SQLUTILAU, request->GetId()) == 0)
{
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index e2bf9cfac..e1f4b8451 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -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)
{
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index faeb24410..667b2a5cd 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -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)
{
diff --git a/src/modules/extra/m_testclient.cpp b/src/modules/extra/m_testclient.cpp
index 2a110380c..fb0a093ee 100644
--- a/src/modules/extra/m_testclient.cpp
+++ b/src/modules/extra/m_testclient.cpp
@@ -57,7 +57,7 @@ public:
}
}
- virtual char* OnRequest(Request* request)
+ virtual const char* OnRequest(Request* request)
{
if(strcmp(SQLRESID, request->GetId()) == 0)
{
diff --git a/src/modules/extra/m_ziplink.cpp b/src/modules/extra/m_ziplink.cpp
index 79a4e5b08..83131fcb3 100644
--- a/src/modules/extra/m_ziplink.cpp
+++ b/src/modules/extra/m_ziplink.cpp
@@ -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)
diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp
index 36cb4a711..6d30d6175 100644
--- a/src/modules/m_banexception.cpp
+++ b/src/modules/m_banexception.cpp
@@ -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)
diff --git a/src/modules/m_http_client.cpp b/src/modules/m_http_client.cpp
index 065cf4055..4cb7b2848 100644
--- a/src/modules/m_http_client.cpp
+++ b/src/modules/m_http_client.cpp
@@ -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;
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index efae473d9..56a24119f 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -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();
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index 63ddedcb8..50d13398b 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -225,7 +225,7 @@ class ModuleHttpStats : public Module
this->changed = true;
}
- char* OnRequest(Request* request)
+ const char* OnRequest(Request* request)
{
return NULL;
}
diff --git a/src/modules/m_inviteexception.cpp b/src/modules/m_inviteexception.cpp
index a592f6cdd..503ceedd4 100644
--- a/src/modules/m_inviteexception.cpp
+++ b/src/modules/m_inviteexception.cpp
@@ -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)
diff --git a/src/modules/m_md5.cpp b/src/modules/m_md5.cpp
index b88258368..8774b43f9 100644
--- a/src/modules/m_md5.cpp
+++ b/src/modules/m_md5.cpp
@@ -278,7 +278,7 @@ class ModuleMD5 : public Module
}
- virtual char* OnRequest(Request* request)
+ virtual const char* OnRequest(Request* request)
{
HashRequest* MD5 = (HashRequest*)request;
diff --git a/src/modules/m_proxyscan.cpp b/src/modules/m_proxyscan.cpp
index 328b92612..f65382ac1 100644
--- a/src/modules/m_proxyscan.cpp
+++ b/src/modules/m_proxyscan.cpp
@@ -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;
diff --git a/src/modules/m_sha256.cpp b/src/modules/m_sha256.cpp
index febfd8820..b80e3d5bb 100644
--- a/src/modules/m_sha256.cpp
+++ b/src/modules/m_sha256.cpp
@@ -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)
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index ddb781276..34b8e112d 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -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)
{
diff --git a/src/socket.cpp b/src/socket.cpp
index b9e22c949..81f2a6f27 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -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)
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index 5ee84590b..ca9736f1e 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -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;
diff --git a/src/users.cpp b/src/users.cpp
index e81a3e253..404e1f5a9 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -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];