diff options
| author | 2021-05-30 20:37:54 +0100 | |
|---|---|---|
| committer | 2021-05-30 20:37:54 +0100 | |
| commit | 02340285c564a7e82105137192d46d554a6fce3a (patch) | |
| tree | 696d1a6249841de62c3fed70310c2a347fc66732 /src/modules/m_customprefix.cpp | |
| parent | Add a workaround for a bug in GitHub Actions. (diff) | |
Added -Wshorten-64-to-32 and fixed all warnings.
Diffstat (limited to 'src/modules/m_customprefix.cpp')
| -rw-r--r-- | src/modules/m_customprefix.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/m_customprefix.cpp b/src/modules/m_customprefix.cpp index aa71fd3c1..487b71060 100644 --- a/src/modules/m_customprefix.cpp +++ b/src/modules/m_customprefix.cpp @@ -31,9 +31,9 @@ class CustomPrefixMode : public PrefixMode : PrefixMode(parent, Name, Letter, 0, Prefix) , tag(Tag) { - unsigned long rank = tag->getUInt("rank", 0, 0, UINT_MAX); - unsigned long setrank = tag->getUInt("ranktoset", prefixrank, rank, UINT_MAX); - unsigned long unsetrank = tag->getUInt("ranktounset", setrank, setrank, UINT_MAX); + unsigned int rank = static_cast<unsigned int>(tag->getUInt("rank", 0, 0, UINT_MAX)); + unsigned int setrank = static_cast<unsigned int>(tag->getUInt("ranktoset", prefixrank, rank, UINT_MAX)); + unsigned int unsetrank = static_cast<unsigned int>(tag->getUInt("ranktounset", setrank, setrank, UINT_MAX)); bool depriv = tag->getBool("depriv", true); this->Update(rank, setrank, unsetrank, depriv); @@ -71,9 +71,9 @@ class ModuleCustomPrefix : public Module if (!pm) throw ModuleException("<customprefix:change> specified for a non-prefix mode at " + tag->source.str()); - unsigned long rank = tag->getUInt("rank", pm->GetPrefixRank(), 0, UINT_MAX); - unsigned long setrank = tag->getUInt("ranktoset", pm->GetLevelRequired(true), rank, UINT_MAX); - unsigned long unsetrank = tag->getUInt("ranktounset", pm->GetLevelRequired(false), setrank, UINT_MAX); + unsigned int rank = static_cast<unsigned int>(tag->getUInt("rank", pm->GetPrefixRank(), 0, UINT_MAX)); + unsigned int setrank = static_cast<unsigned int>(tag->getUInt("ranktoset", pm->GetLevelRequired(true), rank, UINT_MAX)); + unsigned int unsetrank = static_cast<unsigned int>(tag->getUInt("ranktounset", pm->GetLevelRequired(false), setrank, UINT_MAX)); bool depriv = tag->getBool("depriv", pm->CanSelfRemove()); pm->Update(rank, setrank, unsetrank, depriv); |
