From b474de4a54c9b1d4d863971e40b807588d554436 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 24 Aug 2012 22:48:35 +0300 Subject: replace defines to consts. --- src/gui/widgets/chattab.cpp | 2 +- src/gui/widgets/itemcontainer.cpp | 2 +- src/gui/widgets/spellshortcutcontainer.cpp | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 102fc9546..0c1bab71a 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -48,7 +48,7 @@ #include "debug.h" -#define MAX_WORD_SIZE 50 +static const unsigned int MAX_WORD_SIZE = 50; ChatTab::ChatTab(const std::string &name) : Tab(), diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index bff17cfa2..ba359118f 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -364,7 +364,7 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) mSelectionStatus = SEL_SELECTING; int num = itemShortcutWindow->getTabIndex(); - if (num >= 0 && num < SHORTCUT_TABS) + if (num >= 0 && num < static_cast(SHORTCUT_TABS)) { if (itemShortcut[num]) itemShortcut[num]->setItemSelected(item); diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index a057eceb4..5236daec4 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -233,7 +233,8 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event) if (spell && !spell->isEmpty()) { int num = itemShortcutWindow->getTabIndex(); - if (num >= 0 && num < SHORTCUT_TABS && itemShortcut[num]) + if (num >= 0 && num < static_cast(SHORTCUT_TABS) + && itemShortcut[num]) { itemShortcut[num]->setItemSelected( spell->getId() + SPELL_MIN_ID); @@ -244,8 +245,11 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event) else { int num = itemShortcutWindow->getTabIndex(); - if (num >= 0 && num < SHORTCUT_TABS && itemShortcut[num]) + if (num >= 0 && num < static_cast(SHORTCUT_TABS) + && itemShortcut[num]) + { itemShortcut[num]->setItemSelected(-1); + } spellShortcut->setItemSelected(-1); } } -- cgit v1.2.3-70-g09d2