summaryrefslogtreecommitdiff
path: root/src/gui/specialswindow.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
commit5afe88df2538274859a162ffd63ed52118e80c19 (patch)
treeb610dfd58dc748fd63f49565b2a43eea2316714f /src/gui/specialswindow.cpp
parent73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff)
downloadmana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz
mana-5afe88df2538274859a162ffd63ed52118e80c19.zip
Apply C++11 fixits
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
Diffstat (limited to 'src/gui/specialswindow.cpp')
-rw-r--r--src/gui/specialswindow.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/specialswindow.cpp b/src/gui/specialswindow.cpp
index ac1f460b..d114d6e3 100644
--- a/src/gui/specialswindow.cpp
+++ b/src/gui/specialswindow.cpp
@@ -94,7 +94,7 @@ void SpecialsWindow::action(const gcn::ActionEvent &event)
{
if (event.getId() == "use")
{
- SpecialEntry *disp = dynamic_cast<SpecialEntry*>(event.getSource()->getParent());
+ auto *disp = dynamic_cast<SpecialEntry*>(event.getSource()->getParent());
if (disp)
{
@@ -127,10 +127,10 @@ void SpecialsWindow::draw(gcn::Graphics *graphics)
bool foundNew = false;
unsigned int found = 0; // number of entries in specialData which match mEntries
- for (std::map<int, Special>::iterator it = specialData.begin();
+ for (auto it = specialData.begin();
it != specialData.end(); ++it)
{
- std::map<int, SpecialEntry *>::iterator e = mEntries.find(it->first);
+ auto e = mEntries.find(it->first);
if (e == mEntries.end())
{
// found a new special - abort update and rebuild from scratch
@@ -158,7 +158,7 @@ void SpecialsWindow::rebuild(const std::map<int, Special> &specialData)
mEntries.clear();
int vPos = 0; //vertical position of next placed element
- for (std::map<int, Special>::const_iterator it = specialData.begin();
+ for (auto it = specialData.begin();
it != specialData.end(); ++it)
{
logger->log("Updating special GUI for %d", it->first);
@@ -168,7 +168,7 @@ void SpecialsWindow::rebuild(const std::map<int, Special> &specialData)
{
info->rechargeCurrent = it->second.currentMana;
info->rechargeNeeded = it->second.neededMana;
- SpecialEntry* entry = new SpecialEntry(info);
+ auto* entry = new SpecialEntry(info);
entry->setPosition(0, vPos);
vPos += entry->getHeight() + 3;
add(entry);
@@ -184,10 +184,10 @@ void SpecialsWindow::rebuild(const std::map<int, Special> &specialData)
SpecialEntry::SpecialEntry(SpecialInfo *info) :
mInfo(info),
- mIcon(NULL),
- mLevelLabel(NULL),
- mUse(NULL),
- mRechargeBar(NULL)
+ mIcon(nullptr),
+ mLevelLabel(nullptr),
+ mUse(nullptr),
+ mRechargeBar(nullptr)
{
setSize(SPECIALS_WIDTH, SPECIALS_HEIGHT);