diff options
| author | 2022-09-07 21:09:09 +0100 | |
|---|---|---|
| committer | 2022-09-07 22:36:02 +0100 | |
| commit | de2392833ec17a9deb865fdac0af73275fd960ff (patch) | |
| tree | 4f552c9633725bd1bd57367286652b9d2881279e /src | |
| parent | Fix more warnings discovered with -Weverything. (diff) | |
Default allow_empty_last_param to false.
Diffstat (limited to 'src')
41 files changed, 14 insertions, 32 deletions
diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp index bcce17cbd..35a84c51d 100644 --- a/src/coremods/core_channel/cmd_kick.cpp +++ b/src/coremods/core_channel/cmd_kick.cpp @@ -40,6 +40,7 @@ enum CommandKick::CommandKick(Module* parent) : Command(parent, "KICK", 2, 3) { + allow_empty_last_param = true; syntax = { "<channel> <nick>[,<nick>]+ [:<reason>]" }; } diff --git a/src/coremods/core_channel/cmd_topic.cpp b/src/coremods/core_channel/cmd_topic.cpp index ff2a058ab..9a3f46ab2 100644 --- a/src/coremods/core_channel/cmd_topic.cpp +++ b/src/coremods/core_channel/cmd_topic.cpp @@ -46,6 +46,7 @@ CommandTopic::CommandTopic(Module* parent) , secretmode(parent, "secret") , topiclockmode(parent, "topiclock") { + allow_empty_last_param = true; syntax = { "<channel> [:<topic>]" }; Penalty = 2; } diff --git a/src/coremods/core_info/cmd_servlist.cpp b/src/coremods/core_info/cmd_servlist.cpp index b9e8c6656..9cb57ed53 100644 --- a/src/coremods/core_info/cmd_servlist.cpp +++ b/src/coremods/core_info/cmd_servlist.cpp @@ -32,7 +32,6 @@ CommandServList::CommandServList(Module* parent) : SplitCommand(parent, "SERVLIST") , invisiblemode(parent, "invisible") { - allow_empty_last_param = false; syntax = { "[<nick> [<oper-type>]]" }; } diff --git a/src/coremods/core_list.cpp b/src/coremods/core_list.cpp index 6b30957f8..2c6253c45 100644 --- a/src/coremods/core_list.cpp +++ b/src/coremods/core_list.cpp @@ -55,7 +55,6 @@ public: , secretmode(creator, "secret") , privatemode(creator, "private") { - allow_empty_last_param = false; Penalty = 5; } diff --git a/src/coremods/core_message.cpp b/src/coremods/core_message.cpp index 481f4e325..b7b301153 100644 --- a/src/coremods/core_message.cpp +++ b/src/coremods/core_message.cpp @@ -277,6 +277,7 @@ public: : Command(parent, ClientProtocol::Messages::Privmsg::CommandStrFromMsgType(mt), 2, 2) , msgtype(mt) { + allow_empty_last_param = true; syntax = { "<target>[,<target>]+ :<message>" }; } @@ -338,6 +339,7 @@ public: CommandSQuery(Module* Creator) : Command(Creator, "SQUERY", 2, 2) { + allow_empty_last_param = true; syntax = { "<service> :<message>" }; translation = { TR_NICK, TR_TEXT }; } diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp index 727fc1569..3fe7171b2 100644 --- a/src/coremods/core_stats.cpp +++ b/src/coremods/core_stats.cpp @@ -50,7 +50,6 @@ public: : Command(Creator, "STATS", 1, 2) , statsevprov(Creator, "event/stats") { - allow_empty_last_param = false; syntax = { "<symbol> [<servername>]" }; } diff --git a/src/coremods/core_user/cmd_away.cpp b/src/coremods/core_user/cmd_away.cpp index 3c72ecdf6..a5b8a0fa6 100644 --- a/src/coremods/core_user/cmd_away.cpp +++ b/src/coremods/core_user/cmd_away.cpp @@ -38,7 +38,6 @@ CommandAway::CommandAway(Module* parent) : Command(parent, "AWAY", 0, 1) , awayevprov(parent) { - allow_empty_last_param = false; syntax = { "[:<message>]" }; } diff --git a/src/coremods/core_user/cmd_nick.cpp b/src/coremods/core_user/cmd_nick.cpp index 5cfd60018..46adea51d 100644 --- a/src/coremods/core_user/cmd_nick.cpp +++ b/src/coremods/core_user/cmd_nick.cpp @@ -37,6 +37,7 @@ enum CommandNick::CommandNick(Module* parent) : SplitCommand(parent, "NICK", 1) { + allow_empty_last_param = true; works_before_reg = true; syntax = { "<newnick>" }; Penalty = 0; diff --git a/src/coremods/core_user/cmd_part.cpp b/src/coremods/core_user/cmd_part.cpp index 3fb25628a..1db5a6f37 100644 --- a/src/coremods/core_user/cmd_part.cpp +++ b/src/coremods/core_user/cmd_part.cpp @@ -33,6 +33,7 @@ CommandPart::CommandPart(Module* parent) : Command(parent, "PART", 1, 2) { + allow_empty_last_param = true; Penalty = 5; syntax = { "<channel>[,<channel>]+ [:<reason>]" }; } diff --git a/src/coremods/core_user/cmd_quit.cpp b/src/coremods/core_user/cmd_quit.cpp index b5e271405..22f0c2aef 100644 --- a/src/coremods/core_user/cmd_quit.cpp +++ b/src/coremods/core_user/cmd_quit.cpp @@ -30,6 +30,7 @@ CommandQuit::CommandQuit(Module* parent) : Command(parent, "QUIT", 0, 1) , operquit(parent, "operquit", ExtensionType::USER, true) { + allow_empty_last_param = true; works_before_reg = true; syntax = { "[:<message>]" }; } diff --git a/src/coremods/core_user/cmd_user.cpp b/src/coremods/core_user/cmd_user.cpp index b114dd452..6018bf964 100644 --- a/src/coremods/core_user/cmd_user.cpp +++ b/src/coremods/core_user/cmd_user.cpp @@ -36,7 +36,6 @@ enum CommandUser::CommandUser(Module* parent) : SplitCommand(parent, "USER", 4, 4) { - allow_empty_last_param = false; works_before_reg = true; Penalty = 0; syntax = { "<username> <unused> <unused> :<realname>" }; diff --git a/src/coremods/core_user/core_user.h b/src/coremods/core_user/core_user.h index 5997bafa1..619d0c4ba 100644 --- a/src/coremods/core_user/core_user.h +++ b/src/coremods/core_user/core_user.h @@ -73,7 +73,6 @@ public: CommandIson(Module* parent) : SplitCommand(parent, "ISON", 1) { - allow_empty_last_param = false; syntax = { "<nick> [<nick>]+" }; } @@ -141,7 +140,6 @@ public: : Command(parent,"USERHOST", 1) , hideopermode(parent, "hideoper") { - allow_empty_last_param = false; syntax = { "<nick> [<nick>]+" }; } diff --git a/src/coremods/core_wallops.cpp b/src/coremods/core_wallops.cpp index dced60c8a..5b08c35fe 100644 --- a/src/coremods/core_wallops.cpp +++ b/src/coremods/core_wallops.cpp @@ -38,6 +38,7 @@ public: , protoevprov(parent, name) { access_needed = CmdAccess::OPERATOR; + allow_empty_last_param = true; syntax = { ":<message>" }; } diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp index f211b522d..bc527cfde 100644 --- a/src/coremods/core_who.cpp +++ b/src/coremods/core_who.cpp @@ -205,7 +205,6 @@ public: , whoevprov(parent, "event/who") , whomatchevprov(parent, "event/who-match") { - allow_empty_last_param = false; syntax = { "<server>|<nick>|<channel>|<realname>|<host>|0 [Aafhilmnoprstux]%[acdfhilnorstu]", "<unused> [Aafhilmnoprstux]%[acdfhilnorstu] :<server>|<nick>|<channel>|<realname>|<host>|0]" diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index ccc4c3f08..3503b3554 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -188,7 +188,6 @@ public: CommandAccept(Module* Creator) : Command(Creator, "ACCEPT", 1), extInfo(Creator) { - allow_empty_last_param = false; syntax = { "*|(+|-)<nick>[,(+|-)<nick>]+" }; translation = { TR_CUSTOM }; } diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 25b4dbc9e..f857ca5cd 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -35,7 +35,6 @@ public: CommandChghost(Module* Creator) : Command(Creator,"CHGHOST", 2) { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { "<nick> <host>" }; translation = { TR_NICK, TR_TEXT }; diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 5fe6daf46..5f247b4ff 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -35,7 +35,6 @@ class CommandChgident final public: CommandChgident(Module* Creator) : Command(Creator,"CHGIDENT", 2) { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { "<nick> <ident>" }; translation = { TR_NICK, TR_TEXT }; diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index f9a311233..7448c8299 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -33,7 +33,6 @@ class CommandChgname final public: CommandChgname(Module* Creator) : Command(Creator,"CHGNAME", 2, 2) { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { "<nick> :<realname>" }; translation = { TR_NICK, TR_TEXT }; diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 059c28761..c436f5b7d 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -194,7 +194,6 @@ public: : Command(parent, "DCCALLOW", 0) , ext(Ext) { - allow_empty_last_param = false; syntax = { "[(+|-)<nick> [<time>]]", "LIST", "HELP" }; /* XXX we need to fix this so it can work with translation stuff (i.e. move +- into a seperate param */ } diff --git a/src/modules/m_gateway.cpp b/src/modules/m_gateway.cpp index d4a9a3d7b..dbdc0cbf0 100644 --- a/src/modules/m_gateway.cpp +++ b/src/modules/m_gateway.cpp @@ -133,7 +133,6 @@ public: CommandHexIP(Module* Creator) : SplitCommand(Creator, "HEXIP", 1) { - allow_empty_last_param = false; Penalty = 2; syntax = { "<hex-ip|raw-ip>" }; } @@ -247,7 +246,6 @@ public: , sslapi(Creator) , webircevprov(Creator, "event/webirc") { - allow_empty_last_param = false; works_before_reg = true; syntax = { "<password> <gateway> <hostname> <ip> [<flags>]" }; } diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index e1f5e7292..a40115df9 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -34,7 +34,6 @@ public: : Command(Creator,"GLOADMODULE", 1) { access_needed = CmdAccess::OPERATOR; - allow_empty_last_param = false; syntax = { "<modulename> [<servermask>]" }; } @@ -74,7 +73,6 @@ public: : Command(Creator,"GUNLOADMODULE", 1) { access_needed = CmdAccess::OPERATOR; - allow_empty_last_param = false; syntax = { "<modulename> [<servermask>]" }; } @@ -126,7 +124,6 @@ public: : Command(Creator, "GRELOADMODULE", 1) { access_needed = CmdAccess::OPERATOR; - allow_empty_last_param = false; syntax = { "<modulename> [<servermask>]" }; } diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index d34b1f931..760d41488 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -35,6 +35,7 @@ public: CommandGlobops(Module* Creator) : Command(Creator,"GLOBOPS", 1,1) { access_needed = CmdAccess::OPERATOR; + allow_empty_last_param = true; syntax = { ":<message>" }; } diff --git a/src/modules/m_ircv3_ctctags.cpp b/src/modules/m_ircv3_ctctags.cpp index d9ff1d3d3..4729c4b6c 100644 --- a/src/modules/m_ircv3_ctctags.cpp +++ b/src/modules/m_ircv3_ctctags.cpp @@ -215,7 +215,6 @@ public: , tagevprov(Creator, "event/tagmsg") , msgevprov(Creator, "TAGMSG") { - allow_empty_last_param = false; } CmdResult Handle(User* user, const Params& parameters) override diff --git a/src/modules/m_monitor.cpp b/src/modules/m_monitor.cpp index 3ca8030f1..a97d0fefa 100644 --- a/src/modules/m_monitor.cpp +++ b/src/modules/m_monitor.cpp @@ -311,7 +311,6 @@ public: , manager(managerref) { Penalty = 2; - allow_empty_last_param = false; syntax = { "C", "L", "S", "(+|-) <nick>[,<nick>]+" }; } diff --git a/src/modules/m_rmode.cpp b/src/modules/m_rmode.cpp index 78d9ff4e2..d351becad 100644 --- a/src/modules/m_rmode.cpp +++ b/src/modules/m_rmode.cpp @@ -30,7 +30,6 @@ class CommandRMode final public: CommandRMode(Module* Creator) : Command(Creator,"RMODE", 2, 3) { - allow_empty_last_param = false; syntax = { "<channel> <mode> [<pattern>]" }; } diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 40cb14a81..3f710033d 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -38,7 +38,6 @@ public: : Command(Creator,"SAJOIN", 1) , servprotectmode(Creator, "servprotect") { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { "[<nick>] <channel>[,<channel>]+" }; translation = { TR_NICK, TR_TEXT }; diff --git a/src/modules/m_sakick.cpp b/src/modules/m_sakick.cpp index 7175d5ae2..28fd9c54a 100644 --- a/src/modules/m_sakick.cpp +++ b/src/modules/m_sakick.cpp @@ -36,6 +36,7 @@ public: , servprotectmode(Creator, "servprotect") { access_needed = CmdAccess::OPERATOR; + allow_empty_last_param = true; syntax = { "<channel> <nick> [:<reason>]" }; translation = { TR_TEXT, TR_NICK, TR_TEXT }; } diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index fd2ecb37f..5aadffb51 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -37,7 +37,6 @@ public: bool active; CommandSamode(Module* Creator) : Command(Creator,"SAMODE", 2) { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { "<target> (+|-)<modes> [<mode-parameters>]" }; active = false; diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index 466856008..8d1bd55d7 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -36,7 +36,6 @@ public: : Command(Creator,"SANICK", 2) , servprotectmode(Creator, "servprotect") { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { "<nick> <newnick>" }; translation = { TR_NICK, TR_TEXT }; diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 68399f794..629236240 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -37,6 +37,7 @@ public: , servprotectmode(Creator, "servprotect") { access_needed = CmdAccess::OPERATOR; + allow_empty_last_param = true; syntax = { "<nick> <channel>[,<channel>]+ [:<reason>]" }; translation = { TR_NICK, TR_TEXT, TR_TEXT }; } diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 48cd996f2..442a40e6b 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -330,7 +330,6 @@ public: , sslapi(Creator) { works_before_reg = true; - allow_empty_last_param = false; } CmdResult HandleLocal(LocalUser* user, const Params& parameters) override diff --git a/src/modules/m_satopic.cpp b/src/modules/m_satopic.cpp index a52a784d3..450b332eb 100644 --- a/src/modules/m_satopic.cpp +++ b/src/modules/m_satopic.cpp @@ -34,6 +34,7 @@ public: CommandSATopic(Module* Creator) : Command(Creator,"SATOPIC", 2, 2) { access_needed = CmdAccess::OPERATOR; + allow_empty_last_param = true; syntax = { "<channel> :<topic>" }; } diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index e678cb3a3..dac4fdae7 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -34,7 +34,6 @@ public: CommandSethost(Module* Creator) : Command(Creator,"SETHOST", 1) { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { "<host>" }; } diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp index a8d89cc89..f9013718a 100644 --- a/src/modules/m_setident.cpp +++ b/src/modules/m_setident.cpp @@ -33,7 +33,6 @@ class CommandSetident final public: CommandSetident(Module* Creator) : Command(Creator,"SETIDENT", 1) { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { "<ident>" }; } diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index e2649aace..e94f425f0 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -42,7 +42,6 @@ public: , fail(Creator) , cap(Creator, "setname") { - allow_empty_last_param = false; syntax = { ":<realname>" }; } diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index 5802a768d..d2d989cc7 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -351,7 +351,6 @@ public: , msgprov(Creator, "SILENCE") , ext(Creator) { - allow_empty_last_param = false; syntax = { "[(+|-)<mask> [CcdiNnPpTtx]]" }; } diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index 0abd3634c..1df272e41 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -37,7 +37,6 @@ CommandMap::CommandMap(Module* Creator) : Command(Creator, "MAP", 0, 1) { - allow_empty_last_param = false; Penalty = 2; } diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index dd054cbf0..c65f119e6 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -255,7 +255,6 @@ public: , sslonlymode(Creator, "sslonly") , sslapi(Creator) { - allow_empty_last_param = false; syntax = { "<channel|nick>" }; } diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index 89d5f2d76..e19252911 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -40,6 +40,7 @@ public: , swhois(Creator, "swhois", ExtensionType::USER, true) { access_needed = CmdAccess::OPERATOR; + allow_empty_last_param = true; syntax = { "<nick> :<swhois>" }; translation = { TR_NICK, TR_TEXT }; } diff --git a/src/modules/m_topiclock.cpp b/src/modules/m_topiclock.cpp index 744e63ddb..d27dc7866 100644 --- a/src/modules/m_topiclock.cpp +++ b/src/modules/m_topiclock.cpp @@ -33,6 +33,7 @@ public: : Command(Creator, "SVSTOPIC", 1, 4) { access_needed = CmdAccess::SERVER; + allow_empty_last_param = true; } CmdResult Handle(User* user, const Params& parameters) override diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index e16588233..43331eb20 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -129,7 +129,6 @@ public: : SplitCommand(mod, "WATCH") , manager(managerref) { - allow_empty_last_param = false; syntax = { "C", "L", "l", "S", "(+|-)<nick> [(+|-)<nick>]+" }; } |
