summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-18 17:48:29 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-18 17:49:00 +0200
commitf98d003e354a1792117b7cbc771d1dd91475a156 (patch)
treedc2a297f7c4026394c9954ae4bfd4abd22ef9612 /src/gui/widgets
parentbb0a6cb25b2985fd1f74c9d27d5a46f6863e2dee (diff)
downloadmanaverse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.gz
manaverse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.bz2
manaverse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.xz
manaverse-f98d003e354a1792117b7cbc771d1dd91475a156.zip
Fix most old style cast except manaserv and libxml2 defines.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/browserbox.cpp5
-rw-r--r--src/gui/widgets/chattab.cpp3
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp4
-rw-r--r--src/gui/widgets/shopitems.cpp5
-rw-r--r--src/gui/widgets/shortcutcontainer.cpp2
-rw-r--r--src/gui/widgets/tabbedarea.cpp2
-rw-r--r--src/gui/widgets/window.cpp5
7 files changed, 16 insertions, 10 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index eaeed4d06..8546cbd7e 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -290,7 +290,8 @@ void BrowserBox::draw(gcn::Graphics *graphics)
graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight()));
}
- if (mSelectedLink >= 0 && mSelectedLink < (signed)mLinks.size())
+ if (mSelectedLink >= 0 && mSelectedLink
+ < static_cast<signed>(mLinks.size()))
{
if ((mHighMode & BACKGROUND))
{
@@ -434,7 +435,7 @@ int BrowserBox::calcHeight()
}
}
- if (c == '<' && link < (signed)mLinks.size())
+ if (c == '<' && link < static_cast<signed>(mLinks.size()))
{
const int size =
font->getWidth(mLinks[link].caption) + 1;
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 736594859..9675eb621 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -56,7 +56,8 @@ ChatTab::ChatTab(const std::string &name) :
mTextOutput = new BrowserBox(BrowserBox::AUTO_WRAP);
mTextOutput->setOpaque(false);
- mTextOutput->setMaxRow((int) config.getIntValue("ChatLogLength"));
+ mTextOutput->setMaxRow(static_cast<int>(
+ config.getIntValue("ChatLogLength")));
if (chatWindow)
mTextOutput->setLinkHandler(chatWindow->mItemLinkHandler);
mTextOutput->setAlwaysUpdate(false);
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 4abe279da..f6762a5cb 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -131,7 +131,7 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics)
mEmoteImg[i]->sprite->draw(g, emoteX + 2, emoteY + 10);
}
- if (mEmoteMoved && mEmoteMoved < (unsigned)mEmoteImg.size() + 1
+ if (mEmoteMoved && mEmoteMoved < static_cast<unsigned>(mEmoteImg.size()) + 1
&& mEmoteMoved > 0)
{
// Draw the emote image being dragged by the cursor.
@@ -245,7 +245,7 @@ void EmoteShortcutContainer::mouseMoved(gcn::MouseEvent &event)
mEmotePopup->setVisible(false);
- if ((unsigned)index < mEmoteImg.size() && mEmoteImg[index])
+ if (static_cast<unsigned>(index) < mEmoteImg.size() && mEmoteImg[index])
{
mEmotePopup->show(viewport->getMouseX(), viewport->getMouseY(),
mEmoteImg[index]->name);
diff --git a/src/gui/widgets/shopitems.cpp b/src/gui/widgets/shopitems.cpp
index 15f4292a5..6cd0ef39d 100644
--- a/src/gui/widgets/shopitems.cpp
+++ b/src/gui/widgets/shopitems.cpp
@@ -43,8 +43,11 @@ int ShopItems::getNumberOfElements()
std::string ShopItems::getElementAt(int i)
{
- if (i < 0 || (unsigned)i >= mShopItems.size() || !mShopItems.at(i))
+ if (i < 0 || static_cast<unsigned>(i) >= mShopItems.size()
+ || !mShopItems.at(i))
+ {
return "";
+ }
return mShopItems.at(i)->getDisplayName();
}
diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp
index dd5dcf95a..a804f2658 100644
--- a/src/gui/widgets/shortcutcontainer.cpp
+++ b/src/gui/widgets/shortcutcontainer.cpp
@@ -65,7 +65,7 @@ int ShortcutContainer::getIndexFromGrid(int pointX, int pointY) const
int index = ((pointY / mBoxHeight) * mGridWidth) + pointX / mBoxWidth;
if (!tRect.isPointInRect(pointX, pointY) ||
- index >= (int)mMaxItems || index < 0)
+ index >= static_cast<int>(mMaxItems) || index < 0)
{
index = -1;
}
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index ca3eb5095..67882deca 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -155,7 +155,7 @@ void TabbedArea::removeTab(Tab *tab)
}
}
- if (tabIndexToBeSelected >= (signed)mTabs.size())
+ if (tabIndexToBeSelected >= static_cast<signed>(mTabs.size()))
tabIndexToBeSelected = mTabs.size() - 1;
if (tabIndexToBeSelected < -1)
tabIndexToBeSelected = -1;
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 9b05a1389..1037296b6 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -748,7 +748,8 @@ int Window::getResizeHandles(gcn::MouseEvent &event)
const int y = event.getY();
if (mGrip && (y > static_cast<int>(mTitleBarHeight)
- || (y < (int)getPadding() && mTitleBarHeight > getPadding())))
+ || (y < static_cast<int>(getPadding()) && mTitleBarHeight
+ > getPadding())))
{
const int x = event.getX();
@@ -776,7 +777,7 @@ bool Window::isResizeAllowed(gcn::MouseEvent &event)
const int y = event.getY();
if (mGrip && (y > static_cast<int>(mTitleBarHeight)
- || y < (int)getPadding()))
+ || y < static_cast<int>(getPadding())))
{
const int x = event.getX();