diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-10-19 06:55:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-10-19 06:55:28 +0300 |
commit | 98c74738f21d7ae256f1273b6c1614ee64e2a3ad (patch) | |
tree | 95a1af0071c774021c781611d215fee84358a807 /src/gui | |
parent | a0b050fd82177f38b8bbf3360159d57886e2a347 (diff) | |
download | manaplus-98c74738f21d7ae256f1273b6c1614ee64e2a3ad.tar.gz manaplus-98c74738f21d7ae256f1273b6c1614ee64e2a3ad.tar.bz2 manaplus-98c74738f21d7ae256f1273b6c1614ee64e2a3ad.tar.xz manaplus-98c74738f21d7ae256f1273b6c1614ee64e2a3ad.zip |
Fix code style.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/models/tablemodel.cpp | 6 | ||||
-rw-r--r-- | src/gui/popups/beingpopup.cpp | 1 | ||||
-rw-r--r-- | src/gui/widgets/characterviewnormal.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 12 | ||||
-rw-r--r-- | src/gui/widgets/tabs/socialnavigationtab.h | 2 | ||||
-rw-r--r-- | src/gui/windows/charcreatedialog.cpp | 6 | ||||
-rw-r--r-- | src/gui/windows/ministatuswindow.cpp | 6 |
7 files changed, 19 insertions, 16 deletions
diff --git a/src/gui/models/tablemodel.cpp b/src/gui/models/tablemodel.cpp index 3f9c262c7..7399ca31f 100644 --- a/src/gui/models/tablemodel.cpp +++ b/src/gui/models/tablemodel.cpp @@ -168,12 +168,12 @@ int StaticTableModel::getColumns() const int StaticTableModel::getWidth() const { - int width = 0; + size_t width = 0; for (size_t i = 0, sz = mWidths.size(); i < sz; i++) - width += mWidths[i]; + width += CAST_SIZE(mWidths[i]); - return width; + return CAST_S32(width); } int StaticTableModel::getHeight() const diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp index 5ba770f2e..557472d57 100644 --- a/src/gui/popups/beingpopup.cpp +++ b/src/gui/popups/beingpopup.cpp @@ -61,6 +61,7 @@ BeingPopup::BeingPopup() : BeingPopup::~BeingPopup() { + mBeingName = nullptr; } void BeingPopup::postInit() diff --git a/src/gui/widgets/characterviewnormal.cpp b/src/gui/widgets/characterviewnormal.cpp index d001a2175..b2ff5dff7 100644 --- a/src/gui/widgets/characterviewnormal.cpp +++ b/src/gui/widgets/characterviewnormal.cpp @@ -101,7 +101,7 @@ void CharacterViewNormal::resize() if (sz == 0) return; const CharacterDisplay *const firtChar = (*mCharacterEntries)[0]; - int y = 0; + unsigned int y = 0; const int width = firtChar->getWidth(); const int height = firtChar->getHeight(); int x = 0; diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 6e9fa5e19..37fb7637e 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -555,13 +555,14 @@ void TabbedArea::updateTabsWidth() void TabbedArea::updateVisibleTabsWidth() { - mVisibleTabsWidth = 0; + unsigned int visibleTabsWidth = 0; for (size_t i = mTabScrollIndex, sz = mTabs.size(); i < sz; ++i) { Tab *const tab = mTabs[i].first; - if ((tab != nullptr) && tab->mVisible == Visible_true) - mVisibleTabsWidth += CAST_S32(tab->getWidth()); + if (tab != nullptr && tab->mVisible == Visible_true) + visibleTabsWidth += CAST_S32(tab->getWidth()); } + mVisibleTabsWidth = visibleTabsWidth; } void TabbedArea::adjustSize() @@ -616,8 +617,9 @@ void TabbedArea::adjustTabPositions() } } - int x = (mEnableScrollButtons && mArrowButton[0]->mVisible == Visible_true) - ? mArrowButton[0]->getWidth() : 0; + unsigned int x = (mEnableScrollButtons && + mArrowButton[0]->mVisible == Visible_true) ? + mArrowButton[0]->getWidth() : 0U; for (size_t i = mTabScrollIndex; i < sz; ++i) { Tab *const tab = mTabs[i].first; diff --git a/src/gui/widgets/tabs/socialnavigationtab.h b/src/gui/widgets/tabs/socialnavigationtab.h index a3eb8f8b2..f58bc4200 100644 --- a/src/gui/widgets/tabs/socialnavigationtab.h +++ b/src/gui/widgets/tabs/socialnavigationtab.h @@ -175,7 +175,7 @@ class SocialNavigationTab final : public SocialTab return; const Avatar *const ava = avatars->at(num); - if ((ava != nullptr) && (localPlayer != nullptr)) + if (ava != nullptr) localPlayer->navigateTo(ava->getX(), ava->getY()); } diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index be5756102..49dcd8314 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -649,11 +649,11 @@ void CharCreateDialog::unlock() int CharCreateDialog::getDistributedPoints() const { - int points = 0; + unsigned int points = 0; for (size_t i = 0, sz = mAttributeSlider.size(); i < sz; i++) - points += CAST_S32(mAttributeSlider[i]->getValue()); - return points; + points += CAST_U32(mAttributeSlider[i]->getValue()); + return CAST_S32(points); } void CharCreateDialog::setAttributes(const StringVect &labels, diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index e98e607be..69dbcbf45 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -253,14 +253,14 @@ void MiniStatusWindow::eraseIcon(const int index) void MiniStatusWindow::drawIcons(Graphics *const graphics) { // Draw icons - int icon_x = mMaxX + mIconPadding; + unsigned int icon_x = mMaxX + mIconPadding; for (size_t i = 0, sz = mIcons.size(); i < sz; i ++) { const AnimatedSprite *const icon = mIcons[i]; if (icon != nullptr) { - icon->draw(graphics, icon_x, mIconPadding); - icon_x += mIconSpacing + icon->getWidth(); + icon->draw(graphics, CAST_S32(icon_x), mIconPadding); + icon_x += CAST_U32(mIconSpacing + icon->getWidth()); } } } |