summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-16 12:18:29 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-16 12:18:29 +0000
commit0757a4a495daabf661ac3b7ab79f0a5ee423abe8 (patch)
treed788af6cee694ae3b623bbfbbc31864de43b9d12
parent80d1296c31d8e16e71f7079144618a3eae6976d1 (diff)
mass tidyup, change A LOT of stuff to const char** which was char** (such as parameters to commands in handlers)
which makes the new lineparser work neater with no casts. This also removes tons of casts from other locations (all in all, ive added 2 casts and removed almost a hundred) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4403 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/command_parse.h4
-rw-r--r--include/commands.h2
-rw-r--r--include/commands/cmd_admin.h2
-rw-r--r--include/commands/cmd_away.h2
-rw-r--r--include/commands/cmd_commands.h2
-rw-r--r--include/commands/cmd_connect.h2
-rw-r--r--include/commands/cmd_die.h2
-rw-r--r--include/commands/cmd_eline.h2
-rw-r--r--include/commands/cmd_gline.h2
-rw-r--r--include/commands/cmd_info.h2
-rw-r--r--include/commands/cmd_invite.h2
-rw-r--r--include/commands/cmd_ison.h2
-rw-r--r--include/commands/cmd_join.h2
-rw-r--r--include/commands/cmd_kick.h2
-rw-r--r--include/commands/cmd_kill.h2
-rw-r--r--include/commands/cmd_kline.h2
-rw-r--r--include/commands/cmd_links.h2
-rw-r--r--include/commands/cmd_list.h2
-rw-r--r--include/commands/cmd_loadmodule.h2
-rw-r--r--include/commands/cmd_lusers.h2
-rw-r--r--include/commands/cmd_map.h2
-rw-r--r--include/commands/cmd_modules.h2
-rw-r--r--include/commands/cmd_motd.h2
-rw-r--r--include/commands/cmd_names.h2
-rw-r--r--include/commands/cmd_nick.h2
-rw-r--r--include/commands/cmd_notice.h2
-rw-r--r--include/commands/cmd_oper.h2
-rw-r--r--include/commands/cmd_part.h2
-rw-r--r--include/commands/cmd_pass.h2
-rw-r--r--include/commands/cmd_ping.h2
-rw-r--r--include/commands/cmd_pong.h2
-rw-r--r--include/commands/cmd_privmsg.h2
-rw-r--r--include/commands/cmd_qline.h2
-rw-r--r--include/commands/cmd_quit.h2
-rw-r--r--include/commands/cmd_rehash.h2
-rw-r--r--include/commands/cmd_restart.h2
-rw-r--r--include/commands/cmd_rules.h2
-rw-r--r--include/commands/cmd_server.h2
-rw-r--r--include/commands/cmd_squit.h2
-rw-r--r--include/commands/cmd_stats.h2
-rw-r--r--include/commands/cmd_summon.h2
-rw-r--r--include/commands/cmd_time.h2
-rw-r--r--include/commands/cmd_topic.h2
-rw-r--r--include/commands/cmd_trace.h2
-rw-r--r--include/commands/cmd_unloadmodule.h2
-rw-r--r--include/commands/cmd_user.h2
-rw-r--r--include/commands/cmd_userhost.h2
-rw-r--r--include/commands/cmd_users.h2
-rw-r--r--include/commands/cmd_version.h2
-rw-r--r--include/commands/cmd_wallops.h2
-rw-r--r--include/commands/cmd_who.h2
-rw-r--r--include/commands/cmd_whois.h2
-rw-r--r--include/commands/cmd_whowas.h2
-rw-r--r--include/commands/cmd_zline.h2
-rw-r--r--include/ctables.h2
-rw-r--r--include/mode.h4
-rw-r--r--include/modules.h6
-rw-r--r--include/users.h2
-rw-r--r--src/cmd_admin.cpp2
-rw-r--r--src/cmd_away.cpp2
-rw-r--r--src/cmd_commands.cpp2
-rw-r--r--src/cmd_connect.cpp2
-rw-r--r--src/cmd_die.cpp2
-rw-r--r--src/cmd_eline.cpp2
-rw-r--r--src/cmd_gline.cpp2
-rw-r--r--src/cmd_info.cpp2
-rw-r--r--src/cmd_invite.cpp2
-rw-r--r--src/cmd_ison.cpp2
-rw-r--r--src/cmd_join.cpp2
-rw-r--r--src/cmd_kick.cpp2
-rw-r--r--src/cmd_kill.cpp2
-rw-r--r--src/cmd_kline.cpp2
-rw-r--r--src/cmd_links.cpp2
-rw-r--r--src/cmd_list.cpp2
-rw-r--r--src/cmd_loadmodule.cpp2
-rw-r--r--src/cmd_lusers.cpp2
-rw-r--r--src/cmd_map.cpp2
-rw-r--r--src/cmd_modules.cpp2
-rw-r--r--src/cmd_motd.cpp2
-rw-r--r--src/cmd_names.cpp2
-rw-r--r--src/cmd_nick.cpp2
-rw-r--r--src/cmd_notice.cpp5
-rw-r--r--src/cmd_oper.cpp2
-rw-r--r--src/cmd_part.cpp2
-rw-r--r--src/cmd_pass.cpp2
-rw-r--r--src/cmd_ping.cpp2
-rw-r--r--src/cmd_pong.cpp2
-rw-r--r--src/cmd_privmsg.cpp5
-rw-r--r--src/cmd_qline.cpp2
-rw-r--r--src/cmd_quit.cpp9
-rw-r--r--src/cmd_rehash.cpp2
-rw-r--r--src/cmd_restart.cpp2
-rw-r--r--src/cmd_rules.cpp2
-rw-r--r--src/cmd_server.cpp2
-rw-r--r--src/cmd_squit.cpp2
-rw-r--r--src/cmd_stats.cpp7
-rw-r--r--src/cmd_summon.cpp2
-rw-r--r--src/cmd_time.cpp2
-rw-r--r--src/cmd_topic.cpp2
-rw-r--r--src/cmd_trace.cpp2
-rw-r--r--src/cmd_unloadmodule.cpp2
-rw-r--r--src/cmd_user.cpp2
-rw-r--r--src/cmd_userhost.cpp2
-rw-r--r--src/cmd_users.cpp2
-rw-r--r--src/cmd_version.cpp2
-rw-r--r--src/cmd_wallops.cpp2
-rw-r--r--src/cmd_who.cpp2
-rw-r--r--src/cmd_whois.cpp2
-rw-r--r--src/cmd_whowas.cpp2
-rw-r--r--src/cmd_zline.cpp2
-rw-r--r--src/command_parse.cpp17
-rw-r--r--src/commands.cpp2
-rw-r--r--src/mode.cpp6
-rw-r--r--src/modules.cpp6
-rw-r--r--src/modules/extra/m_sqllog.cpp2
-rw-r--r--src/modules/extra/m_sqloper.cpp2
-rw-r--r--src/modules/m_alias.cpp8
-rw-r--r--src/modules/m_blockamsg.cpp4
-rw-r--r--src/modules/m_cban.cpp2
-rw-r--r--src/modules/m_check.cpp2
-rw-r--r--src/modules/m_chghost.cpp4
-rw-r--r--src/modules/m_chgident.cpp2
-rw-r--r--src/modules/m_cloaking.cpp2
-rw-r--r--src/modules/m_conn_waitpong.cpp2
-rw-r--r--src/modules/m_devoice.cpp4
-rw-r--r--src/modules/m_globalload.cpp4
-rw-r--r--src/modules/m_globops.cpp2
-rw-r--r--src/modules/m_helpop.cpp29
-rw-r--r--src/modules/m_knock.cpp2
-rw-r--r--src/modules/m_messageflood.cpp4
-rw-r--r--src/modules/m_nicklock.cpp4
-rw-r--r--src/modules/m_operlog.cpp2
-rw-r--r--src/modules/m_opermd5.cpp2
-rw-r--r--src/modules/m_opermodes.cpp4
-rw-r--r--src/modules/m_opermotd.cpp2
-rw-r--r--src/modules/m_opersha256.cpp2
-rw-r--r--src/modules/m_operwho.cpp2
-rw-r--r--src/modules/m_park.cpp6
-rw-r--r--src/modules/m_randquote.cpp2
-rw-r--r--src/modules/m_remove.cpp2
-rw-r--r--src/modules/m_safelist.cpp4
-rw-r--r--src/modules/m_sajoin.cpp2
-rw-r--r--src/modules/m_samode.cpp2
-rw-r--r--src/modules/m_sanick.cpp2
-rw-r--r--src/modules/m_sapart.cpp2
-rw-r--r--src/modules/m_saquit.cpp2
-rw-r--r--src/modules/m_securelist.cpp2
-rw-r--r--src/modules/m_services.cpp2
-rw-r--r--src/modules/m_sethost.cpp2
-rw-r--r--src/modules/m_setident.cpp2
-rw-r--r--src/modules/m_setidle.cpp2
-rw-r--r--src/modules/m_setname.cpp2
-rw-r--r--src/modules/m_silence.cpp4
-rw-r--r--src/modules/m_spanningtree.cpp38
-rw-r--r--src/modules/m_spy.cpp4
-rw-r--r--src/modules/m_swhois.cpp2
-rw-r--r--src/modules/m_testcommand.cpp2
-rw-r--r--src/modules/m_timedbans.cpp10
-rw-r--r--src/modules/m_uninvite.cpp2
-rw-r--r--src/modules/m_userip.cpp2
-rw-r--r--src/modules/m_vhost.cpp2
-rw-r--r--src/modules/m_watch.cpp4
-rw-r--r--src/users.cpp6
163 files changed, 234 insertions, 248 deletions
diff --git a/include/command_parse.h b/include/command_parse.h
index 44f5946bc..15e0f1446 100644
--- a/include/command_parse.h
+++ b/include/command_parse.h
@@ -34,9 +34,9 @@ class CommandParser : public classbase
command_table cmdlist;
CommandParser();
- bool CallHandler(const std::string &commandname,char **parameters, int pcnt, userrec *user);
+ bool CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user);
bool IsValidCommand(const std::string &commandname, int pcnt, userrec * user);
- int LoopCall(command_t *fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins);
+ int LoopCall(command_t *fn, const char** parameters, int pcnt, userrec *u, int start, int end, int joins);
void ProcessBuffer(std::string &buffer,userrec *user);
bool RemoveCommands(const char* source);
bool CreateCommand(command_t *f);
diff --git a/include/commands.h b/include/commands.h
index 2aba8202f..e422b5c44 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -33,7 +33,7 @@ long duration(const char* str);
bool host_matches_everyone(const std::string &mask, userrec* user);
bool ip_matches_everyone(const std::string &ip, userrec* user);
bool nick_matches_everyone(const std::string &nick, userrec* user);
-int operstrcmp(char* data,char* input);
+int operstrcmp(const char* data,const char* input);
void split_chlist(userrec* user, userrec* dest, const std::string &cl);
/* XXX Serious WTFness XXX
diff --git a/include/commands/cmd_admin.h b/include/commands/cmd_admin.h
index cf355305c..ae577950e 100644
--- a/include/commands/cmd_admin.h
+++ b/include/commands/cmd_admin.h
@@ -25,7 +25,7 @@ class cmd_admin : public command_t
{
public:
cmd_admin () : command_t("ADMIN",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_away.h b/include/commands/cmd_away.h
index a4303a647..9cb15c9fa 100644
--- a/include/commands/cmd_away.h
+++ b/include/commands/cmd_away.h
@@ -32,7 +32,7 @@ class cmd_away : public command_t
{
public:
cmd_away () : command_t("AWAY",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_commands.h b/include/commands/cmd_commands.h
index f3877d2c1..17b72f07b 100644
--- a/include/commands/cmd_commands.h
+++ b/include/commands/cmd_commands.h
@@ -32,7 +32,7 @@ class cmd_commands : public command_t
{
public:
cmd_commands () : command_t("COMMANDS",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_connect.h b/include/commands/cmd_connect.h
index a65000da4..979ba4a6a 100644
--- a/include/commands/cmd_connect.h
+++ b/include/commands/cmd_connect.h
@@ -25,7 +25,7 @@ class cmd_connect : public command_t
{
public:
cmd_connect () : command_t("CONNECT",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_die.h b/include/commands/cmd_die.h
index 89bcf6a26..e95137ad8 100644
--- a/include/commands/cmd_die.h
+++ b/include/commands/cmd_die.h
@@ -32,7 +32,7 @@ class cmd_die : public command_t
{
public:
cmd_die () : command_t("DIE",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_eline.h b/include/commands/cmd_eline.h
index fcb9bcc55..a48b74a43 100644
--- a/include/commands/cmd_eline.h
+++ b/include/commands/cmd_eline.h
@@ -32,7 +32,7 @@ class cmd_eline : public command_t
{
public:
cmd_eline () : command_t("ELINE",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_gline.h b/include/commands/cmd_gline.h
index d996af694..d8016d733 100644
--- a/include/commands/cmd_gline.h
+++ b/include/commands/cmd_gline.h
@@ -32,7 +32,7 @@ class cmd_gline : public command_t
{
public:
cmd_gline () : command_t("GLINE",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_info.h b/include/commands/cmd_info.h
index f0223e5e4..122395c44 100644
--- a/include/commands/cmd_info.h
+++ b/include/commands/cmd_info.h
@@ -32,7 +32,7 @@ class cmd_info : public command_t
{
public:
cmd_info () : command_t("INFO",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_invite.h b/include/commands/cmd_invite.h
index 4fe745bad..4150c8cc8 100644
--- a/include/commands/cmd_invite.h
+++ b/include/commands/cmd_invite.h
@@ -32,7 +32,7 @@ class cmd_invite : public command_t
{
public:
cmd_invite () : command_t("INVITE",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_ison.h b/include/commands/cmd_ison.h
index 2e66e2261..5dd28ab75 100644
--- a/include/commands/cmd_ison.h
+++ b/include/commands/cmd_ison.h
@@ -32,7 +32,7 @@ class cmd_ison : public command_t
{
public:
cmd_ison () : command_t("ISON",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_join.h b/include/commands/cmd_join.h
index e8c9e8eec..c7b4a3b18 100644
--- a/include/commands/cmd_join.h
+++ b/include/commands/cmd_join.h
@@ -32,7 +32,7 @@ class cmd_join : public command_t
{
public:
cmd_join () : command_t("JOIN",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_kick.h b/include/commands/cmd_kick.h
index c23c2aedd..6fb470329 100644
--- a/include/commands/cmd_kick.h
+++ b/include/commands/cmd_kick.h
@@ -32,7 +32,7 @@ class cmd_kick : public command_t
{
public:
cmd_kick () : command_t("KICK",0,2) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_kill.h b/include/commands/cmd_kill.h
index 2fdf39e52..a8e879166 100644
--- a/include/commands/cmd_kill.h
+++ b/include/commands/cmd_kill.h
@@ -32,7 +32,7 @@ class cmd_kill : public command_t
{
public:
cmd_kill () : command_t("KILL",'o',2) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_kline.h b/include/commands/cmd_kline.h
index c0e4bf8c7..6f96f80dd 100644
--- a/include/commands/cmd_kline.h
+++ b/include/commands/cmd_kline.h
@@ -32,7 +32,7 @@ class cmd_kline : public command_t
{
public:
cmd_kline () : command_t("KLINE",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_links.h b/include/commands/cmd_links.h
index 1d710a071..ef465fe37 100644
--- a/include/commands/cmd_links.h
+++ b/include/commands/cmd_links.h
@@ -32,7 +32,7 @@ class cmd_links : public command_t
{
public:
cmd_links () : command_t("LINKS",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_list.h b/include/commands/cmd_list.h
index bc6a88749..29e61d17a 100644
--- a/include/commands/cmd_list.h
+++ b/include/commands/cmd_list.h
@@ -32,7 +32,7 @@ class cmd_list : public command_t
{
public:
cmd_list () : command_t("LIST",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_loadmodule.h b/include/commands/cmd_loadmodule.h
index d9ee5ad4b..bea19ae5f 100644
--- a/include/commands/cmd_loadmodule.h
+++ b/include/commands/cmd_loadmodule.h
@@ -32,7 +32,7 @@ class cmd_loadmodule : public command_t
{
public:
cmd_loadmodule () : command_t("LOADMODULE",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_lusers.h b/include/commands/cmd_lusers.h
index 79800bbce..156635af0 100644
--- a/include/commands/cmd_lusers.h
+++ b/include/commands/cmd_lusers.h
@@ -32,7 +32,7 @@ class cmd_lusers : public command_t
{
public:
cmd_lusers () : command_t("LUSERS",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_map.h b/include/commands/cmd_map.h
index 682407c38..c560198df 100644
--- a/include/commands/cmd_map.h
+++ b/include/commands/cmd_map.h
@@ -32,7 +32,7 @@ class cmd_map : public command_t
{
public:
cmd_map () : command_t("MAP",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_modules.h b/include/commands/cmd_modules.h
index 23a702247..a1684e507 100644
--- a/include/commands/cmd_modules.h
+++ b/include/commands/cmd_modules.h
@@ -32,7 +32,7 @@ class cmd_modules : public command_t
{
public:
cmd_modules () : command_t("MODULES",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_motd.h b/include/commands/cmd_motd.h
index 78ceaad2c..ca065f97e 100644
--- a/include/commands/cmd_motd.h
+++ b/include/commands/cmd_motd.h
@@ -32,7 +32,7 @@ class cmd_motd : public command_t
{
public:
cmd_motd () : command_t("MOTD",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_names.h b/include/commands/cmd_names.h
index 0a70b4d21..7c1b126f1 100644
--- a/include/commands/cmd_names.h
+++ b/include/commands/cmd_names.h
@@ -32,7 +32,7 @@ class cmd_names : public command_t
{
public:
cmd_names () : command_t("NAMES",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_nick.h b/include/commands/cmd_nick.h
index b0f39a1a4..53f7f5a87 100644
--- a/include/commands/cmd_nick.h
+++ b/include/commands/cmd_nick.h
@@ -32,7 +32,7 @@ class cmd_nick : public command_t
{
public:
cmd_nick () : command_t("NICK",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_notice.h b/include/commands/cmd_notice.h
index b392a0c3a..358e405d6 100644
--- a/include/commands/cmd_notice.h
+++ b/include/commands/cmd_notice.h
@@ -32,7 +32,7 @@ class cmd_notice : public command_t
{
public:
cmd_notice () : command_t("NOTICE",0,2) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_oper.h b/include/commands/cmd_oper.h
index e71ca07a6..8e731b579 100644
--- a/include/commands/cmd_oper.h
+++ b/include/commands/cmd_oper.h
@@ -34,7 +34,7 @@ class cmd_oper : public command_t
{
public:
cmd_oper () : command_t("OPER",0,2) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_part.h b/include/commands/cmd_part.h
index 994244d56..e23f106fc 100644
--- a/include/commands/cmd_part.h
+++ b/include/commands/cmd_part.h
@@ -32,7 +32,7 @@ class cmd_part : public command_t
{
public:
cmd_part () : command_t("PART",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_pass.h b/include/commands/cmd_pass.h
index 03c5ca7fc..c79686220 100644
--- a/include/commands/cmd_pass.h
+++ b/include/commands/cmd_pass.h
@@ -32,7 +32,7 @@ class cmd_pass : public command_t
{
public:
cmd_pass () : command_t("PASS",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_ping.h b/include/commands/cmd_ping.h
index fdde057d3..8b9d88f1c 100644
--- a/include/commands/cmd_ping.h
+++ b/include/commands/cmd_ping.h
@@ -32,7 +32,7 @@ class cmd_ping : public command_t
{
public:
cmd_ping () : command_t("PING",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_pong.h b/include/commands/cmd_pong.h
index 381d16253..ec517bdad 100644
--- a/include/commands/cmd_pong.h
+++ b/include/commands/cmd_pong.h
@@ -32,7 +32,7 @@ class cmd_pong : public command_t
{
public:
cmd_pong () : command_t("PONG",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_privmsg.h b/include/commands/cmd_privmsg.h
index 2af58b9d0..a35a5cdec 100644
--- a/include/commands/cmd_privmsg.h
+++ b/include/commands/cmd_privmsg.h
@@ -32,7 +32,7 @@ class cmd_privmsg : public command_t
{
public:
cmd_privmsg () : command_t("PRIVMSG",0,2) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_qline.h b/include/commands/cmd_qline.h
index 5b209133e..f563b9cbb 100644
--- a/include/commands/cmd_qline.h
+++ b/include/commands/cmd_qline.h
@@ -32,7 +32,7 @@ class cmd_qline : public command_t
{
public:
cmd_qline () : command_t("QLINE",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_quit.h b/include/commands/cmd_quit.h
index f60c4b6b0..5229aaa50 100644
--- a/include/commands/cmd_quit.h
+++ b/include/commands/cmd_quit.h
@@ -32,7 +32,7 @@ class cmd_quit : public command_t
{
public:
cmd_quit () : command_t("QUIT",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_rehash.h b/include/commands/cmd_rehash.h
index f56ab126c..e98eed301 100644
--- a/include/commands/cmd_rehash.h
+++ b/include/commands/cmd_rehash.h
@@ -32,7 +32,7 @@ class cmd_rehash : public command_t
{
public:
cmd_rehash () : command_t("REHASH",'o',0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_restart.h b/include/commands/cmd_restart.h
index 622552a79..e77476919 100644
--- a/include/commands/cmd_restart.h
+++ b/include/commands/cmd_restart.h
@@ -32,7 +32,7 @@ class cmd_restart : public command_t
{
public:
cmd_restart () : command_t("RESTART",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_rules.h b/include/commands/cmd_rules.h
index 40d40ff6c..60567e24d 100644
--- a/include/commands/cmd_rules.h
+++ b/include/commands/cmd_rules.h
@@ -32,7 +32,7 @@ class cmd_rules : public command_t
{
public:
cmd_rules () : command_t("RULES",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_server.h b/include/commands/cmd_server.h
index d3822c9d8..05e1d57d0 100644
--- a/include/commands/cmd_server.h
+++ b/include/commands/cmd_server.h
@@ -32,7 +32,7 @@ class cmd_server : public command_t
{
public:
cmd_server () : command_t("SERVER",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_squit.h b/include/commands/cmd_squit.h
index 18fb2e926..e8a63b452 100644
--- a/include/commands/cmd_squit.h
+++ b/include/commands/cmd_squit.h
@@ -32,7 +32,7 @@ class cmd_squit : public command_t
{
public:
cmd_squit () : command_t("SQUIT",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_stats.h b/include/commands/cmd_stats.h
index 06924fb13..eeb3a0013 100644
--- a/include/commands/cmd_stats.h
+++ b/include/commands/cmd_stats.h
@@ -32,7 +32,7 @@ class cmd_stats : public command_t
{
public:
cmd_stats () : command_t("STATS",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_summon.h b/include/commands/cmd_summon.h
index cfa70800b..467b1f71a 100644
--- a/include/commands/cmd_summon.h
+++ b/include/commands/cmd_summon.h
@@ -32,7 +32,7 @@ class cmd_summon : public command_t
{
public:
cmd_summon () : command_t("SUMMON",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_time.h b/include/commands/cmd_time.h
index b45b62bfe..2c4f55ba0 100644
--- a/include/commands/cmd_time.h
+++ b/include/commands/cmd_time.h
@@ -32,7 +32,7 @@ class cmd_time : public command_t
{
public:
cmd_time () : command_t("TIME",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_topic.h b/include/commands/cmd_topic.h
index e467a8b03..e0cd7e3de 100644
--- a/include/commands/cmd_topic.h
+++ b/include/commands/cmd_topic.h
@@ -32,7 +32,7 @@ class cmd_topic : public command_t
{
public:
cmd_topic () : command_t("TOPIC",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_trace.h b/include/commands/cmd_trace.h
index 9c8d9ceed..50669498a 100644
--- a/include/commands/cmd_trace.h
+++ b/include/commands/cmd_trace.h
@@ -32,7 +32,7 @@ class cmd_trace : public command_t
{
public:
cmd_trace () : command_t("TRACE",'o',0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_unloadmodule.h b/include/commands/cmd_unloadmodule.h
index 8789d83eb..1eef989b1 100644
--- a/include/commands/cmd_unloadmodule.h
+++ b/include/commands/cmd_unloadmodule.h
@@ -32,7 +32,7 @@ class cmd_unloadmodule : public command_t
{
public:
cmd_unloadmodule () : command_t("UNLOADMODULE",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_user.h b/include/commands/cmd_user.h
index f4c9919a9..59a8f4c35 100644
--- a/include/commands/cmd_user.h
+++ b/include/commands/cmd_user.h
@@ -32,7 +32,7 @@ class cmd_user : public command_t
{
public:
cmd_user () : command_t("USER",0,4) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_userhost.h b/include/commands/cmd_userhost.h
index b319bb782..8fd75e63d 100644
--- a/include/commands/cmd_userhost.h
+++ b/include/commands/cmd_userhost.h
@@ -32,7 +32,7 @@ class cmd_userhost : public command_t
{
public:
cmd_userhost () : command_t("USERHOST",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_users.h b/include/commands/cmd_users.h
index d7ebcdec9..a5e92f1a2 100644
--- a/include/commands/cmd_users.h
+++ b/include/commands/cmd_users.h
@@ -32,7 +32,7 @@ class cmd_users : public command_t
{
public:
cmd_users () : command_t("USERS",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_version.h b/include/commands/cmd_version.h
index 0fcd79543..e80dc3565 100644
--- a/include/commands/cmd_version.h
+++ b/include/commands/cmd_version.h
@@ -32,7 +32,7 @@ class cmd_version : public command_t
{
public:
cmd_version () : command_t("VERSION",0,0) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_wallops.h b/include/commands/cmd_wallops.h
index b32783ef6..3f98aa02d 100644
--- a/include/commands/cmd_wallops.h
+++ b/include/commands/cmd_wallops.h
@@ -32,7 +32,7 @@ class cmd_wallops : public command_t
{
public:
cmd_wallops () : command_t("WALLOPS",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_who.h b/include/commands/cmd_who.h
index 0487c43dc..cbf59ad37 100644
--- a/include/commands/cmd_who.h
+++ b/include/commands/cmd_who.h
@@ -32,7 +32,7 @@ class cmd_who : public command_t
{
public:
cmd_who () : command_t("WHO",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_whois.h b/include/commands/cmd_whois.h
index 75abc6053..b129b3480 100644
--- a/include/commands/cmd_whois.h
+++ b/include/commands/cmd_whois.h
@@ -34,7 +34,7 @@ class cmd_whois : public command_t
{
public:
cmd_whois () : command_t("WHOIS",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_whowas.h b/include/commands/cmd_whowas.h
index 09269a5f1..50838b17c 100644
--- a/include/commands/cmd_whowas.h
+++ b/include/commands/cmd_whowas.h
@@ -32,7 +32,7 @@ class cmd_whowas : public command_t
{
public:
cmd_whowas () : command_t("WHOWAS",0,1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/commands/cmd_zline.h b/include/commands/cmd_zline.h
index 438e33665..3ab32e080 100644
--- a/include/commands/cmd_zline.h
+++ b/include/commands/cmd_zline.h
@@ -32,7 +32,7 @@ class cmd_zline : public command_t
{
public:
cmd_zline () : command_t("ZLINE",'o',1) { }
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/ctables.h b/include/ctables.h
index 0acf0d02a..e6ae76015 100644
--- a/include/ctables.h
+++ b/include/ctables.h
@@ -55,7 +55,7 @@ class command_t : public Extensible
source = "<core>";
}
- virtual void Handle(char** parameters, int pcnt, userrec* user) = 0;
+ virtual void Handle(const char** parameters, int pcnt, userrec* user) = 0;
virtual ~command_t() {}
};
diff --git a/include/mode.h b/include/mode.h
index 386116a24..76389c6a4 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -343,7 +343,7 @@ class ModeParser : public classbase
* and *user->server == NULL.
* @param servermode True if a server is setting the mode.
*/
- void Process(char **parameters, int pcnt, userrec *user, bool servermode);
+ void Process(const char** parameters, int pcnt, userrec *user, bool servermode);
};
/**
@@ -360,7 +360,7 @@ class cmd_mode : public command_t
/**
* Handle MODE
*/
- void Handle(char **parameters, int pcnt, userrec *user);
+ void Handle(const char** parameters, int pcnt, userrec *user);
};
#endif
diff --git a/include/modules.h b/include/modules.h
index f7b8bc53a..18a4a6dbb 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -967,7 +967,7 @@ class Module : public Extensible
* @param validated True if the command has passed all checks, e.g. it is recognised, has enough parameters, the user has permission to execute it, etc.
* @return 1 to block the command, 0 to allow
*/
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated);
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated);
/** Called to check if a user who is connecting can now be allowed to register
* If any modules return false for this function, the user is held in the waiting
@@ -1474,7 +1474,7 @@ class Server : public Extensible
* your server in an unstable state!
*/
- virtual void SendMode(char **parameters, int pcnt, userrec *user);
+ virtual void SendMode(const char **parameters, int pcnt, userrec *user);
/** Sends to all users matching a mode mask
* You must specify one or more usermodes as the first parameter. These can be RFC specified modes such as +i,
@@ -1550,7 +1550,7 @@ class Server : public Extensible
* used for privilage checks, etc.
* @return True if the command exists
*/
- virtual bool CallCommandHandler(const std::string &commandname, char** parameters, int pcnt, userrec* user);
+ virtual bool CallCommandHandler(const std::string &commandname, const char** parameters, int pcnt, userrec* user);
/** This function returns true if the commandname exists, pcnt is equal to or greater than the number
* of paramters the command requires, the user specified is allowed to execute the command, AND
diff --git a/include/users.h b/include/users.h
index 30fa937fb..23f7a7e5d 100644
--- a/include/users.h
+++ b/include/users.h
@@ -423,7 +423,7 @@ void AddWhoWas(userrec* u);
void MaintainWhoWas(time_t TIME);
void AddClient(int socket, int port, bool iscached, in_addr ip4);
void FullConnectUser(userrec* user, CullList* Goners);
-userrec* ReHashNick(char* Old, char* New);
+userrec* ReHashNick(const char* Old, const char* New);
void force_nickchange(userrec* user,const char* newnick);
/* Configuration callbacks */
diff --git a/src/cmd_admin.cpp b/src/cmd_admin.cpp
index 8ca05a523..48b237e64 100644
--- a/src/cmd_admin.cpp
+++ b/src/cmd_admin.cpp
@@ -22,7 +22,7 @@
extern ServerConfig* Config;
-void cmd_admin::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_admin::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"256 %s :Administrative info for %s",user->nick,Config->ServerName);
WriteServ(user->fd,"257 %s :Name - %s",user->nick,Config->AdminName);
diff --git a/src/cmd_away.cpp b/src/cmd_away.cpp
index f882904c2..86e5559f3 100644
--- a/src/cmd_away.cpp
+++ b/src/cmd_away.cpp
@@ -30,7 +30,7 @@ extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
-void cmd_away::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_away::Handle (const char** parameters, int pcnt, userrec *user)
{
if (pcnt)
{
diff --git a/src/cmd_commands.cpp b/src/cmd_commands.cpp
index 57f142207..257413c11 100644
--- a/src/cmd_commands.cpp
+++ b/src/cmd_commands.cpp
@@ -22,7 +22,7 @@
extern InspIRCd* ServerInstance;
-void cmd_commands::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_commands::Handle (const char** parameters, int pcnt, userrec *user)
{
for (nspace::hash_map<std::string,command_t*>::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
{
diff --git a/src/cmd_connect.cpp b/src/cmd_connect.cpp
index 978478e3a..affeb9317 100644
--- a/src/cmd_connect.cpp
+++ b/src/cmd_connect.cpp
@@ -22,7 +22,7 @@
/*
* This is handled by the server linking module, if necessary. Do not remove this stub.
*/
-void cmd_connect::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_connect::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd, "NOTICE %s :You are a nub. Load a linking module.", user->nick);
}
diff --git a/src/cmd_die.cpp b/src/cmd_die.cpp
index 494eba0c5..3e3d63f3e 100644
--- a/src/cmd_die.cpp
+++ b/src/cmd_die.cpp
@@ -26,7 +26,7 @@
extern ServerConfig* Config;
extern std::vector<userrec*> all_opers;
-void cmd_die::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_die::Handle (const char** parameters, int pcnt, userrec *user)
{
if (!strcmp(parameters[0],Config->diepass))
{
diff --git a/src/cmd_eline.cpp b/src/cmd_eline.cpp
index cf5e13414..70d07236a 100644
--- a/src/cmd_eline.cpp
+++ b/src/cmd_eline.cpp
@@ -29,7 +29,7 @@ extern ServerConfig* Config;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
-void cmd_eline::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_eline::Handle (const char** parameters, int pcnt, userrec *user)
{
if (pcnt >= 3)
{
diff --git a/src/cmd_gline.cpp b/src/cmd_gline.cpp
index 2733178cf..201683541 100644
--- a/src/cmd_gline.cpp
+++ b/src/cmd_gline.cpp
@@ -29,7 +29,7 @@ extern int MODCOUNT;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
-void cmd_gline::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_gline::Handle (const char** parameters, int pcnt, userrec *user)
{
if (pcnt >= 3)
{
diff --git a/src/cmd_info.cpp b/src/cmd_info.cpp
index 963d6a1b1..d33b678a4 100644
--- a/src/cmd_info.cpp
+++ b/src/cmd_info.cpp
@@ -26,7 +26,7 @@ extern int MODCOUNT;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
-void cmd_info::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_info::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd, "371 %s :. o O (The Inspire Internet Relay Chat Server) O o .", user->nick);
WriteServ(user->fd, "371 %s : ", user->nick);
diff --git a/src/cmd_invite.cpp b/src/cmd_invite.cpp
index 0eaafe211..f452f215b 100644
--- a/src/cmd_invite.cpp
+++ b/src/cmd_invite.cpp
@@ -28,7 +28,7 @@ extern int MODCOUNT;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
-void cmd_invite::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_invite::Handle (const char** parameters, int pcnt, userrec *user)
{
int MOD_RESULT = 0;
diff --git a/src/cmd_ison.cpp b/src/cmd_ison.cpp
index 4c840c748..099d6acd6 100644
--- a/src/cmd_ison.cpp
+++ b/src/cmd_ison.cpp
@@ -21,7 +21,7 @@
#include "helperfuncs.h"
#include "commands/cmd_ison.h"
-void cmd_ison::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_ison::Handle (const char** parameters, int pcnt, userrec *user)
{
char retbuf[MAXBUF];
userrec *u;
diff --git a/src/cmd_join.cpp b/src/cmd_join.cpp
index 17b14fdff..fc63283e5 100644
--- a/src/cmd_join.cpp
+++ b/src/cmd_join.cpp
@@ -22,7 +22,7 @@
extern InspIRCd* ServerInstance;
-void cmd_join::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_join::Handle (const char** parameters, int pcnt, userrec *user)
{
if (ServerInstance->Parser->LoopCall(this, parameters, pcnt, user, 0, 0, 1))
return;
diff --git a/src/cmd_kick.cpp b/src/cmd_kick.cpp
index 29e0860e0..4743f47df 100644
--- a/src/cmd_kick.cpp
+++ b/src/cmd_kick.cpp
@@ -20,7 +20,7 @@
#include "helperfuncs.h"
#include "commands/cmd_kick.h"
-void cmd_kick::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_kick::Handle (const char** parameters, int pcnt, userrec *user)
{
char reason[MAXKICK];
chanrec* c = FindChan(parameters[0]);
diff --git a/src/cmd_kill.cpp b/src/cmd_kill.cpp
index cbdf5b9be..ba9ac9dc7 100644
--- a/src/cmd_kill.cpp
+++ b/src/cmd_kill.cpp
@@ -30,7 +30,7 @@ extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
extern user_hash clientlist;
-void cmd_kill::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_kill::Handle (const char** parameters, int pcnt, userrec *user)
{
userrec *u = Find(parameters[0]);
char killreason[MAXBUF];
diff --git a/src/cmd_kline.cpp b/src/cmd_kline.cpp
index e84112959..89f051f5e 100644
--- a/src/cmd_kline.cpp
+++ b/src/cmd_kline.cpp
@@ -37,7 +37,7 @@ extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
extern time_t TIME;
-void cmd_kline::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_kline::Handle (const char** parameters, int pcnt, userrec *user)
{
if (pcnt >= 3)
{
diff --git a/src/cmd_links.cpp b/src/cmd_links.cpp
index bf672a714..57df3b4fb 100644
--- a/src/cmd_links.cpp
+++ b/src/cmd_links.cpp
@@ -24,7 +24,7 @@
extern ServerConfig* Config;
-void cmd_links::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_links::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"364 %s %s %s :0 %s",user->nick,Config->ServerName,Config->ServerName,Config->ServerDesc);
WriteServ(user->fd,"365 %s * :End of /LINKS list.",user->nick);
diff --git a/src/cmd_list.cpp b/src/cmd_list.cpp
index 211c88d1f..9d1a96fc9 100644
--- a/src/cmd_list.cpp
+++ b/src/cmd_list.cpp
@@ -22,7 +22,7 @@
extern chan_hash chanlist;
-void cmd_list::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_list::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"321 %s Channel :Users Name",user->nick);
for (chan_hash::const_iterator i = chanlist.begin(); i != chanlist.end(); i++)
diff --git a/src/cmd_loadmodule.cpp b/src/cmd_loadmodule.cpp
index e06817624..5b91746ab 100644
--- a/src/cmd_loadmodule.cpp
+++ b/src/cmd_loadmodule.cpp
@@ -22,7 +22,7 @@
extern InspIRCd* ServerInstance;
-void cmd_loadmodule::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_loadmodule::Handle (const char** parameters, int pcnt, userrec *user)
{
if (ServerInstance->LoadModule(parameters[0]))
{
diff --git a/src/cmd_lusers.cpp b/src/cmd_lusers.cpp
index 0405145e2..3b1decea3 100644
--- a/src/cmd_lusers.cpp
+++ b/src/cmd_lusers.cpp
@@ -19,7 +19,7 @@
#include "helperfuncs.h"
#include "commands/cmd_lusers.h"
-void cmd_lusers::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_lusers::Handle (const char** parameters, int pcnt, userrec *user)
{
// this lusers command shows one server at all times because
// a protocol module must override it to show those stats.
diff --git a/src/cmd_map.cpp b/src/cmd_map.cpp
index dcf598662..9807d0d77 100644
--- a/src/cmd_map.cpp
+++ b/src/cmd_map.cpp
@@ -23,7 +23,7 @@
extern ServerConfig* Config;
-void cmd_map::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_map::Handle (const char** parameters, int pcnt, userrec *user)
{
// as with /LUSERS this does nothing without a linking
// module to override its behaviour and display something
diff --git a/src/cmd_modules.cpp b/src/cmd_modules.cpp
index 60ba1fa25..dbf7efee4 100644
--- a/src/cmd_modules.cpp
+++ b/src/cmd_modules.cpp
@@ -51,7 +51,7 @@ char* itab[] = {
"OnOperCompare", "OnChannelDelete", "OnPostOper", "OnSyncOtherMetaData", "OnSetAway", "OnCancelAway", NULL
};
-void cmd_modules::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_modules::Handle (const char** parameters, int pcnt, userrec *user)
{
for (unsigned int i = 0; i < Config->module_names.size(); i++)
{
diff --git a/src/cmd_motd.cpp b/src/cmd_motd.cpp
index 2efd8d55b..a8cee2727 100644
--- a/src/cmd_motd.cpp
+++ b/src/cmd_motd.cpp
@@ -19,7 +19,7 @@
#include "helperfuncs.h"
#include "commands/cmd_motd.h"
-void cmd_motd::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_motd::Handle (const char** parameters, int pcnt, userrec *user)
{
ShowMOTD(user);
}
diff --git a/src/cmd_names.cpp b/src/cmd_names.cpp
index 7857449f2..d25e7c5e6 100644
--- a/src/cmd_names.cpp
+++ b/src/cmd_names.cpp
@@ -22,7 +22,7 @@
extern InspIRCd* ServerInstance;
-void cmd_names::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_names::Handle (const char** parameters, int pcnt, userrec *user)
{
chanrec* c;
diff --git a/src/cmd_nick.cpp b/src/cmd_nick.cpp
index 3eeb37663..bfaddda23 100644
--- a/src/cmd_nick.cpp
+++ b/src/cmd_nick.cpp
@@ -35,7 +35,7 @@ extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
extern time_t TIME;
-void cmd_nick::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_nick::Handle (const char** parameters, int pcnt, userrec *user)
{
char oldnick[NICKMAX];
diff --git a/src/cmd_notice.cpp b/src/cmd_notice.cpp
index 5c745f74a..434594df9 100644
--- a/src/cmd_notice.cpp
+++ b/src/cmd_notice.cpp
@@ -36,7 +36,7 @@ extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
extern time_t TIME;
-void cmd_notice::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_notice::Handle (const char** parameters, int pcnt, userrec *user)
{
userrec *dest;
chanrec *chan;
@@ -48,8 +48,7 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user)
if ((parameters[0][0] == '$') && ((*user->oper) || (is_uline(user->server))))
{
// notice to server mask
- char* servermask = parameters[0];
- servermask++;
+ const char* servermask = parameters[0] + 1;
if (match(Config->ServerName,servermask))
{
NoticeAll(user, true, "%s",parameters[1]);
diff --git a/src/cmd_oper.cpp b/src/cmd_oper.cpp
index 4f0a31d01..e05736eda 100644
--- a/src/cmd_oper.cpp
+++ b/src/cmd_oper.cpp
@@ -59,7 +59,7 @@ bool OneOfMatches(const char* host, const char* hostlist)
return false;
}
-void cmd_oper::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_oper::Handle (const char** parameters, int pcnt, userrec *user)
{
char LoginName[MAXBUF];
char Password[MAXBUF];
diff --git a/src/cmd_part.cpp b/src/cmd_part.cpp
index 70a5511eb..44c158205 100644
--- a/src/cmd_part.cpp
+++ b/src/cmd_part.cpp
@@ -22,7 +22,7 @@
extern InspIRCd* ServerInstance;
-void cmd_part::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_part::Handle (const char** parameters, int pcnt, userrec *user)
{
if (pcnt > 1)
{
diff --git a/src/cmd_pass.cpp b/src/cmd_pass.cpp
index 76d5f08cb..0f3665222 100644
--- a/src/cmd_pass.cpp
+++ b/src/cmd_pass.cpp
@@ -19,7 +19,7 @@
#include "helperfuncs.h"
#include "commands/cmd_pass.h"
-void cmd_pass::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_pass::Handle (const char** parameters, int pcnt, userrec *user)
{
// Check to make sure they havnt registered -- Fix by FCS
if (user->registered == 7)
diff --git a/src/cmd_ping.cpp b/src/cmd_ping.cpp
index 01d0e021b..b30a9d0fa 100644
--- a/src/cmd_ping.cpp
+++ b/src/cmd_ping.cpp
@@ -23,7 +23,7 @@
extern ServerConfig* Config;
-void cmd_ping::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_ping::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"PONG %s :%s",Config->ServerName,parameters[0]);
}
diff --git a/src/cmd_pong.cpp b/src/cmd_pong.cpp
index 76acfbccd..cf86b5b53 100644
--- a/src/cmd_pong.cpp
+++ b/src/cmd_pong.cpp
@@ -19,7 +19,7 @@
#include "commands/cmd_pong.h"
#include "helperfuncs.h"
-void cmd_pong::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_pong::Handle (const char** parameters, int pcnt, userrec *user)
{
// set the user as alive so they survive to next ping
user->lastping = 1;
diff --git a/src/cmd_privmsg.cpp b/src/cmd_privmsg.cpp
index 81e5ee016..e74495bb6 100644
--- a/src/cmd_privmsg.cpp
+++ b/src/cmd_privmsg.cpp
@@ -33,7 +33,7 @@ extern ModuleList modules;
extern FactoryList factory;
extern time_t TIME;
-void cmd_privmsg::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user)
{
userrec *dest;
chanrec *chan;
@@ -45,8 +45,7 @@ void cmd_privmsg::Handle (char **parameters, int pcnt, userrec *user)
if ((parameters[0][0] == '$') && ((*user->oper) || (is_uline(user->server))))
{
// notice to server mask
- char* servermask = parameters[0];
- servermask++;
+ const char* servermask = parameters[0] + 1;
if (match(Config->ServerName,servermask))
{
ServerPrivmsgAll("%s",parameters[1]);
diff --git a/src/cmd_qline.cpp b/src/cmd_qline.cpp
index 895efba83..6f7570485 100644
--- a/src/cmd_qline.cpp
+++ b/src/cmd_qline.cpp
@@ -28,7 +28,7 @@ extern int MODCOUNT;
extern ModuleList modules;
extern FactoryList factory;
-void cmd_qline::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_qline::Handle (const char** parameters, int pcnt, userrec *user)
{
if (pcnt >= 3)
{
diff --git a/src/cmd_quit.cpp b/src/cmd_quit.cpp
index 7c0b602e9..5011d230e 100644
--- a/src/cmd_quit.cpp
+++ b/src/cmd_quit.cpp
@@ -47,10 +47,10 @@ extern chan_hash chanlist;
extern std::vector<userrec*> local_users;
extern userrec* fd_ref_table[MAX_DESCRIPTORS];
-void cmd_quit::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_quit::Handle (const char** parameters, int pcnt, userrec *user)
{
user_hash::iterator iter = clientlist.find(user->nick);
- char* reason;
+ char reason[MAXBUF];
if (user->registered == 7)
{
@@ -60,10 +60,7 @@ void cmd_quit::Handle (char **parameters, int pcnt, userrec *user)
if (*parameters[0] == ':')
parameters[0]++;
- reason = parameters[0];
-
- if (strlen(reason) > MAXQUIT)
- reason[MAXQUIT-1] = 0;
+ strlcpy(reason, parameters[0],MAXQUIT-1);
/* We should only prefix the quit for a local user. Remote users have
* already been prefixed, where neccessary, by the upstream server.
diff --git a/src/cmd_rehash.cpp b/src/cmd_rehash.cpp
index 5ea852ba8..f01a9b04e 100644
--- a/src/cmd_rehash.cpp
+++ b/src/cmd_rehash.cpp
@@ -27,7 +27,7 @@ extern int MODCOUNT;
extern ModuleList modules;
extern FactoryList factory;
-void cmd_rehash::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"382 %s %s :Rehashing",user->nick,CleanFilename(CONFIG_FILE));
std::string parameter = "";
diff --git a/src/cmd_restart.cpp b/src/cmd_restart.cpp
index 80f607890..2b8a7fc3f 100644
--- a/src/cmd_restart.cpp
+++ b/src/cmd_restart.cpp
@@ -22,7 +22,7 @@
extern ServerConfig* Config;;
-void cmd_restart::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_restart::Handle (const char** parameters, int pcnt, userrec *user)
{
char *argv[32];
log(DEFAULT,"Restart: %s",user->nick);
diff --git a/src/cmd_rules.cpp b/src/cmd_rules.cpp
index 4cb1e3c0b..85e2eadf1 100644
--- a/src/cmd_rules.cpp
+++ b/src/cmd_rules.cpp
@@ -19,7 +19,7 @@
#include "helperfuncs.h"
#include "commands/cmd_rules.h"
-void cmd_rules::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_rules::Handle (const char** parameters, int pcnt, userrec *user)
{
ShowRULES(user);
}
diff --git a/src/cmd_server.cpp b/src/cmd_server.cpp
index 4ab00b52e..367c8febc 100644
--- a/src/cmd_server.cpp
+++ b/src/cmd_server.cpp
@@ -19,7 +19,7 @@
#include "helperfuncs.h"
#include "commands/cmd_server.h"
-void cmd_server::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_server::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"666 %s :You cannot identify as a server, you are a USER. IRC Operators informed.",user->nick);
WriteOpers("*** WARNING: %s attempted to issue a SERVER command and is registered as a user!",user->nick);
diff --git a/src/cmd_squit.cpp b/src/cmd_squit.cpp
index 7b080a0ec..08dee1188 100644
--- a/src/cmd_squit.cpp
+++ b/src/cmd_squit.cpp
@@ -22,7 +22,7 @@
/*
* This is handled by the server linking module, if necessary. Do not remove this stub.
*/
-void cmd_squit::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_squit::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd, "NOTICE %s :You are a nub. Load a linking module.", user->nick);
}
diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp
index 20c573f87..124bdb7a3 100644
--- a/src/cmd_stats.cpp
+++ b/src/cmd_stats.cpp
@@ -52,17 +52,12 @@ extern time_t TIME;
extern user_hash clientlist;
extern chan_hash chanlist;
-void cmd_stats::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_stats::Handle (const char** parameters, int pcnt, userrec *user)
{
if (pcnt != 1)
{
return;
}
- if (parameters[0][1])
- {
- /* make the stats query 1 character long */
- parameters[0][1] = 0;
- }
if ((*Config->OperOnlyStats) && (strchr(Config->OperOnlyStats,*parameters[0])) && (!*user->oper))
{
diff --git a/src/cmd_summon.cpp b/src/cmd_summon.cpp
index ff1659263..c323e2e3c 100644
--- a/src/cmd_summon.cpp
+++ b/src/cmd_summon.cpp
@@ -19,7 +19,7 @@
#include "helperfuncs.h"
#include "commands/cmd_summon.h"
-void cmd_summon::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_summon::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"445 %s :SUMMON has been disabled (depreciated command)",user->nick);
}
diff --git a/src/cmd_time.cpp b/src/cmd_time.cpp
index 3eaa99ec7..53d06ddca 100644
--- a/src/cmd_time.cpp
+++ b/src/cmd_time.cpp
@@ -24,7 +24,7 @@
extern ServerConfig* Config;
extern time_t TIME;
-void cmd_time::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_time::Handle (const char** parameters, int pcnt, userrec *user)
{
struct tm* timeinfo;
diff --git a/src/cmd_topic.cpp b/src/cmd_topic.cpp
index 191cecb0f..4bfa608b4 100644
--- a/src/cmd_topic.cpp
+++ b/src/cmd_topic.cpp
@@ -29,7 +29,7 @@ extern time_t TIME;
extern ModuleList modules;
extern FactoryList factory;
-void cmd_topic::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_topic::Handle (const char** parameters, int pcnt, userrec *user)
{
chanrec* Ptr;
diff --git a/src/cmd_trace.cpp b/src/cmd_trace.cpp
index 1af42c2e6..c2c298d29 100644
--- a/src/cmd_trace.cpp
+++ b/src/cmd_trace.cpp
@@ -21,7 +21,7 @@
extern user_hash clientlist;
-void cmd_trace::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_trace::Handle (const char** parameters, int pcnt, userrec *user)
{
for (user_hash::iterator i = clientlist.begin(); i != clientlist.end(); i++)
{
diff --git a/src/cmd_unloadmodule.cpp b/src/cmd_unloadmodule.cpp
index 35db537d0..44701d63d 100644
--- a/src/cmd_unloadmodule.cpp
+++ b/src/cmd_unloadmodule.cpp
@@ -22,7 +22,7 @@
extern InspIRCd* ServerInstance;
-void cmd_unloadmodule::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_unloadmodule::Handle (const char** parameters, int pcnt, userrec *user)
{
if (ServerInstance->UnloadModule(parameters[0]))
{
diff --git a/src/cmd_user.cpp b/src/cmd_user.cpp
index 97466bce4..f493f76c1 100644
--- a/src/cmd_user.cpp
+++ b/src/cmd_user.cpp
@@ -27,7 +27,7 @@ extern int MODCOUNT;
extern ModuleList modules;
extern FactoryList factory;
-void cmd_user::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_user::Handle (const char** parameters, int pcnt, userrec *user)
{
if (user->registered < 3)
{
diff --git a/src/cmd_userhost.cpp b/src/cmd_userhost.cpp
index 266d5369c..977c67667 100644
--- a/src/cmd_userhost.cpp
+++ b/src/cmd_userhost.cpp
@@ -20,7 +20,7 @@
#include "helperfuncs.h"
#include "commands/cmd_userhost.h"
-void cmd_userhost::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_userhost::Handle (const char** parameters, int pcnt, userrec *user)
{
char Return[MAXBUF],junk[MAXBUF];
snprintf(Return,MAXBUF,"302 %s :",user->nick);
diff --git a/src/cmd_users.cpp b/src/cmd_users.cpp
index 8286a675f..3d8b7519d 100644
--- a/src/cmd_users.cpp
+++ b/src/cmd_users.cpp
@@ -19,7 +19,7 @@
#include "helperfuncs.h"
#include "commands/cmd_users.h"
-void cmd_users::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_users::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"445 %s :USERS has been disabled (depreciated command)",user->nick);
}
diff --git a/src/cmd_version.cpp b/src/cmd_version.cpp
index 5718f8e8a..b82809a5a 100644
--- a/src/cmd_version.cpp
+++ b/src/cmd_version.cpp
@@ -24,7 +24,7 @@
extern ServerConfig* Config;
extern InspIRCd* ServerInstance;
-void cmd_version::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_version::Handle (const char** parameters, int pcnt, userrec *user)
{
std::stringstream out(Config->data005);
std::string token = "";
diff --git a/src/cmd_wallops.cpp b/src/cmd_wallops.cpp
index f7d385341..453ce911d 100644
--- a/src/cmd_wallops.cpp
+++ b/src/cmd_wallops.cpp
@@ -25,7 +25,7 @@ extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
extern ServerConfig* Config;
-void cmd_wallops::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_wallops::Handle (const char** parameters, int pcnt, userrec *user)
{
WriteWallOps(user,false,"%s",parameters[0]);
FOREACH_MOD(I_OnWallops,OnWallops(user,parameters[0]));
diff --git a/src/cmd_who.cpp b/src/cmd_who.cpp
index 4697add4e..96add6afc 100644
--- a/src/cmd_who.cpp
+++ b/src/cmd_who.cpp
@@ -27,7 +27,7 @@ extern user_hash clientlist;
extern chan_hash chanlist;
extern std::vector<userrec*> all_opers;
-void cmd_who::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
{
chanrec* Ptr = NULL;
char tmp[10];
diff --git a/src/cmd_whois.cpp b/src/cmd_whois.cpp
index 138589237..e44757e6d 100644
--- a/src/cmd_whois.cpp
+++ b/src/cmd_whois.cpp
@@ -101,7 +101,7 @@ void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long i
}
}
-void cmd_whois::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_whois::Handle (const char** parameters, int pcnt, userrec *user)
{
userrec *dest;
if (ServerInstance->Parser->LoopCall(this,parameters,pcnt,user,0,pcnt-1,0))
diff --git a/src/cmd_whowas.cpp b/src/cmd_whowas.cpp
index d584d51cb..9d93517fe 100644
--- a/src/cmd_whowas.cpp
+++ b/src/cmd_whowas.cpp
@@ -24,7 +24,7 @@
extern ServerConfig* Config;
extern whowas_users whowas;
-void cmd_whowas::Handle (char **parameters, int pcnt, userrec* user)
+void cmd_whowas::Handle (const char** parameters, int pcnt, userrec* user)
{
whowas_users::iterator i = whowas.find(parameters[0]);
diff --git a/src/cmd_zline.cpp b/src/cmd_zline.cpp
index 607d81bfb..637ff71a9 100644
--- a/src/cmd_zline.cpp
+++ b/src/cmd_zline.cpp
@@ -29,7 +29,7 @@ extern int MODCOUNT;
extern ModuleList modules;
extern FactoryList factory;
-void cmd_zline::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_zline::Handle (const char** parameters, int pcnt, userrec *user)
{
if (pcnt >= 3)
{
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 19729d9e4..f27467f34 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -98,7 +98,7 @@ cmd_pass* command_pass;
* before the actual list as well. This code is used by many functions which
* can function as "one to list" (see the RFC) */
-int CommandParser::LoopCall(command_t* fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins)
+int CommandParser::LoopCall(command_t* fn, const char** parameters, int pcnt, userrec *u, int start, int end, int joins)
{
/* Copy of the parameter list, because like strltok, we make a bit of
* a mess of the parameter string we're given, and we want to keep this
@@ -110,13 +110,13 @@ int CommandParser::LoopCall(command_t* fn, char **parameters, int pcnt, userrec
char *param;
/* Parameter list, we can have up to 32 of these
*/
- char *pars[32];
+ const char *pars[32];
/* Seperated items, e.g. holds the #one and #two from "#one,#two"
*/
- char *sep_items[32];
+ const char *sep_items[32];
/* Seperated keys, holds the 'two' and 'three' of "two,three"
*/
- char *sep_keys[32];
+ const char *sep_keys[32];
/* Misc. counters, the total values hold the total number of
* seperated items in sep_items (total) and the total number of
* seperated items in sep_keys (total2)
@@ -316,7 +316,7 @@ bool CommandParser::IsValidCommand(const std::string &commandname, int pcnt, use
// calls a handler function for a command
-bool CommandParser::CallHandler(const std::string &commandname,char **parameters, int pcnt, userrec *user)
+bool CommandParser::CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user)
{
nspace::hash_map<std::string,command_t*>::iterator n = cmdlist.find(commandname);
@@ -347,15 +347,14 @@ bool CommandParser::CallHandler(const std::string &commandname,char **parameters
void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
{
- char *command_p[127];
+ const char *command_p[127];
int items = 0;
-
std::string para[127];
irc::tokenstream tokens(cmd);
std::string xcommand = tokens.GetToken();
- while ((para[items] = tokens.GetToken()) != "")
- command_p[items] = (char*)para[items++].c_str();
+ while (((para[items] = tokens.GetToken()) != "") && (items < 127))
+ command_p[items] = para[items++].c_str();
int MOD_RESULT = 0;
FOREACH_RESULT(I_OnPreCommand,OnPreCommand(xcommand,command_p,items,user,false));
diff --git a/src/commands.cpp b/src/commands.cpp
index e4fc939ea..a10842ab1 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -127,7 +127,7 @@ bool is_uline(const char* server)
return (find(Config->ulines.begin(),Config->ulines.end(),server) != Config->ulines.end());
}
-int operstrcmp(char* data,char* input)
+int operstrcmp(const char* data,const char* input)
{
int MOD_RESULT = 0;
FOREACH_RESULT(I_OnOperCompare,OnOperCompare(data,input))
diff --git a/src/mode.cpp b/src/mode.cpp
index 791d0f897..86b0024c0 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -255,7 +255,7 @@ void ModeParser::DisplayCurrentModes(userrec *user, userrec* targetuser, chanrec
return;
}
-void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool servermode)
+void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool servermode)
{
std::string target = parameters[0];
ModeType type = MODETYPE_USER;
@@ -314,7 +314,7 @@ void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool server
*/
if ((type== MODETYPE_CHANNEL) && (pcnt == 2))
{
- char* mode = parameters[1];
+ const char* mode = parameters[1];
if (*mode == '+')
mode++;
@@ -482,7 +482,7 @@ void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool server
}
-void cmd_mode::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_mode::Handle (const char** parameters, int pcnt, userrec *user)
{
if (!user)
return;
diff --git a/src/modules.cpp b/src/modules.cpp
index 7214a9673..ca533b523 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -152,7 +152,7 @@ int Module::OnKill(userrec* source, userrec* dest, const std::string &reason) {
void Module::OnLoadModule(Module* mod,const std::string &name) { };
void Module::OnUnloadModule(Module* mod,const std::string &name) { };
void Module::OnBackgroundTimer(time_t curtime) { };
-int Module::OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated) { return 0; };
+int Module::OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated) { return 0; };
bool Module::OnCheckReady(userrec* user) { return true; };
void Module::OnUserRegister(userrec* user) { };
int Module::OnUserPreKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason) { return 0; };
@@ -423,7 +423,7 @@ bool Server::IsUlined(const std::string &server)
return is_uline(server.c_str());
}
-bool Server::CallCommandHandler(const std::string &commandname, char** parameters, int pcnt, userrec* user)
+bool Server::CallCommandHandler(const std::string &commandname, const char** parameters, int pcnt, userrec* user)
{
return ServerInstance->Parser->CallHandler(commandname,parameters,pcnt,user);
}
@@ -447,7 +447,7 @@ void Server::AddCommand(command_t *f)
}
}
-void Server::SendMode(char **parameters, int pcnt, userrec *user)
+void Server::SendMode(const char** parameters, int pcnt, userrec *user)
{
//ServerInstance->ModeGrok->ServerMode(parameters,pcnt,user);
}
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp
index 84dd8fa43..7fd68ab75 100644
--- a/src/modules/extra/m_sqllog.cpp
+++ b/src/modules/extra/m_sqllog.cpp
@@ -227,7 +227,7 @@ class ModuleSQLLog : public Module
return 0;
}
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
if ((command == "GLINE") || (command == "KLINE") || (command == "ELINE") || (command == "ZLINE"))
{
diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp
index f39be098c..acbdef60a 100644
--- a/src/modules/extra/m_sqloper.cpp
+++ b/src/modules/extra/m_sqloper.cpp
@@ -82,7 +82,7 @@ class ModuleSQLOper : public Module
List[I_OnRehash] = List[I_OnPreCommand] = 1;
}
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
if ((command == "OPER") && (validated))
{
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index d218777af..869bc6a1f 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -87,7 +87,7 @@ class ModuleAlias : public Module
return Version(1,0,0,1,VF_VENDOR);
}
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
userrec *u = NULL;
irc::string c = command.c_str();
@@ -137,9 +137,9 @@ class ModuleAlias : public Module
stuff >> cmd;
stuff >> target;
- char* para[2];
- para[0] = (char*)target.c_str();
- para[1] = (char*)n.c_str();
+ const char* para[2];
+ para[0] = target.c_str();
+ para[1] = n.c_str();
Srv->CallCommandHandler(cmd,para,2,user);
return 1;
diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp
index 24b3deb85..0ddaddd34 100644
--- a/src/modules/m_blockamsg.cpp
+++ b/src/modules/m_blockamsg.cpp
@@ -94,7 +94,7 @@ public:
DELETE(Conf);
}
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
// Don't do anything with unregistered users, or remote ones.
if(!user || (user->registered != 7) || !IS_LOCAL(user))
@@ -117,7 +117,7 @@ public:
if(*parameters[0] != '#')
targets--;
- for(char* c = parameters[0]; *c; c++)
+ for(const char* c = parameters[0]; *c; c++)
if((*c == ',') && *(c+1) && (*(c+1) == '#'))
targets++;
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index 10e71df7b..57bb9490a 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -68,7 +68,7 @@ class cmd_cban : public command_t
this->Srv = Me;
}
- void Handle(char **parameters, int pcnt, userrec *user)
+ void Handle(const char** parameters, int pcnt, userrec *user)
{
/* syntax: CBAN #channel time :reason goes here */
/* 'time' is a human-readable timestring, like 2d3h2s. */
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 5e7b4847c..7f5dc793d 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -39,7 +39,7 @@ class cmd_check : public command_t
this->source = "m_check.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
userrec *targuser;
chanrec *targchan;
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp
index 1a547f548..8113cc19d 100644
--- a/src/modules/m_chghost.cpp
+++ b/src/modules/m_chghost.cpp
@@ -35,9 +35,9 @@ class cmd_chghost : public command_t
this->source = "m_chghost.so";
}
- void Handle(char **parameters, int pcnt, userrec *user)
+ void Handle(const char** parameters, int pcnt, userrec *user)
{
- char * x = parameters[1];
+ const char * x = parameters[1];
for (; *x; x++)
{
diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp
index 1f7c28dda..f2c48cb52 100644
--- a/src/modules/m_chgident.cpp
+++ b/src/modules/m_chgident.cpp
@@ -16,7 +16,7 @@ class cmd_chgident : public command_t
Srv = serv;
}
- void Handle(char **parameters, int pcnt, userrec *user)
+ void Handle(const char** parameters, int pcnt, userrec *user)
{
userrec* dest = Srv->FindNick(std::string(parameters[0]));
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index 99898259a..ab13708ea 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -432,7 +432,7 @@ class ModuleCloaking : public Module
// SAMODE in unreal. Note that to the user it will appear as if they set
// the mode on themselves.
- char* modes[2]; // only two parameters
+ const char* modes[2]; // only two parameters
modes[0] = user->nick; // first parameter is the nick
modes[1] = "+x"; // second parameter is the mode
Srv->SendMode(modes,2,user); // send these, forming the command "MODE <nick> +x"
diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp
index 353bd763f..a97fe8d3f 100644
--- a/src/modules/m_conn_waitpong.cpp
+++ b/src/modules/m_conn_waitpong.cpp
@@ -76,7 +76,7 @@ class ModuleWaitPong : public Module
user->Extend("waitpong_pingstr", pingrpl);
}
- virtual int OnPreCommand(const std::string &command, char** parameters, int pcnt, userrec* user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec* user, bool validated)
{
if(command == "PONG")
{
diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp
index 12257d520..214de5783 100644
--- a/src/modules/m_devoice.cpp
+++ b/src/modules/m_devoice.cpp
@@ -38,7 +38,7 @@ class cmd_devoice : public command_t
this->source = "m_devoice.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
/*
* NOTE: DO NOT CODE LIKE THIS!!! This has no checks and can send
@@ -46,7 +46,7 @@ class cmd_devoice : public command_t
*
* - I'm not aware what checking I need, so for now... be supreme evil.
*/
- char* modes[3];
+ const char* modes[3];
modes[0] = parameters[0];
modes[1] = "-v";
modes[2] = user->nick;
diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp
index 1cb14ba83..229a77256 100644
--- a/src/modules/m_globalload.cpp
+++ b/src/modules/m_globalload.cpp
@@ -35,7 +35,7 @@ class cmd_gloadmodule : public command_t
this->source = "m_globalload.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
if (ServerInstance->LoadModule(parameters[0]))
{
@@ -57,7 +57,7 @@ class cmd_gunloadmodule : public command_t
this->source = "m_globalload.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
if (ServerInstance->UnloadModule(parameters[0]))
{
diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp
index add0306a7..6d00d5889 100644
--- a/src/modules/m_globops.cpp
+++ b/src/modules/m_globops.cpp
@@ -37,7 +37,7 @@ class cmd_globops : public command_t
this->source = "m_globops.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
std::string line = "*** GLOBOPS - From " + std::string(user->nick) + ": ";
for (int i = 0; i < pcnt; i++)
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index 9c21201d8..c1457765d 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -25,8 +25,8 @@ using namespace std;
static ConfigReader *helpop;
static Server *Srv;
-bool do_helpop(char**, int, userrec*);
-void sendtohelpop(userrec*, int, char**);
+bool do_helpop(const char**, int, userrec*);
+void sendtohelpop(userrec*, int, const char**);
/* $ModDesc: /helpop Command, Works like Unreal helpop */
@@ -66,7 +66,7 @@ class cmd_helpop : public command_t
this->source = "m_helpop.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
char a[MAXBUF];
std::string output = " ";
@@ -80,12 +80,12 @@ class cmd_helpop : public command_t
return;
}
- if (parameters[0][0] == '!')
+ if (*parameters[0] == '!')
{
// Force send to all +h users
sendtohelpop(user, pcnt, parameters);
}
- else if (parameters[0][0] == '?')
+ else if (*parameters[0] == '?')
{
// Force to the helpop system with no forward if not found.
if (do_helpop(parameters, pcnt, user) == false)
@@ -127,25 +127,22 @@ class cmd_helpop : public command_t
};
-bool do_helpop(char **parameters, int pcnt, userrec *src)
+bool do_helpop(const char** parameters, int pcnt, userrec *src)
{
- char *search;
+ char search[MAXBUF];
std::string output = " "; // a fix bought to you by brain :p
char a[MAXBUF];
int nlines = 0;
if (!pcnt)
{
- search = "start";
+ strcpy(search,"start");
}
else
{
- search = parameters[0];
- }
-
- if (search[0] == '?')
- {
- search++;
+ if (*parameters[0] == '?')
+ parameters[0]++;
+ strlcpy(search,parameters[0],MAXBUF);
}
strlower(search);
@@ -165,9 +162,9 @@ bool do_helpop(char **parameters, int pcnt, userrec *src)
-void sendtohelpop(userrec *src, int pcnt, char **params)
+void sendtohelpop(userrec *src, int pcnt, const char **params)
{
- char* first = params[0];
+ const char* first = params[0];
if (*first == '!')
{
first++;
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp
index 8b2b74dba..b4e535d9b 100644
--- a/src/modules/m_knock.cpp
+++ b/src/modules/m_knock.cpp
@@ -35,7 +35,7 @@ class cmd_knock : public command_t
this->source = "m_knock.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
chanrec* c = Srv->FindChannel(parameters[0]);
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index 8f310f4b2..52fed00f0 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -195,12 +195,12 @@ class ModuleMsgFlood : public Module
f->clear(user);
if (f->ban)
{
- char* parameters[3];
+ const char* parameters[3];
parameters[0] = dest->name;
parameters[1] = "+b";
parameters[2] = user->MakeWildHost();
Srv->SendMode(parameters,3,user);
- std::deque<std::string> n;
+ std::deque<std::string> n;
/* Propogate the ban to other servers.
* We dont know what protocol we may be using,
* so this event is picked up by our protocol
diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp
index 47c15e792..df8a551dd 100644
--- a/src/modules/m_nicklock.cpp
+++ b/src/modules/m_nicklock.cpp
@@ -37,7 +37,7 @@ class cmd_nicklock : public command_t
this->source = "m_nicklock.so";
}
- void Handle(char **parameters, int pcnt, userrec *user)
+ void Handle(const char** parameters, int pcnt, userrec *user)
{
userrec* source = Srv->FindNick(std::string(parameters[0]));
irc::string server;
@@ -72,7 +72,7 @@ class cmd_nickunlock : public command_t
this->source = "m_nickunlock.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
userrec* source = Srv->FindNick(std::string(parameters[0]));
if (source)
diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp
index 559b01285..8188c49b1 100644
--- a/src/modules/m_operlog.cpp
+++ b/src/modules/m_operlog.cpp
@@ -49,7 +49,7 @@ class ModuleOperLog : public Module
List[I_OnPreCommand] = List[I_On005Numeric] = 1;
}
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
/* If the command doesnt appear to be valid, we dont want to mess with it. */
if (!validated)
diff --git a/src/modules/m_opermd5.cpp b/src/modules/m_opermd5.cpp
index 8a5e4b3c7..4116ccb37 100644
--- a/src/modules/m_opermd5.cpp
+++ b/src/modules/m_opermd5.cpp
@@ -276,7 +276,7 @@ class cmd_mkpasswd : public command_t
this->source = "m_opermd5.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
char buffer[MAXBUF];
GenHash(parameters[0],buffer);
diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp
index 4cf360e2a..1181a32c3 100644
--- a/src/modules/m_opermodes.cpp
+++ b/src/modules/m_opermodes.cpp
@@ -76,9 +76,9 @@ class ModuleModesOnOper : public Module
ThisOpersModes = "+" + ThisOpersModes;
if (ThisOpersModes != "")
{
- char* modes[2];
+ const char* modes[2];
modes[0] = user->nick;
- modes[1] = (char*)ThisOpersModes.c_str();
+ modes[1] = ThisOpersModes.c_str();
Srv->SendMode(modes,2,user);
}
break;
diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp
index 5f9dafa65..b4a85e889 100644
--- a/src/modules/m_opermotd.cpp
+++ b/src/modules/m_opermotd.cpp
@@ -51,7 +51,7 @@ class cmd_opermotd : public command_t
this->source = "m_opermotd.so";
}
- void Handle (char** parameters, int pcnt, userrec* user)
+ void Handle (const char** parameters, int pcnt, userrec* user)
{
ShowOperMOTD(user);
}
diff --git a/src/modules/m_opersha256.cpp b/src/modules/m_opersha256.cpp
index 0a18c32af..ecade64ad 100644
--- a/src/modules/m_opersha256.cpp
+++ b/src/modules/m_opersha256.cpp
@@ -232,7 +232,7 @@ public:
this->source = "m_opersha256.so";
}
- void Handle(char **parameters, int pcnt, userrec *user)
+ void Handle(const char** parameters, int pcnt, userrec *user)
{
char buffer[SHA256_BLOCK_SIZE + 1];
SHA256(parameters[0], buffer, strlen(parameters[0]));
diff --git a/src/modules/m_operwho.cpp b/src/modules/m_operwho.cpp
index 9370ad765..edb0aea4d 100644
--- a/src/modules/m_operwho.cpp
+++ b/src/modules/m_operwho.cpp
@@ -41,7 +41,7 @@ class ModuleOperWho : public Module
List[I_OnPreCommand] = 1;
}
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
if ((!*user->oper) || (command != "WHO"))
diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp
index c57102287..782cf2f3b 100644
--- a/src/modules/m_park.cpp
+++ b/src/modules/m_park.cpp
@@ -63,7 +63,7 @@ class cmd_park : public command_t
this->source = "m_park.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
/** Parking. easy stuff.
*
@@ -108,7 +108,7 @@ class cmd_parkstats : public command_t
this->source = "m_park.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
char status[MAXBUF];
snprintf(status,MAXBUF,"NOTICE %s :There are a total of %lu parked clients on this server, with a maximum of %lu parked sessions allowed per user.",user->nick,(unsigned long)pinfo.size(),(unsigned long)ConcurrentParks);
@@ -124,7 +124,7 @@ class cmd_unpark : public command_t
this->source = "m_park.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
/** Unparking. complicated stuff.
*
diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp
index 64c967ae8..12049b376 100644
--- a/src/modules/m_randquote.cpp
+++ b/src/modules/m_randquote.cpp
@@ -41,7 +41,7 @@ class cmd_randquote : public command_t
this->source = "m_randquote.so";
}
- void Handle (char** parameters, int pcntl, userrec *user)
+ void Handle (const char** parameters, int pcntl, userrec *user)
{
std::string str;
int fsize;
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp
index d865066b3..59c1fcda2 100644
--- a/src/modules/m_remove.cpp
+++ b/src/modules/m_remove.cpp
@@ -55,7 +55,7 @@ class cmd_remove : public command_t
this->source = "m_remove.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
userrec* target;
chanrec* channel;
diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp
index a95198a5e..148040c6c 100644
--- a/src/modules/m_safelist.cpp
+++ b/src/modules/m_safelist.cpp
@@ -166,7 +166,7 @@ class ModuleSafeList : public Module
* OnPreCommand()
* Intercept the LIST command.
*/
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
/* If the command doesnt appear to be valid, we dont want to mess with it. */
if (!validated)
@@ -183,7 +183,7 @@ class ModuleSafeList : public Module
* HandleList()
* Handle (override) the LIST command.
*/
- int HandleList(char** parameters, int pcnt, userrec* user)
+ int HandleList(const char** parameters, int pcnt, userrec* user)
{
/* First, let's check if the user is currently /list'ing */
ListData *ld;
diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp
index 2c9273e70..39a95a27c 100644
--- a/src/modules/m_sajoin.cpp
+++ b/src/modules/m_sajoin.cpp
@@ -35,7 +35,7 @@ class cmd_sajoin : public command_t
this->source = "m_sajoin.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
userrec* dest = Srv->FindNick(std::string(parameters[0]));
if (dest)
diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp
index 280a5ae19..905eed0c8 100644
--- a/src/modules/m_samode.cpp
+++ b/src/modules/m_samode.cpp
@@ -46,7 +46,7 @@ class cmd_samode : public command_t
this->source = "m_samode.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
/*
* Handles an SAMODE request. Notifies all +s users.
diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp
index 5d449d7e0..6c07d08ce 100644
--- a/src/modules/m_sanick.cpp
+++ b/src/modules/m_sanick.cpp
@@ -34,7 +34,7 @@ class cmd_sanick : public command_t
this->source = "m_sanick.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
userrec* source = Srv->FindNick(std::string(parameters[0]));
if (source)
diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp
index 9203b7d36..afbdbdc87 100644
--- a/src/modules/m_sapart.cpp
+++ b/src/modules/m_sapart.cpp
@@ -35,7 +35,7 @@ class cmd_sapart : public command_t
this->source = "m_sapart.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
userrec* dest = Srv->FindNick(std::string(parameters[0]));
if (dest)
diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp
index 8174d5a64..d43b97102 100644
--- a/src/modules/m_saquit.cpp
+++ b/src/modules/m_saquit.cpp
@@ -44,7 +44,7 @@ class cmd_saquit : public command_t
this->source = "m_saquit.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
userrec* dest = Srv->FindNick(std::string(parameters[0]));
if (dest)
diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp
index fab32c2b4..97f84f5c7 100644
--- a/src/modules/m_securelist.cpp
+++ b/src/modules/m_securelist.cpp
@@ -55,7 +55,7 @@ class ModuleSecureList : public Module
* OnPreCommand()
* Intercept the LIST command.
*/
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
/* If the command doesnt appear to be valid, we dont want to mess with it. */
if (!validated)
diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp
index a0223f971..f27e74a4d 100644
--- a/src/modules/m_services.cpp
+++ b/src/modules/m_services.cpp
@@ -210,7 +210,7 @@ class ModuleServices : public Module
/* On nickchange, if they have +r, remove it */
if (user->IsModeSet('r'))
{
- char* modechange[2];
+ const char* modechange[2];
modechange[0] = user->nick;
modechange[1] = "-r";
kludgeme = true;
diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp
index 7244ba6de..eb2196c92 100644
--- a/src/modules/m_sethost.cpp
+++ b/src/modules/m_sethost.cpp
@@ -35,7 +35,7 @@ class cmd_sethost : public command_t
this->source = "m_sethost.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
if (strlen(parameters[0]) > 64)
{
diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp
index 4ec8e0fdb..12221edb0 100644
--- a/src/modules/m_setident.cpp
+++ b/src/modules/m_setident.cpp
@@ -14,7 +14,7 @@ class cmd_setident : public command_t
this->source = "m_setident.so";
}
- void Handle(char **parameters, int pcnt, userrec *user)
+ void Handle(const char** parameters, int pcnt, userrec *user)
{
for(unsigned int x = 0; x < strlen(parameters[0]); x++)
{
diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp
index af0bc2c64..040625238 100644
--- a/src/modules/m_setidle.cpp
+++ b/src/modules/m_setidle.cpp
@@ -35,7 +35,7 @@ class cmd_setidle : public command_t
this->source = "m_setidle.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
if (atoi(parameters[0]) < 1)
{
diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp
index b82f6de14..9a3b2a942 100644
--- a/src/modules/m_setname.cpp
+++ b/src/modules/m_setname.cpp
@@ -35,7 +35,7 @@ class cmd_setname : public command_t
this->source = "m_setname.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
std::string line = "";
for (int i = 0; i < pcnt-1; i++)
diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp
index 9cf2912f7..39b810dfe 100644
--- a/src/modules/m_silence.cpp
+++ b/src/modules/m_silence.cpp
@@ -41,7 +41,7 @@ class cmd_silence : public command_t
this->source = "m_silence.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
if (!pcnt)
{
@@ -62,7 +62,7 @@ class cmd_silence : public command_t
else if (pcnt > 0)
{
// one or more parameters, add or delete entry from the list (only the first parameter is used)
- char *nick = parameters[0];
+ const char *nick = parameters[0];
if (nick[0] == '-')
{
// removing an item from the list
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 5222d8f18..22c9e9246 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -555,9 +555,9 @@ class cmd_rconnect : public command_t
cmd_rconnect (Module* Callback) : command_t("RCONNECT", 'o', 2), Creator(Callback)
{
this->source = "m_spanningtree.so";
- }
+ }
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick,parameters[0],parameters[1]);
/* Is this aimed at our server? */
@@ -565,7 +565,7 @@ class cmd_rconnect : public command_t
{
/* Yes, initiate the given connect */
WriteOpers("*** Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick,parameters[0],parameters[1]);
- char* para[1];
+ const char* para[1];
para[0] = parameters[1];
Creator->OnPreCommand("CONNECT", para, 1, user, true);
}
@@ -888,7 +888,7 @@ class TreeSocket : public InspSocket
return true;
userrec* who = new userrec();
who->fd = FD_MAGIC_NUMBER;
- char* modelist[64];
+ const char* modelist[64];
memset(&modelist,0,sizeof(modelist));
for (unsigned int q = 0; q < params.size(); q++)
{
@@ -956,7 +956,7 @@ class TreeSocket : public InspSocket
memset(&mode_users,0,sizeof(mode_users));
mode_users[0] = first;
mode_users[1] = modestring;
- strcpy(mode_users[1],"+");
+ strcpy(first,"+");
unsigned int modectr = 2;
userrec* who = NULL;
@@ -991,7 +991,7 @@ class TreeSocket : public InspSocket
for (unsigned int usernum = 2; usernum < params.size(); usernum++)
{
/* process one channel at a time, applying modes. */
- char* usr = const_cast<char*>(params[usernum].c_str());
+ char* usr = (char*)params[usernum].c_str();
/* Safety check just to make sure someones not sent us an FJOIN full of spaces
* (is this even possible?) */
if (usr && *usr)
@@ -1028,7 +1028,7 @@ class TreeSocket : public InspSocket
{
/* We also always let u-lined clients win, no matter what the TS value */
log(DEBUG,"Our our channel newer than theirs, accepting their modes");
- Srv->SendMode(mode_users,modectr,who);
+ Srv->SendMode((const char**)mode_users,modectr,who);
}
else
{
@@ -1058,7 +1058,7 @@ class TreeSocket : public InspSocket
if (ourTS >= TS)
{
log(DEBUG,"Our our channel newer than theirs, accepting their modes");
- Srv->SendMode(mode_users,modectr,who);
+ Srv->SendMode((const char**)mode_users,modectr,who);
}
else
{
@@ -2555,10 +2555,10 @@ class TreeSocket : public InspSocket
}
// its a user
target = who->server;
- char* strparams[127];
+ const char* strparams[127];
for (unsigned int q = 0; q < params.size(); q++)
{
- strparams[q] = (char*)params[q].c_str();
+ strparams[q] = params[q].c_str();
}
if (!Srv->CallCommandHandler(command.c_str(), strparams, params.size(), who))
{
@@ -2970,14 +2970,14 @@ class ModuleSpanningTree : public Module
return serverlist.size();
}
- void HandleLinks(char** parameters, int pcnt, userrec* user)
+ void HandleLinks(const char** parameters, int pcnt, userrec* user)
{
ShowLinks(TreeRoot,user,0);
WriteServ(user->fd,"365 %s * :End of /LINKS list.",user->nick);
return;
}
- void HandleLusers(char** parameters, int pcnt, userrec* user)
+ void HandleLusers(const char** parameters, int pcnt, userrec* user)
{
unsigned int n_users = usercnt();
@@ -3062,7 +3062,7 @@ class ModuleSpanningTree : public Module
// (a character matrix), then draw the branches as a series of "L" shapes
// from the nodes. This is not only friendlier on CPU it uses less stack.
- void HandleMap(char** parameters, int pcnt, userrec* user)
+ void HandleMap(const char** parameters, int pcnt, userrec* user)
{
// This array represents a virtual screen which we will
// "scratch" draw to, as the console device of an irc
@@ -3118,7 +3118,7 @@ class ModuleSpanningTree : public Module
return;
}
- int HandleSquit(char** parameters, int pcnt, userrec* user)
+ int HandleSquit(const char** parameters, int pcnt, userrec* user)
{
TreeServer* s = FindServerMask(parameters[0]);
if (s)
@@ -3148,7 +3148,7 @@ class ModuleSpanningTree : public Module
return 1;
}
- int HandleTime(char** parameters, int pcnt, userrec* user)
+ int HandleTime(const char** parameters, int pcnt, userrec* user)
{
if ((user->fd > -1) && (pcnt))
{
@@ -3172,7 +3172,7 @@ class ModuleSpanningTree : public Module
return 1;
}
- int HandleRemoteWhois(char** parameters, int pcnt, userrec* user)
+ int HandleRemoteWhois(const char** parameters, int pcnt, userrec* user)
{
if ((user->fd > -1) && (pcnt > 1))
{
@@ -3250,7 +3250,7 @@ class ModuleSpanningTree : public Module
}
}
- int HandleVersion(char** parameters, int pcnt, userrec* user)
+ int HandleVersion(const char** parameters, int pcnt, userrec* user)
{
// we've already checked if pcnt > 0, so this is safe
TreeServer* found = FindServerMask(parameters[0]);
@@ -3287,7 +3287,7 @@ class ModuleSpanningTree : public Module
return 1;
}
- int HandleConnect(char** parameters, int pcnt, userrec* user)
+ int HandleConnect(const char** parameters, int pcnt, userrec* user)
{
for (std::vector<Link>::iterator x = LinkBlocks.begin(); x < LinkBlocks.end(); x++)
{
@@ -3336,7 +3336,7 @@ class ModuleSpanningTree : public Module
return 0;
}
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
/* If the command doesnt appear to be valid, we dont want to mess with it. */
if (!validated)
diff --git a/src/modules/m_spy.cpp b/src/modules/m_spy.cpp
index 625b5c971..e69db8ed5 100644
--- a/src/modules/m_spy.cpp
+++ b/src/modules/m_spy.cpp
@@ -92,7 +92,7 @@ class cmd_spylist : public command_t
this->source = "m_spy.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
WriteOpers("*** Oper %s used SPYLIST to list +s/+p channels and keys.",user->nick);
WriteServ(user->fd,"321 %s Channel :Users Name",user->nick);
@@ -112,7 +112,7 @@ class cmd_spynames : public command_t
this->source = "m_spy.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
chanrec* c;
diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp
index 2b7e58413..41248832d 100644
--- a/src/modules/m_swhois.cpp
+++ b/src/modules/m_swhois.cpp
@@ -31,7 +31,7 @@ class cmd_swhois : public command_t
this->source = "m_swhois.so";
}
- void Handle(char** parameters, int pcnt, userrec* user)
+ void Handle(const char** parameters, int pcnt, userrec* user)
{
userrec* dest = Srv->FindNick(std::string(parameters[0]));
if(dest)
diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp
index 881024cc7..1f8aaac1a 100644
--- a/src/modules/m_testcommand.cpp
+++ b/src/modules/m_testcommand.cpp
@@ -51,7 +51,7 @@ class cmd_woot : public command_t
this->source = "m_testcommand.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
/* We dont have to worry about deleting 'r', the core will
* do it for us as required.*/
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index da0c0faeb..2f4f040c0 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -47,7 +47,7 @@ class cmd_tban : public command_t
this->source = "m_timedbans.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
chanrec* channel = Srv->FindChannel(parameters[0]);
if (channel)
@@ -83,7 +83,7 @@ class cmd_tban : public command_t
char duration[MAXBUF];
snprintf(duration,MAXBUF,"%lu",Srv->CalcDuration(parameters[1]));
std::string mask = parameters[2];
- char *setban[32];
+ const char *setban[32];
setban[0] = parameters[0];
setban[1] = "+b";
setban[2] = parameters[2];
@@ -157,10 +157,10 @@ class ModuleTimedBans : public Module
if (cr)
{
Srv->SendChannelServerNotice(Srv->GetServerName(),cr,"NOTICE "+std::string(cr->name)+" :Timed ban on "+i->mask+" expired.");
- char *setban[3];
- setban[0] = (char*)i->channel.c_str();
+ const char *setban[3];
+ setban[0] = i->channel.c_str();
setban[1] = "-b";
- setban[2] = (char*)i->mask.c_str();
+ setban[2] = i->mask.c_str();
// kludge alert!
// ::SendMode expects a userrec* to send the numeric replies
// back to, so we create it a fake user that isnt in the user
diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp
index 14660cf1e..c8332319f 100644
--- a/src/modules/m_uninvite.cpp
+++ b/src/modules/m_uninvite.cpp
@@ -35,7 +35,7 @@ class cmd_uninvite : public command_t
this->source = "m_uninvite.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
userrec* u = Find(parameters[0]);
chanrec* c = FindChan(parameters[1]);
diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp
index 55101705e..0b62df0a1 100644
--- a/src/modules/m_userip.cpp
+++ b/src/modules/m_userip.cpp
@@ -35,7 +35,7 @@ class cmd_userip : public command_t
this->source = "m_userip.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
char Return[MAXBUF],junk[MAXBUF];
snprintf(Return,MAXBUF,"340 %s :",user->nick);
diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp
index 270d7aa0b..61d07a7e2 100644
--- a/src/modules/m_vhost.cpp
+++ b/src/modules/m_vhost.cpp
@@ -35,7 +35,7 @@ class cmd_vhost : public command_t
this->source = "m_vhost.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
for (int index = 0; index < Conf->Enumerate("vhost"); index++)
{
diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp
index faf0792dc..c15609a4d 100644
--- a/src/modules/m_watch.cpp
+++ b/src/modules/m_watch.cpp
@@ -47,7 +47,7 @@ class cmd_watch : public command_t
this->source = "m_watch.so";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
if (!pcnt)
{
@@ -68,7 +68,7 @@ class cmd_watch : public command_t
{
for (int x = 0; x < pcnt; x++)
{
- char *nick = parameters[x];
+ const char *nick = parameters[x];
if (!strcasecmp(nick,"C"))
{
// watch clear
diff --git a/src/users.cpp b/src/users.cpp
index f455bb825..1e2e35321 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -944,7 +944,7 @@ void FullConnectUser(userrec* user, CullList* Goners)
* re-allocates a nick in the user_hash after they change nicknames,
* returns a pointer to the new user as it may have moved
*/
-userrec* ReHashNick(char* Old, char* New)
+userrec* ReHashNick(const char* Old, const char* New)
{
//user_hash::iterator newnick;
user_hash::iterator oldnick = clientlist.find(Old);
@@ -1003,10 +1003,10 @@ void force_nickchange(userrec* user,const char* newnick)
if (user->registered == 7)
{
- char* pars[1];
-
+ const char* pars[1];
pars[0] = nick;
std::string cmd = "NICK";
+
ServerInstance->Parser->CallHandler(cmd,pars,1,user);
}
}