diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-27 00:17:27 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-27 00:30:38 +0100 |
commit | 511d9ac780e094767e806c9a448ac973279dd4c8 (patch) | |
tree | a9051719bfdbce7f41338ef03a6f95d442a770cf /src/gui | |
parent | 2eee8b31f6959902db031e61df6c79249f56c23c (diff) | |
download | mana-511d9ac780e094767e806c9a448ac973279dd4c8.tar.gz mana-511d9ac780e094767e806c9a448ac973279dd4c8.tar.bz2 mana-511d9ac780e094767e806c9a448ac973279dd4c8.tar.xz mana-511d9ac780e094767e806c9a448ac973279dd4c8.zip |
Compile warning fixes
Mostly unsigned/signed mismatches and an unused variable.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/skin.cpp | 4 | ||||
-rw-r--r-- | src/gui/skin.h | 4 | ||||
-rw-r--r-- | src/gui/trade.cpp | 2 | ||||
-rw-r--r-- | src/gui/window.cpp | 13 | ||||
-rw-r--r-- | src/gui/window.h | 21 |
5 files changed, 20 insertions, 24 deletions
diff --git a/src/gui/skin.cpp b/src/gui/skin.cpp index 27a0fa3d..f7cc8ba1 100644 --- a/src/gui/skin.cpp +++ b/src/gui/skin.cpp @@ -51,13 +51,13 @@ Skin::~Skin() closeImage->decRef(); } -unsigned int Skin::getMinWidth() +int Skin::getMinWidth() const { return (border.grid[0]->getWidth() + border.grid[1]->getWidth()) + border.grid[2]->getWidth(); } -unsigned int Skin::getMinHeight() +int Skin::getMinHeight() const { return (border.grid[0]->getHeight() + border.grid[3]->getHeight()) + border.grid[6]->getHeight(); diff --git a/src/gui/skin.h b/src/gui/skin.h index b8a1242e..21bd84f2 100644 --- a/src/gui/skin.h +++ b/src/gui/skin.h @@ -60,12 +60,12 @@ class Skin /** * Returns the minimum width which can be used with this skin. */ - unsigned int getMinWidth(); + int getMinWidth() const; /** * Returns the minimum height which can be used with this skin. */ - unsigned int getMinHeight(); + int getMinHeight() const; int instances; diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index 2ba076a3..a95e1d43 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -277,7 +277,7 @@ void TradeWindow::valueChanged(const gcn::SelectionEvent &event) if (event.getSource() == mMyItemContainer && (item = mMyItemContainer->getSelectedItem())) mPartnerItemContainer->selectNone(); - else if (item = mPartnerItemContainer->getSelectedItem()) + else if ((item = mPartnerItemContainer->getSelectedItem())) mMyItemContainer->selectNone(); } diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 83354a07..0a5c3b13 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -255,23 +255,23 @@ void Window::setLocationRelativeTo(ImageRect::ImagePosition position, setPosition(offsetX, offsetY); } -void Window::setMinWidth(unsigned int width) +void Window::setMinWidth(int width) { mMinWinWidth = width > mSkin->getMinWidth() ? width : mSkin->getMinWidth(); } -void Window::setMinHeight(unsigned int height) +void Window::setMinHeight(int height) { mMinWinHeight = height > mSkin->getMinHeight() ? height : mSkin->getMinHeight(); } -void Window::setMaxWidth(unsigned int width) +void Window::setMaxWidth(int width) { mMaxWinWidth = width; } -void Window::setMaxHeight(unsigned int height) +void Window::setMaxHeight(int height) { mMaxWinHeight = height; } @@ -326,11 +326,6 @@ void Window::setSticky(bool sticky) mSticky = sticky; } -bool Window::isSticky() -{ - return mSticky; -} - void Window::setVisible(bool visible) { gcn::Window::setVisible(isSticky() || visible); diff --git a/src/gui/window.h b/src/gui/window.h index 7f15e262..44128f1d 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -117,42 +117,42 @@ class Window : public gcn::Window, gcn::WidgetListener /** * Sets the minimum width of the window. */ - void setMinWidth(unsigned int width); + void setMinWidth(int width); /** * Sets the minimum height of the window. */ - void setMinHeight(unsigned int height); + void setMinHeight(int height); /** * Sets the maximum width of the window. */ - void setMaxWidth(unsigned int width); + void setMaxWidth(int width); /** * Sets the minimum height of the window. */ - void setMaxHeight(unsigned int height); + void setMaxHeight(int height); /** * Gets the minimum width of the window. */ - int getMinWidth() { return mMinWinWidth; } + int getMinWidth() const { return mMinWinWidth; } /** * Gets the minimum height of the window. */ - int getMinHeight() { return mMinWinHeight; } + int getMinHeight() const { return mMinWinHeight; } /** * Gets the maximum width of the window. */ - int getMaxWidth() { return mMaxWinWidth; } + int getMaxWidth() const { return mMaxWinWidth; } /** * Gets the minimum height of the window. */ - int getMaxHeight() { return mMaxWinHeight; } + int getMaxHeight() const { return mMaxWinHeight; } /** * Sets flag to show a title or not. @@ -168,7 +168,8 @@ class Window : public gcn::Window, gcn::WidgetListener /** * Returns whether the window is sticky. */ - bool isSticky(); + bool isSticky() const + { return mSticky; } /** * Overloads window setVisible by Guichan to allow sticky window @@ -181,7 +182,7 @@ class Window : public gcn::Window, gcn::WidgetListener * * @return The parent window or <code>NULL</code> if there is none. */ - Window *getParentWindow() { return mParent; } + Window *getParentWindow() const { return mParent; } /** * Schedule this window for deletion. It will be deleted at the start |