summaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-20 19:07:07 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-20 19:07:07 +0000
commitdd36852a52e8541306b76c5b88bce8ab9b36654c (patch)
tree045b4eb051d43ca64f395b15f7b190f2159d51f0 /src/command_parse.cpp
parent5509c602cb8783ceadf8028ff80c5dbeb4818704 (diff)
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
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r--src/command_parse.cpp8
1 files changed, 4 insertions, 4 deletions
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))