From dd36852a52e8541306b76c5b88bce8ab9b36654c Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 20 Feb 2008 19:07:07 +0000 Subject: Wheee, mass commit! this adds const stafety, throwing a compile error if anyone does: "parameters[n] = blahvar;" in a command handler etc. where they REALLY SHOULD NOT fuck with the value and should copy the pointer. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8971 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/command_parse.cpp | 8 ++--- src/commands/cmd_admin.cpp | 2 +- src/commands/cmd_away.cpp | 2 +- src/commands/cmd_clearcache.cpp | 2 +- src/commands/cmd_commands.cpp | 2 +- src/commands/cmd_connect.cpp | 2 +- src/commands/cmd_die.cpp | 2 +- src/commands/cmd_eline.cpp | 2 +- src/commands/cmd_gline.cpp | 2 +- src/commands/cmd_info.cpp | 2 +- src/commands/cmd_invite.cpp | 2 +- src/commands/cmd_ison.cpp | 2 +- src/commands/cmd_join.cpp | 2 +- src/commands/cmd_kick.cpp | 2 +- src/commands/cmd_kill.cpp | 2 +- src/commands/cmd_kline.cpp | 2 +- src/commands/cmd_links.cpp | 2 +- src/commands/cmd_list.cpp | 2 +- src/commands/cmd_loadmodule.cpp | 2 +- src/commands/cmd_lusers.cpp | 2 +- src/commands/cmd_map.cpp | 2 +- src/commands/cmd_mode.cpp | 2 +- src/commands/cmd_modules.cpp | 2 +- src/commands/cmd_motd.cpp | 2 +- src/commands/cmd_names.cpp | 2 +- src/commands/cmd_nick.cpp | 2 +- src/commands/cmd_notice.cpp | 45 +++++++++++++------------ src/commands/cmd_oper.cpp | 2 +- src/commands/cmd_part.cpp | 2 +- src/commands/cmd_pass.cpp | 2 +- src/commands/cmd_ping.cpp | 2 +- src/commands/cmd_pong.cpp | 2 +- src/commands/cmd_privmsg.cpp | 44 ++++++++++++------------ src/commands/cmd_qline.cpp | 2 +- src/commands/cmd_quit.cpp | 2 +- src/commands/cmd_rehash.cpp | 2 +- src/commands/cmd_reloadmodule.cpp | 2 +- src/commands/cmd_restart.cpp | 2 +- src/commands/cmd_rules.cpp | 2 +- src/commands/cmd_server.cpp | 2 +- src/commands/cmd_squit.cpp | 2 +- src/commands/cmd_stats.cpp | 2 +- src/commands/cmd_time.cpp | 2 +- src/commands/cmd_topic.cpp | 2 +- src/commands/cmd_trace.cpp | 2 +- src/commands/cmd_unloadmodule.cpp | 2 +- src/commands/cmd_user.cpp | 2 +- src/commands/cmd_userhost.cpp | 2 +- src/commands/cmd_version.cpp | 2 +- src/commands/cmd_wallops.cpp | 2 +- src/commands/cmd_who.cpp | 2 +- src/commands/cmd_whois.cpp | 2 +- src/commands/cmd_whowas.cpp | 2 +- src/commands/cmd_zline.cpp | 2 +- src/hashcomp.cpp | 2 +- src/mode.cpp | 2 +- src/modules.cpp | 8 ++--- src/modules/extra/m_rline.cpp | 2 +- src/modules/extra/m_sqllog.cpp | 2 +- src/modules/extra/m_sqloper.cpp | 2 +- src/modules/extra/m_ssl_oper_cert.cpp | 4 +-- src/modules/extra/m_sslinfo.cpp | 2 +- src/modules/m_alias.cpp | 2 +- src/modules/m_alltime.cpp | 2 +- src/modules/m_antibear.cpp | 2 +- src/modules/m_antibottler.cpp | 2 +- src/modules/m_blockamsg.cpp | 2 +- src/modules/m_callerid.cpp | 2 +- src/modules/m_cban.cpp | 2 +- src/modules/m_cgiirc.cpp | 2 +- src/modules/m_check.cpp | 2 +- src/modules/m_chghost.cpp | 2 +- src/modules/m_chgident.cpp | 2 +- src/modules/m_chgname.cpp | 2 +- src/modules/m_clones.cpp | 2 +- src/modules/m_close.cpp | 2 +- src/modules/m_conn_waitpong.cpp | 2 +- src/modules/m_customtitle.cpp | 2 +- src/modules/m_cycle.cpp | 2 +- src/modules/m_dccallow.cpp | 2 +- src/modules/m_devoice.cpp | 2 +- src/modules/m_filter.h | 6 ++-- src/modules/m_globalload.cpp | 6 ++-- src/modules/m_globops.cpp | 2 +- src/modules/m_helpop.cpp | 2 +- src/modules/m_jumpserver.cpp | 2 +- src/modules/m_knock.cpp | 2 +- src/modules/m_lockserv.cpp | 4 +-- src/modules/m_namesx.cpp | 2 +- src/modules/m_nicklock.cpp | 4 +-- src/modules/m_operlog.cpp | 2 +- src/modules/m_opermotd.cpp | 2 +- src/modules/m_override.cpp | 2 +- src/modules/m_password_hash.cpp | 2 +- src/modules/m_randquote.cpp | 2 +- src/modules/m_remove.cpp | 6 ++-- src/modules/m_safelist.cpp | 4 +-- src/modules/m_sajoin.cpp | 2 +- src/modules/m_samode.cpp | 2 +- src/modules/m_sanick.cpp | 2 +- src/modules/m_sapart.cpp | 2 +- src/modules/m_saquit.cpp | 2 +- src/modules/m_securelist.cpp | 2 +- src/modules/m_sethost.cpp | 2 +- src/modules/m_setident.cpp | 2 +- src/modules/m_setidle.cpp | 2 +- src/modules/m_setname.cpp | 2 +- src/modules/m_silence.cpp | 2 +- src/modules/m_silence_ext.cpp | 2 +- src/modules/m_spanningtree/main.cpp | 8 ++--- src/modules/m_spanningtree/main.h | 28 +++++++-------- src/modules/m_spanningtree/override_admin.cpp | 2 +- src/modules/m_spanningtree/override_map.cpp | 2 +- src/modules/m_spanningtree/override_modules.cpp | 2 +- src/modules/m_spanningtree/override_motd.cpp | 2 +- src/modules/m_spanningtree/override_squit.cpp | 2 +- src/modules/m_spanningtree/override_stats.cpp | 2 +- src/modules/m_spanningtree/override_time.cpp | 2 +- src/modules/m_spanningtree/override_whois.cpp | 2 +- src/modules/m_spanningtree/postcommand.cpp | 2 +- src/modules/m_spanningtree/precommand.cpp | 2 +- src/modules/m_spanningtree/rconnect.cpp | 2 +- src/modules/m_spanningtree/rconnect.h | 2 +- src/modules/m_spanningtree/rsquit.cpp | 2 +- src/modules/m_spanningtree/rsquit.h | 2 +- src/modules/m_svshold.cpp | 2 +- src/modules/m_swhois.cpp | 4 +-- src/modules/m_taxonomy.cpp | 2 +- src/modules/m_testcommand.cpp | 2 +- src/modules/m_timedbans.cpp | 2 +- src/modules/m_tline.cpp | 2 +- src/modules/m_uhnames.cpp | 2 +- src/modules/m_uninvite.cpp | 2 +- src/modules/m_userip.cpp | 2 +- src/modules/m_vhost.cpp | 2 +- src/modules/m_watch.cpp | 4 +-- 136 files changed, 213 insertions(+), 212 deletions(-) (limited to 'src') diff --git a/src/command_parse.cpp b/src/command_parse.cpp index a4e1e00d5..57a86b0cd 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -48,7 +48,7 @@ int InspIRCd::PassCompare(Extensible* ex, const char* data,const char* input, co * The second version is much simpler and just has the one stream to read, and is used in NAMES, WHOIS, PRIVMSG etc. * Both will only parse until they reach ServerInstance->Config->MaxTargets number of targets, to stop abuse via spam. */ -int CommandParser::LoopCall(User* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra) +int CommandParser::LoopCall(User* user, Command* CommandObj, const char* const* parameters, int pcnt, unsigned int splithere, unsigned int extra) { /* First check if we have more than one item in the list, if we don't we return zero here and the handler * which called us just carries on as it was. @@ -97,7 +97,7 @@ int CommandParser::LoopCall(User* user, Command* CommandObj, const char** parame return 1; } -int CommandParser::LoopCall(User* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere) +int CommandParser::LoopCall(User* user, Command* CommandObj, const char* const* parameters, int pcnt, unsigned int splithere) { /* First check if we have more than one item in the list, if we don't we return zero here and the handler * which called us just carries on as it was. @@ -178,7 +178,7 @@ Command* CommandParser::GetHandler(const std::string &commandname) // calls a handler function for a command -CmdResult CommandParser::CallHandler(const std::string &commandname,const char** parameters, int pcnt, User *user) +CmdResult CommandParser::CallHandler(const std::string &commandname,const char* const* parameters, int pcnt, User *user) { Commandable::iterator n = cmdlist.find(commandname); @@ -498,7 +498,7 @@ bool CommandParser::ReloadCommand(const char* cmd, User* user) return false; } -CmdResult cmd_reload::Handle(const char** parameters, int /* pcnt */, User *user) +CmdResult cmd_reload::Handle(const char* const* parameters, int /* pcnt */, User *user) { user->WriteServ("NOTICE %s :*** Reloading command '%s'",user->nick, parameters[0]); if (ServerInstance->Parser->ReloadCommand(parameters[0], user)) diff --git a/src/commands/cmd_admin.cpp b/src/commands/cmd_admin.cpp index 9957c97d2..8f5dfd3f8 100644 --- a/src/commands/cmd_admin.cpp +++ b/src/commands/cmd_admin.cpp @@ -22,7 +22,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /ADMIN */ -CmdResult CommandAdmin::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandAdmin::Handle (const char* const* parameters, int pcnt, User *user) { user->WriteServ("256 %s :Administrative info for %s",user->nick,ServerInstance->Config->ServerName); if (*ServerInstance->Config->AdminName) diff --git a/src/commands/cmd_away.cpp b/src/commands/cmd_away.cpp index dd708edfc..ffddbba44 100644 --- a/src/commands/cmd_away.cpp +++ b/src/commands/cmd_away.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /AWAY */ -CmdResult CommandAway::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandAway::Handle (const char* const* parameters, int pcnt, User *user) { if ((pcnt) && (*parameters[0])) { diff --git a/src/commands/cmd_clearcache.cpp b/src/commands/cmd_clearcache.cpp index 250e4b825..c7354df07 100644 --- a/src/commands/cmd_clearcache.cpp +++ b/src/commands/cmd_clearcache.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /CLEARCACHE */ -CmdResult CommandClearcache::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandClearcache::Handle (const char* const* parameters, int pcnt, User *user) { int n = ServerInstance->Res->ClearCache(); user->WriteServ("NOTICE %s :*** Cleared DNS cache of %d items.", user->nick, n); diff --git a/src/commands/cmd_commands.cpp b/src/commands/cmd_commands.cpp index 7fe1a9ffa..e559a9e2f 100644 --- a/src/commands/cmd_commands.cpp +++ b/src/commands/cmd_commands.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandCommands(Instance); } -CmdResult CommandCommands::Handle (const char**, int, User *user) +CmdResult CommandCommands::Handle (const char* const*, int, User *user) { for (Commandable::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++) { diff --git a/src/commands/cmd_connect.cpp b/src/commands/cmd_connect.cpp index 7eb909c10..04aada207 100644 --- a/src/commands/cmd_connect.cpp +++ b/src/commands/cmd_connect.cpp @@ -25,7 +25,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /CONNECT */ -CmdResult CommandConnect::Handle (const char**, int, User *user) +CmdResult CommandConnect::Handle (const char* const*, int, User *user) { user->WriteServ( "NOTICE %s :Look into loading a linking module (like m_spanningtree) if you want this to do anything useful.", user->nick); return CMD_SUCCESS; diff --git a/src/commands/cmd_die.cpp b/src/commands/cmd_die.cpp index 0afb6f248..960cefe63 100644 --- a/src/commands/cmd_die.cpp +++ b/src/commands/cmd_die.cpp @@ -22,7 +22,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /DIE */ -CmdResult CommandDie::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandDie::Handle (const char* const* parameters, int pcnt, User *user) { if (!ServerInstance->PassCompare(user, ServerInstance->Config->diepass, parameters[0], ServerInstance->Config->powerhash)) { diff --git a/src/commands/cmd_eline.cpp b/src/commands/cmd_eline.cpp index 5893fd9b7..fa9ddd708 100644 --- a/src/commands/cmd_eline.cpp +++ b/src/commands/cmd_eline.cpp @@ -22,7 +22,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /ELINE */ -CmdResult CommandEline::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandEline::Handle (const char* const* parameters, int pcnt, User *user) { std::string target = parameters[0]; diff --git a/src/commands/cmd_gline.cpp b/src/commands/cmd_gline.cpp index 0061bfe00..a6bec9c0e 100644 --- a/src/commands/cmd_gline.cpp +++ b/src/commands/cmd_gline.cpp @@ -22,7 +22,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /GLINE */ -CmdResult CommandGline::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandGline::Handle (const char* const* parameters, int pcnt, User *user) { std::string target = parameters[0]; diff --git a/src/commands/cmd_info.cpp b/src/commands/cmd_info.cpp index 65a9713f7..64d438b83 100644 --- a/src/commands/cmd_info.cpp +++ b/src/commands/cmd_info.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /INFO */ -CmdResult CommandInfo::Handle (const char**, int, User *user) +CmdResult CommandInfo::Handle (const char* const*, int, User *user) { user->WriteServ( "371 %s : -/\\- \2InspIRCd\2 -\\/-", user->nick); user->WriteServ( "371 %s : November 2002 - Present", user->nick); diff --git a/src/commands/cmd_invite.cpp b/src/commands/cmd_invite.cpp index 42905d9bf..49296ca42 100644 --- a/src/commands/cmd_invite.cpp +++ b/src/commands/cmd_invite.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /INVITE */ -CmdResult CommandInvite::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandInvite::Handle (const char* const* parameters, int pcnt, User *user) { int MOD_RESULT = 0; diff --git a/src/commands/cmd_ison.cpp b/src/commands/cmd_ison.cpp index b0e77129e..ba119e251 100644 --- a/src/commands/cmd_ison.cpp +++ b/src/commands/cmd_ison.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /ISON */ -CmdResult CommandIson::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandIson::Handle (const char* const* parameters, int pcnt, User *user) { std::map ison_already; User *u; diff --git a/src/commands/cmd_join.cpp b/src/commands/cmd_join.cpp index 1c640b326..513901e47 100644 --- a/src/commands/cmd_join.cpp +++ b/src/commands/cmd_join.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /JOIN */ -CmdResult CommandJoin::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandJoin::Handle (const char* const* parameters, int pcnt, User *user) { if (pcnt > 1) { diff --git a/src/commands/cmd_kick.cpp b/src/commands/cmd_kick.cpp index 0a6e34cb2..329a37bcf 100644 --- a/src/commands/cmd_kick.cpp +++ b/src/commands/cmd_kick.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /KICK */ -CmdResult CommandKick::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandKick::Handle (const char* const* parameters, int pcnt, User *user) { char reason[MAXKICK]; Channel* c = ServerInstance->FindChan(parameters[0]); diff --git a/src/commands/cmd_kill.cpp b/src/commands/cmd_kill.cpp index 6a1e64d7f..c92b8a6b0 100644 --- a/src/commands/cmd_kill.cpp +++ b/src/commands/cmd_kill.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /KILL */ -CmdResult CommandKill::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandKill::Handle (const char* const* parameters, int pcnt, User *user) { /* Allow comma seperated lists of users for /KILL (thanks w00t) */ if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0)) diff --git a/src/commands/cmd_kline.cpp b/src/commands/cmd_kline.cpp index d96873dc1..b4464a6d3 100644 --- a/src/commands/cmd_kline.cpp +++ b/src/commands/cmd_kline.cpp @@ -22,7 +22,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /KLINE */ -CmdResult CommandKline::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandKline::Handle (const char* const* parameters, int pcnt, User *user) { std::string target = parameters[0]; diff --git a/src/commands/cmd_links.cpp b/src/commands/cmd_links.cpp index 663e40881..973e5f0a6 100644 --- a/src/commands/cmd_links.cpp +++ b/src/commands/cmd_links.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /LINKS */ -CmdResult CommandLinks::Handle (const char**, int, User *user) +CmdResult CommandLinks::Handle (const char* const*, int, User *user) { user->WriteServ("364 %s %s %s :0 %s",user->nick,ServerInstance->Config->ServerName,ServerInstance->Config->ServerName,ServerInstance->Config->ServerDesc); user->WriteServ("365 %s * :End of /LINKS list.",user->nick); diff --git a/src/commands/cmd_list.cpp b/src/commands/cmd_list.cpp index 970e26117..2ead367a4 100644 --- a/src/commands/cmd_list.cpp +++ b/src/commands/cmd_list.cpp @@ -22,7 +22,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandList(Instance); } -CmdResult CommandList::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandList::Handle (const char* const* parameters, int pcnt, User *user) { int minusers = 0, maxusers = 0; diff --git a/src/commands/cmd_loadmodule.cpp b/src/commands/cmd_loadmodule.cpp index 15678e5fc..043bae14e 100644 --- a/src/commands/cmd_loadmodule.cpp +++ b/src/commands/cmd_loadmodule.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /LOADMODULE */ -CmdResult CommandLoadmodule::Handle (const char** parameters, int, User *user) +CmdResult CommandLoadmodule::Handle (const char* const* parameters, int, User *user) { if (ServerInstance->Modules->Load(parameters[0])) { diff --git a/src/commands/cmd_lusers.cpp b/src/commands/cmd_lusers.cpp index 317229ceb..401b41b2e 100644 --- a/src/commands/cmd_lusers.cpp +++ b/src/commands/cmd_lusers.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /LUSERS */ -CmdResult CommandLusers::Handle (const char**, int, User *user) +CmdResult CommandLusers::Handle (const char* const*, int, User *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/commands/cmd_map.cpp b/src/commands/cmd_map.cpp index ce132494e..2ace70725 100644 --- a/src/commands/cmd_map.cpp +++ b/src/commands/cmd_map.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /MAP */ -CmdResult CommandMap::Handle (const char**, int, User *user) +CmdResult CommandMap::Handle (const char* const*, int, User *user) { // as with /LUSERS this does nothing without a linking // module to override its behaviour and display something diff --git a/src/commands/cmd_mode.cpp b/src/commands/cmd_mode.cpp index dafb493cb..25fec59b9 100644 --- a/src/commands/cmd_mode.cpp +++ b/src/commands/cmd_mode.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /MODE */ -CmdResult CommandMode::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandMode::Handle (const char* const* parameters, int pcnt, User *user) { ServerInstance->Modes->Process(parameters, pcnt, user, false); return CMD_SUCCESS; diff --git a/src/commands/cmd_modules.cpp b/src/commands/cmd_modules.cpp index 7649dbc91..482eb82e4 100644 --- a/src/commands/cmd_modules.cpp +++ b/src/commands/cmd_modules.cpp @@ -38,7 +38,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /MODULES */ -CmdResult CommandModules::Handle (const char**, int, User *user) +CmdResult CommandModules::Handle (const char* const*, int, User *user) { std::vector module_names = ServerInstance->Modules->GetAllModuleNames(0); diff --git a/src/commands/cmd_motd.cpp b/src/commands/cmd_motd.cpp index 6875ca0ed..b6584303d 100644 --- a/src/commands/cmd_motd.cpp +++ b/src/commands/cmd_motd.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /MOTD */ -CmdResult CommandMotd::Handle (const char**, int, User *user) +CmdResult CommandMotd::Handle (const char* const*, int, User *user) { user->ShowMOTD(); return CMD_SUCCESS; diff --git a/src/commands/cmd_names.cpp b/src/commands/cmd_names.cpp index bfde4e40a..1c5327327 100644 --- a/src/commands/cmd_names.cpp +++ b/src/commands/cmd_names.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** Handle /NAMES */ -CmdResult CommandNames::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandNames::Handle (const char* const* parameters, int pcnt, User *user) { Channel* c; diff --git a/src/commands/cmd_nick.cpp b/src/commands/cmd_nick.cpp index 5a7ed846a..2caa9b25a 100644 --- a/src/commands/cmd_nick.cpp +++ b/src/commands/cmd_nick.cpp @@ -25,7 +25,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) * for the client introduction code in here, youre in the wrong place. * You need to look in the spanningtree module for this! */ -CmdResult CommandNick::Handle (const char** parameters, int, User *user) +CmdResult CommandNick::Handle (const char* const* parameters, int, User *user) { char oldnick[NICKMAX]; diff --git a/src/commands/cmd_notice.cpp b/src/commands/cmd_notice.cpp index 9a5248c0f..5822551da 100644 --- a/src/commands/cmd_notice.cpp +++ b/src/commands/cmd_notice.cpp @@ -20,7 +20,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandNotice(Instance); } -CmdResult CommandNotice::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandNotice::Handle (const char* const* parameters, int pcnt, User *user) { User *dest; Channel *chan; @@ -38,26 +38,27 @@ CmdResult CommandNotice::Handle (const char** parameters, int pcnt, User *user) FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,(void*)parameters[0],TYPE_SERVER,temp,0,exempt_list)); if (MOD_RESULT) return CMD_FAILURE; - parameters[1] = temp.c_str(); - // notice to server mask + const char* text = temp.c_str(); const char* servermask = parameters[0] + 1; - FOREACH_MOD(I_OnText,OnText(user,(void*)parameters[0],TYPE_SERVER,parameters[1],0,exempt_list)); + + FOREACH_MOD(I_OnText,OnText(user,(void*)parameters[0],TYPE_SERVER,text,0,exempt_list)); if (match(ServerInstance->Config->ServerName,servermask)) { - user->SendAll("NOTICE", "%s", parameters[1]); + user->SendAll("NOTICE", "%s", text); } - FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,(void*)parameters[0],TYPE_SERVER,parameters[1],0,exempt_list)); + FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,(void*)parameters[0],TYPE_SERVER,text,0,exempt_list)); return CMD_SUCCESS; } char status = 0; - if ((*parameters[0] == '@') || (*parameters[0] == '%') || (*parameters[0] == '+')) + const char* target = parameters[0]; + if ((*target == '@') || (*target == '%') || (*target == '+')) { - status = *parameters[0]; - parameters[0]++; + status = *target; + target++; } - if (*parameters[0] == '#') + if (*target == '#') { - chan = ServerInstance->FindChan(parameters[0]); + chan = ServerInstance->FindChan(target); exempt_list[user] = user->nick; @@ -83,7 +84,7 @@ CmdResult CommandNotice::Handle (const char** parameters, int pcnt, User *user) if (MOD_RESULT) { return CMD_FAILURE; } - parameters[1] = temp.c_str(); + const char* text = temp.c_str(); if (temp.empty()) { @@ -91,30 +92,30 @@ CmdResult CommandNotice::Handle (const char** parameters, int pcnt, User *user) return CMD_FAILURE; } - FOREACH_MOD(I_OnText,OnText(user,chan,TYPE_CHANNEL,parameters[1],status,exempt_list)); + FOREACH_MOD(I_OnText,OnText(user,chan,TYPE_CHANNEL,text,status,exempt_list)); if (status) { if (ServerInstance->Config->UndernetMsgPrefix) { - chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %c%s :%c %s", status, chan->name, status, parameters[1]); + chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %c%s :%c %s", status, chan->name, status, text); } else { - chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %c%s :%s", status, chan->name, parameters[1]); + chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %c%s :%s", status, chan->name, text); } } else { - chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %s :%s", chan->name, parameters[1]); + chan->WriteAllExcept(user, false, status, exempt_list, "NOTICE %s :%s", chan->name, text); } - FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,chan,TYPE_CHANNEL,parameters[1],status,exempt_list)); + FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,chan,TYPE_CHANNEL,text,status,exempt_list)); } else { /* no such nick/channel */ - user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[0]); + user->WriteServ("401 %s %s :No such nick/channel",user->nick, target); return CMD_FAILURE; } return CMD_SUCCESS; @@ -158,17 +159,17 @@ CmdResult CommandNotice::Handle (const char** parameters, int pcnt, User *user) if (MOD_RESULT) { return CMD_FAILURE; } - parameters[1] = (char*)temp.c_str(); + const char* text = temp.c_str(); - FOREACH_MOD(I_OnText,OnText(user,dest,TYPE_USER,parameters[1],0,exempt_list)); + FOREACH_MOD(I_OnText,OnText(user,dest,TYPE_USER,text,0,exempt_list)); if (IS_LOCAL(dest)) { // direct write, same server - user->WriteTo(dest, "NOTICE %s :%s", dest->nick, parameters[1]); + user->WriteTo(dest, "NOTICE %s :%s", dest->nick, text); } - FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,dest,TYPE_USER,parameters[1],0,exempt_list)); + FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,dest,TYPE_USER,text,0,exempt_list)); } else { diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index 4d4c54932..608d04ba6 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -35,7 +35,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandOper(Instance); } -CmdResult CommandOper::Handle (const char** parameters, int, User *user) +CmdResult CommandOper::Handle (const char* const* parameters, int, User *user) { char LoginName[MAXBUF]; char Password[MAXBUF]; diff --git a/src/commands/cmd_part.cpp b/src/commands/cmd_part.cpp index 5137a32ca..002ae722b 100644 --- a/src/commands/cmd_part.cpp +++ b/src/commands/cmd_part.cpp @@ -19,7 +19,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandPart(Instance); } -CmdResult CommandPart::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandPart::Handle (const char* const* parameters, int pcnt, User *user) { std::string reason; diff --git a/src/commands/cmd_pass.cpp b/src/commands/cmd_pass.cpp index 94a7c6e87..fc09d2a41 100644 --- a/src/commands/cmd_pass.cpp +++ b/src/commands/cmd_pass.cpp @@ -19,7 +19,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandPass(Instance); } -CmdResult CommandPass::Handle (const char** parameters, int, User *user) +CmdResult CommandPass::Handle (const char* const* parameters, int, User *user) { // Check to make sure they havnt registered -- Fix by FCS if (user->registered == REG_ALL) diff --git a/src/commands/cmd_ping.cpp b/src/commands/cmd_ping.cpp index e989f057a..3aeafe15e 100644 --- a/src/commands/cmd_ping.cpp +++ b/src/commands/cmd_ping.cpp @@ -19,7 +19,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandPing(Instance); } -CmdResult CommandPing::Handle (const char** parameters, int, User *user) +CmdResult CommandPing::Handle (const char* const* parameters, int, User *user) { user->WriteServ("PONG %s :%s",ServerInstance->Config->ServerName,parameters[0]); return CMD_SUCCESS; diff --git a/src/commands/cmd_pong.cpp b/src/commands/cmd_pong.cpp index 05ee55378..51c951eba 100644 --- a/src/commands/cmd_pong.cpp +++ b/src/commands/cmd_pong.cpp @@ -19,7 +19,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandPong(Instance); } -CmdResult CommandPong::Handle (const char**, int, User *user) +CmdResult CommandPong::Handle (const char* const*, int, User *user) { // set the user as alive so they survive to next ping user->lastping = 1; diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp index f02700659..e78e2208a 100644 --- a/src/commands/cmd_privmsg.cpp +++ b/src/commands/cmd_privmsg.cpp @@ -20,7 +20,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandPrivmsg(Instance); } -CmdResult CommandPrivmsg::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandPrivmsg::Handle (const char* const* parameters, int pcnt, User *user) { User *dest; Channel *chan; @@ -38,26 +38,26 @@ CmdResult CommandPrivmsg::Handle (const char** parameters, int pcnt, User *user) FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,(void*)parameters[0],TYPE_SERVER,temp,0,except_list)); if (MOD_RESULT) return CMD_FAILURE; - parameters[1] = temp.c_str(); - // notice to server mask + const char* text = temp.c_str(); const char* servermask = parameters[0] + 1; - FOREACH_MOD(I_OnText,OnText(user,(void*)parameters[0],TYPE_SERVER,parameters[1],0,except_list)); + FOREACH_MOD(I_OnText,OnText(user,(void*)parameters[0],TYPE_SERVER,text,0,except_list)); if (match(ServerInstance->Config->ServerName,servermask)) { - user->SendAll("PRIVMSG", "%s", parameters[1]); + user->SendAll("PRIVMSG", "%s", text); } - FOREACH_MOD(I_OnUserMessage,OnUserMessage(user,(void*)parameters[0],TYPE_SERVER,parameters[1],0,except_list)); + FOREACH_MOD(I_OnUserMessage,OnUserMessage(user,(void*)parameters[0],TYPE_SERVER,text,0,except_list)); return CMD_SUCCESS; } char status = 0; - if ((*parameters[0] == '@') || (*parameters[0] == '%') || (*parameters[0] == '+')) + const char* target = parameters[0]; + if ((*target == '@') || (*target == '%') || (*target == '+')) { - status = *parameters[0]; - parameters[0]++; + status = *target; + target++; } - if (parameters[0][0] == '#') + if (*target == '#') { - chan = ServerInstance->FindChan(parameters[0]); + chan = ServerInstance->FindChan(target); except_list[user] = user->nick; @@ -83,7 +83,7 @@ CmdResult CommandPrivmsg::Handle (const char** parameters, int pcnt, User *user) if (MOD_RESULT) { return CMD_FAILURE; } - parameters[1] = temp.c_str(); + const char* text = temp.c_str(); /* Check again, a module may have zapped the input string */ if (temp.empty()) @@ -92,30 +92,30 @@ CmdResult CommandPrivmsg::Handle (const char** parameters, int pcnt, User *user) return CMD_FAILURE; } - FOREACH_MOD(I_OnText,OnText(user,chan,TYPE_CHANNEL,parameters[1],status,except_list)); + FOREACH_MOD(I_OnText,OnText(user,chan,TYPE_CHANNEL,text,status,except_list)); if (status) { if (ServerInstance->Config->UndernetMsgPrefix) { - chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %c%s :%c %s", status, chan->name, status, parameters[1]); + chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %c%s :%c %s", status, chan->name, status, text); } else { - chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %c%s :%s", status, chan->name, parameters[1]); + chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %c%s :%s", status, chan->name, text); } } else { - chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %s :%s", chan->name, parameters[1]); + chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %s :%s", chan->name, text); } - FOREACH_MOD(I_OnUserMessage,OnUserMessage(user,chan,TYPE_CHANNEL,parameters[1],status,except_list)); + FOREACH_MOD(I_OnUserMessage,OnUserMessage(user,chan,TYPE_CHANNEL,text,status,except_list)); } else { /* no such nick/channel */ - user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[0]); + user->WriteServ("401 %s %s :No such nick/channel",user->nick, target); return CMD_FAILURE; } return CMD_SUCCESS; @@ -166,17 +166,17 @@ CmdResult CommandPrivmsg::Handle (const char** parameters, int pcnt, User *user) if (MOD_RESULT) { return CMD_FAILURE; } - parameters[1] = (char*)temp.c_str(); + const char* text = temp.c_str(); - FOREACH_MOD(I_OnText,OnText(user,dest,TYPE_USER,parameters[1],0,except_list)); + FOREACH_MOD(I_OnText,OnText(user,dest,TYPE_USER,text,0,except_list)); if (IS_LOCAL(dest)) { // direct write, same server - user->WriteTo(dest, "PRIVMSG %s :%s", dest->nick, parameters[1]); + user->WriteTo(dest, "PRIVMSG %s :%s", dest->nick, text); } - FOREACH_MOD(I_OnUserMessage,OnUserMessage(user,dest,TYPE_USER,parameters[1],0,except_list)); + FOREACH_MOD(I_OnUserMessage,OnUserMessage(user,dest,TYPE_USER,text,0,except_list)); } else { diff --git a/src/commands/cmd_qline.cpp b/src/commands/cmd_qline.cpp index 2c3647d9f..97d26ba9f 100644 --- a/src/commands/cmd_qline.cpp +++ b/src/commands/cmd_qline.cpp @@ -22,7 +22,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandQline(Instance); } -CmdResult CommandQline::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandQline::Handle (const char* const* parameters, int pcnt, User *user) { if (pcnt >= 3) { diff --git a/src/commands/cmd_quit.cpp b/src/commands/cmd_quit.cpp index 43483fa17..29433ff5a 100644 --- a/src/commands/cmd_quit.cpp +++ b/src/commands/cmd_quit.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandQuit(Instance); } -CmdResult CommandQuit::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandQuit::Handle (const char* const* parameters, int pcnt, User *user) { std::string quitmsg; diff --git a/src/commands/cmd_rehash.cpp b/src/commands/cmd_rehash.cpp index d0e1882a7..760689eb0 100644 --- a/src/commands/cmd_rehash.cpp +++ b/src/commands/cmd_rehash.cpp @@ -22,7 +22,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandRehash(Instance); } -CmdResult CommandRehash::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandRehash::Handle (const char* const* parameters, int pcnt, User *user) { user->WriteServ("382 %s %s :Rehashing",user->nick,ServerConfig::CleanFilename(ServerInstance->ConfigFileName)); std::string parameter; diff --git a/src/commands/cmd_reloadmodule.cpp b/src/commands/cmd_reloadmodule.cpp index b5b6cbef4..015160257 100644 --- a/src/commands/cmd_reloadmodule.cpp +++ b/src/commands/cmd_reloadmodule.cpp @@ -19,7 +19,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandReloadmodule(Instance); } -CmdResult CommandReloadmodule::Handle (const char** parameters, int, User *user) +CmdResult CommandReloadmodule::Handle (const char* const* parameters, int, User *user) { if (ServerInstance->Modules->Unload(parameters[0])) { diff --git a/src/commands/cmd_restart.cpp b/src/commands/cmd_restart.cpp index b22bb774b..379052a1e 100644 --- a/src/commands/cmd_restart.cpp +++ b/src/commands/cmd_restart.cpp @@ -19,7 +19,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandRestart(Instance); } -CmdResult CommandRestart::Handle (const char** parameters, int, User *user) +CmdResult CommandRestart::Handle (const char* const* parameters, int, User *user) { ServerInstance->Log(DEFAULT,"Restart: %s",user->nick); if (!ServerInstance->PassCompare(user, ServerInstance->Config->restartpass, parameters[0], ServerInstance->Config->powerhash)) diff --git a/src/commands/cmd_rules.cpp b/src/commands/cmd_rules.cpp index d38e5eefc..685d04389 100644 --- a/src/commands/cmd_rules.cpp +++ b/src/commands/cmd_rules.cpp @@ -19,7 +19,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandRules(Instance); } -CmdResult CommandRules::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandRules::Handle (const char* const* parameters, int pcnt, User *user) { user->ShowRULES(); return CMD_SUCCESS; diff --git a/src/commands/cmd_server.cpp b/src/commands/cmd_server.cpp index 282f4eec5..f4c12f7e3 100644 --- a/src/commands/cmd_server.cpp +++ b/src/commands/cmd_server.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandServer(Instance); } -CmdResult CommandServer::Handle (const char**, int, User *user) +CmdResult CommandServer::Handle (const char* const*, int, User *user) { user->WriteServ("666 %s :You cannot identify as a server, you are a USER. IRC Operators informed.",user->nick); ServerInstance->SNO->WriteToSnoMask('A', "WARNING: %s attempted to issue a SERVER command and is registered as a user!", user->nick); diff --git a/src/commands/cmd_squit.cpp b/src/commands/cmd_squit.cpp index f51bc42b9..e98790380 100644 --- a/src/commands/cmd_squit.cpp +++ b/src/commands/cmd_squit.cpp @@ -24,7 +24,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandSquit(Instance); } -CmdResult CommandSquit::Handle (const char**, int, User *user) +CmdResult CommandSquit::Handle (const char* const*, int, User *user) { user->WriteServ( "NOTICE %s :Look into loading a linking module (like m_spanningtree) if you want this to do anything useful.", user->nick); return CMD_FAILURE; diff --git a/src/commands/cmd_stats.cpp b/src/commands/cmd_stats.cpp index 72bdc69bd..f2292c2e0 100644 --- a/src/commands/cmd_stats.cpp +++ b/src/commands/cmd_stats.cpp @@ -31,7 +31,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandStats(Instance); } -CmdResult CommandStats::Handle (const char** parameters, int /* pcnt */, User *user) +CmdResult CommandStats::Handle (const char* const* parameters, int /* pcnt */, User *user) { if (IS_LOCAL(user)) { diff --git a/src/commands/cmd_time.cpp b/src/commands/cmd_time.cpp index f5bb86b3d..a62d46d7a 100644 --- a/src/commands/cmd_time.cpp +++ b/src/commands/cmd_time.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandTime(Instance); } -CmdResult CommandTime::Handle (const char**, int, User *user) +CmdResult CommandTime::Handle (const char* const*, int, User *user) { struct tm* timeinfo; time_t local = ServerInstance->Time(); diff --git a/src/commands/cmd_topic.cpp b/src/commands/cmd_topic.cpp index 3e7f23c65..46c26806f 100644 --- a/src/commands/cmd_topic.cpp +++ b/src/commands/cmd_topic.cpp @@ -20,7 +20,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandTopic(Instance); } -CmdResult CommandTopic::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandTopic::Handle (const char* const* parameters, int pcnt, User *user) { Channel* Ptr; diff --git a/src/commands/cmd_trace.cpp b/src/commands/cmd_trace.cpp index 1b7f83694..5480c03a5 100644 --- a/src/commands/cmd_trace.cpp +++ b/src/commands/cmd_trace.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) /** XXX: This is crap. someone fix this when you have time, to be more useful. */ -CmdResult CommandTrace::Handle (const char**, int, User *user) +CmdResult CommandTrace::Handle (const char* const*, int, User *user) { /*for (user_hash::iterator i = ServerInstance->clientlist->begin(); i != ServerInstance->clientlist->end(); i++) { diff --git a/src/commands/cmd_unloadmodule.cpp b/src/commands/cmd_unloadmodule.cpp index 6d95ee656..a01623b64 100644 --- a/src/commands/cmd_unloadmodule.cpp +++ b/src/commands/cmd_unloadmodule.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandUnloadmodule(Instance); } -CmdResult CommandUnloadmodule::Handle (const char** parameters, int, User *user) +CmdResult CommandUnloadmodule::Handle (const char* const* parameters, int, User *user) { if (ServerInstance->Modules->Unload(parameters[0])) { diff --git a/src/commands/cmd_user.cpp b/src/commands/cmd_user.cpp index be49deeac..8f056d83f 100644 --- a/src/commands/cmd_user.cpp +++ b/src/commands/cmd_user.cpp @@ -19,7 +19,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandUser(Instance); } -CmdResult CommandUser::Handle (const char** parameters, int, User *user) +CmdResult CommandUser::Handle (const char* const* parameters, int, User *user) { /* A user may only send the USER command once */ if (!(user->registered & REG_USER)) diff --git a/src/commands/cmd_userhost.cpp b/src/commands/cmd_userhost.cpp index d6b34456f..c8a33535f 100644 --- a/src/commands/cmd_userhost.cpp +++ b/src/commands/cmd_userhost.cpp @@ -19,7 +19,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandUserhost(Instance); } -CmdResult CommandUserhost::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandUserhost::Handle (const char* const* parameters, int pcnt, User *user) { std::string retbuf = std::string("302 ") + user->nick + " :"; diff --git a/src/commands/cmd_version.cpp b/src/commands/cmd_version.cpp index b65c885f7..51e9e771a 100644 --- a/src/commands/cmd_version.cpp +++ b/src/commands/cmd_version.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandVersion(Instance); } -CmdResult CommandVersion::Handle (const char**, int, User *user) +CmdResult CommandVersion::Handle (const char* const*, int, User *user) { user->WriteServ("351 %s :%s",user->nick,ServerInstance->GetVersionString().c_str()); ServerInstance->Config->Send005(user); diff --git a/src/commands/cmd_wallops.cpp b/src/commands/cmd_wallops.cpp index 0283122cd..cd8995ad8 100644 --- a/src/commands/cmd_wallops.cpp +++ b/src/commands/cmd_wallops.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandWallops(Instance); } -CmdResult CommandWallops::Handle (const char** parameters, int, User *user) +CmdResult CommandWallops::Handle (const char* const* parameters, int, User *user) { user->WriteWallOps(std::string(parameters[0])); FOREACH_MOD(I_OnWallops,OnWallops(user,parameters[0])); diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index a54623672..d26cd918d 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -165,7 +165,7 @@ void CommandWho::SendWhoLine(User* user, const std::string &initial, Channel* ch whoresults.push_back(wholine); } -CmdResult CommandWho::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandWho::Handle (const char* const* parameters, int pcnt, User *user) { /* * XXX - RFC says: diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp index 11456ca1b..889fa3e71 100644 --- a/src/commands/cmd_whois.cpp +++ b/src/commands/cmd_whois.cpp @@ -91,7 +91,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandWhois(Instance); } -CmdResult CommandWhois::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandWhois::Handle (const char* const* parameters, int pcnt, User *user) { User *dest; int userindex = 0; diff --git a/src/commands/cmd_whowas.cpp b/src/commands/cmd_whowas.cpp index 7b44a0290..fd9544853 100644 --- a/src/commands/cmd_whowas.cpp +++ b/src/commands/cmd_whowas.cpp @@ -28,7 +28,7 @@ CommandWhowas::CommandWhowas(InspIRCd* Instance) : Command(Instance, "WHOWAS", 0 Instance->Timers->AddTimer(timer); } -CmdResult CommandWhowas::Handle (const char** parameters, int, User* user) +CmdResult CommandWhowas::Handle (const char* const* parameters, int, User* user) { /* if whowas disabled in config */ if (ServerInstance->Config->WhoWasGroupSize == 0 || ServerInstance->Config->WhoWasMaxGroups == 0) diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp index 2a12ee5b5..c4bc750c7 100644 --- a/src/commands/cmd_zline.cpp +++ b/src/commands/cmd_zline.cpp @@ -22,7 +22,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandZline(Instance); } -CmdResult CommandZline::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandZline::Handle (const char* const* parameters, int pcnt, User *user) { std::string target = parameters[0]; diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 71d9f0ca9..ebd03fed2 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -396,7 +396,7 @@ irc::stringjoiner::stringjoiner(const std::string &seperator, const std::dequeParser->CallHandler(commandname,parameters,pcnt,user); } @@ -739,7 +739,7 @@ void InspIRCd::AddCommand(Command *f) } } -void InspIRCd::SendMode(const char** parameters, int pcnt, User *user) +void InspIRCd::SendMode(const char* const* parameters, int pcnt, User *user) { this->Modes->Process(parameters,pcnt,user,true); } diff --git a/src/modules/extra/m_rline.cpp b/src/modules/extra/m_rline.cpp index fb8887032..189479efc 100644 --- a/src/modules/extra/m_rline.cpp +++ b/src/modules/extra/m_rline.cpp @@ -131,7 +131,7 @@ class CommandRLine : public Command this->source = "m_rline.so"; } - CmdResult Handle (const char** parameters, int pcnt, User *user) + CmdResult Handle (const char* const* parameters, int pcnt, User *user) { if (pcnt >= 3) diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp index 7bb5ea1f1..ac38ed61c 100644 --- a/src/modules/extra/m_sqllog.cpp +++ b/src/modules/extra/m_sqllog.cpp @@ -276,7 +276,7 @@ class ModuleSQLLog : public Module return 0; } - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line) + virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line) { if ((command == "GLINE" || command == "KLINE" || command == "ELINE" || command == "ZLINE") && validated) { diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index 22034303d..a1e28bafe 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -68,7 +68,7 @@ public: databaseid = Conf.ReadValue("sqloper", "dbid", 0); /* Database ID of a database configured for the service provider module */ } - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line) + virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line) { if ((validated) && (command == "OPER")) { diff --git a/src/modules/extra/m_ssl_oper_cert.cpp b/src/modules/extra/m_ssl_oper_cert.cpp index f82537c95..312ec874b 100644 --- a/src/modules/extra/m_ssl_oper_cert.cpp +++ b/src/modules/extra/m_ssl_oper_cert.cpp @@ -33,7 +33,7 @@ class cmd_fingerprint : public Command syntax = ""; } - CmdResult Handle (const char** parameters, int pcnt, User *user) + CmdResult Handle (const char* const* parameters, int pcnt, User *user) { User* target = ServerInstance->FindNick(parameters[0]); if (target) @@ -112,7 +112,7 @@ class ModuleOperSSLCert : public Module return false; } - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line) + virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line) { irc::string cmd = command.c_str(); diff --git a/src/modules/extra/m_sslinfo.cpp b/src/modules/extra/m_sslinfo.cpp index 00fc2ee5b..b16c7f0ee 100644 --- a/src/modules/extra/m_sslinfo.cpp +++ b/src/modules/extra/m_sslinfo.cpp @@ -33,7 +33,7 @@ class cmd_sslinfo : public Command this->syntax = ""; } - CmdResult Handle (const char** parameters, int pcnt, User *user) + CmdResult Handle (const char* const* parameters, int pcnt, User *user) { User* target = ServerInstance->FindNick(parameters[0]); ssl_cert* cert; diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 1e7c87241..e1600e9c6 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -126,7 +126,7 @@ class ModuleAlias : public Module } } - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line) + virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line) { User *u = NULL; diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index b5f4968d0..83dbe53b8 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -25,7 +25,7 @@ class CommandAlltime : public Command translation.push_back(TR_END); } - CmdResult Handle(const char **parameters, int pcnt, User *user) + CmdResult Handle(const char* const* parameters, int pcnt, User *user) { char fmtdate[64]; char fmtdate2[64]; diff --git a/src/modules/m_antibear.cpp b/src/modules/m_antibear.cpp index 2db7f58f3..53d267228 100644 --- a/src/modules/m_antibear.cpp +++ b/src/modules/m_antibear.cpp @@ -38,7 +38,7 @@ class ModuleAntiBear : public Module } - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line) + virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line) { if (command == "NOTICE" && !validated && pcnt > 1 && user->GetExt("antibear_timewait")) { diff --git a/src/modules/m_antibottler.cpp b/src/modules/m_antibottler.cpp index 80b55ea78..5a1e9a361 100644 --- a/src/modules/m_antibottler.cpp +++ b/src/modules/m_antibottler.cpp @@ -37,7 +37,7 @@ class ModuleAntiBottler : public Module return Version(1,1,0,1,VF_VENDOR,API_VERSION); } - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line) + virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line) { char data[MAXBUF]; strlcpy(data,original_line.c_str(),MAXBUF); diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp index 08bdcba33..8d66ff052 100644 --- a/src/modules/m_blockamsg.cpp +++ b/src/modules/m_blockamsg.cpp @@ -84,7 +84,7 @@ class ModuleBlockAmsg : public Module action = IBLOCK_KILLOPERS; } - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line) + virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line) { // Don't do anything with unregistered users, or remote ones. if(!user || (user->registered != REG_ALL) || !IS_LOCAL(user)) diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 2783cd484..e6b740520 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -93,7 +93,7 @@ public: * /accept nick1,nick2,nick3 * * to add 3 nicks and then show your list */ - CmdResult Handle(const char** parameters, int pcnt, User* user) + CmdResult Handle(const char* const* parameters, int pcnt, User* user) { if (pcnt < 1) { diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index f13a3b97a..f74c5d58e 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -54,7 +54,7 @@ class CommandCban : public Command TRANSLATE4(TR_TEXT,TR_TEXT,TR_TEXT,TR_END); } - CmdResult Handle(const char** parameters, int pcnt, User *user) + CmdResult Handle(const char* const* parameters, int pcnt, User *user) { /* syntax: CBAN #channel time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index c1f6cf89e..633e95af9 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -61,7 +61,7 @@ class CommandWebirc : public Command this->source = "m_cgiirc.so"; this->syntax = "password client hostname ip"; } - CmdResult Handle(const char** parameters, int pcnt, User *user) + CmdResult Handle(const char* const* parameters, int pcnt, User *user) { if(user->registered == REG_ALL) return CMD_FAILURE; diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index e678ec1cb..14468ab36 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -27,7 +27,7 @@ class CommandCheck : public Command syntax = "|||"; } - CmdResult Handle (const char** parameters, int pcnt, User *user) + CmdResult Handle (const char* const* parameters, int pcnt, User *user) { User *targuser; Channel *targchan; diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 005e71c8f..913921e8c 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -29,7 +29,7 @@ class CommandChghost : public Command TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } - CmdResult Handle(const char** parameters, int pcnt, User *user) + CmdResult Handle(const char* const* parameters, int pcnt, User *user) { const char * x = parameters[1]; diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 8e47e87e6..6f8528ef0 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -27,7 +27,7 @@ class CommandChgident : public Command TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } - CmdResult Handle(const char** parameters, int pcnt, User *user) + CmdResult Handle(const char* const* parameters, int pcnt, User *user) { User* dest = ServerInstance->FindNick(parameters[0]); diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index f4d41ab8d..b2fafbf38 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -27,7 +27,7 @@ class CommandChgname : public Command TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } - CmdResult Handle(const char** parameters, int pcnt, User *user) + CmdResult Handle(const char* const* parameters, int pcnt, User *user) { User* dest = ServerInstance->FindNick(parameters[0]); diff --git a/src/modules/m_clones.cpp b/src/modules/m_clones.cpp index eb2c6cd3d..a2b4e35fa 100644 --- a/src/modules/m_clones.cpp +++ b/src/modules/m_clones.cpp @@ -27,7 +27,7 @@ class CommandClones : public Command syntax = ""; } - CmdResult Handle (const char** parameters, int pcnt, User *user) + CmdResult Handle (const char* const* parameters, int pcnt, User *user) { std::string clonesstr = "304 " + std::string(user->nick) + " :CLONES"; diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp index da3760de1..ebffc6864 100644 --- a/src/modules/m_close.cpp +++ b/src/modules/m_close.cpp @@ -24,7 +24,7 @@ class CommandClose : public Command this->source = "m_close.so"; } - CmdResult Handle (const char** parameters, int pcnt, User *user) + CmdResult Handle (const char* const* parameters, int pcnt, User *user) { std::map closed; diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp index 3b63f07a7..0a9ce3b8f 100644 --- a/src/modules/m_conn_waitpong.cpp +++ b/src/modules/m_conn_waitpong.cpp @@ -69,7 +69,7 @@ class ModuleWaitPong : public Module return 0; } - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User* user, bool validated, const std::string &original_line) + virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User* user, bool validated, const std::string &original_line) { if (command == "PONG") { diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index 6bde81c67..185055a5d 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -43,7 +43,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist) return false; } - CmdResult Handle(const char** parameters, int pcnt, User* user) + CmdResult Handle(const char* const* parameters, int pcnt, User* user) { if (!IS_LOCAL(user)) return CMD_LOCALONLY; diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp index e8714bb5c..882d4232e 100644 --- a/src/modules/m_cycle.cpp +++ b/src/modules/m_cycle.cpp @@ -27,7 +27,7 @@ class CommandCycle : public Command TRANSLATE3(TR_TEXT, TR_TEXT, TR_END); } - CmdResult Handle (const char** parameters, int pcnt, User *user) + CmdResult Handle (const char* const* parameters, int pcnt, User *user) { Channel* channel = ServerInstance->FindChan(parameters[0]); std::string reason = ConvToStr("Cycling"); diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index cdc8dc9c1..572188b7c 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -54,7 +54,7 @@ class CommandDccallow : public Command /* XXX we need to fix this so it can work with translation stuff (i.e. move +- into a seperate param */ } - CmdResult Handle(const char **parameters, int pcnt, User *user) + CmdResult Handle(const char* const* parameters, int pcnt, User *user) { /* syntax: DCCALLOW [+|-] (