aboutsummaryrefslogtreecommitdiff
path: root/src/coremods
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-08-17 15:54:36 +0100
committerGravatar Sadie Powell2022-08-17 15:54:36 +0100
commitdb43d4aa8948bff7357c294323e04ae7fca1dc83 (patch)
tree32eec1b792705df60d662a6caa02d71b07e8c206 /src/coremods
parentBackport fix for types removed in C++17 from master. (diff)
Fix some warnings in core_who on newer GCC.
Diffstat (limited to 'src/coremods')
-rw-r--r--src/coremods/core_who.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp
index 4140711a3..718814c2b 100644
--- a/src/coremods/core_who.cpp
+++ b/src/coremods/core_who.cpp
@@ -124,7 +124,8 @@ class CommandWho : public SplitCommand
void BuildOpLevels()
{
// Build a map of prefixes ordered descending by their rank.
- std::multimap<unsigned int, const PrefixMode*, std::greater<unsigned int> > ranks;
+ typedef std::multimap<unsigned int, const PrefixMode*, std::greater<unsigned int> > RankMap;
+ RankMap ranks;
const ModeParser::PrefixModeList& modes = ServerInstance->Modes.GetPrefixModes();
for (ModeParser::PrefixModeList::const_iterator iter = modes.begin(); iter != modes.end(); ++iter)
{
@@ -133,9 +134,9 @@ class CommandWho : public SplitCommand
}
// Now we have the ranks ordered we can assign them levels.
- unsigned int lastrank;
+ unsigned int lastrank = 0;
unsigned int oplevel = 0;
- for (std::multimap<unsigned int, const PrefixMode*>::const_iterator iter = ranks.begin(); iter != ranks.end(); ++iter)
+ for (RankMap::const_iterator iter = ranks.begin(); iter != ranks.end(); ++iter)
{
const PrefixMode* pm = iter->second;
if (iter != ranks.begin() && pm->GetPrefixRank() != lastrank)