diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-27 00:17:27 +0100 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-26 17:52:00 -0600 |
commit | 2ec46b9a6e5ca1beb043da00cf2bb9d34722ec72 (patch) | |
tree | 02cfa2ce2e1976af94c07d7d984eb394ffa4f3c4 | |
parent | 22974109dd0e9ae2b915cc2c258df1f01a65b729 (diff) | |
download | mana-2ec46b9a6e5ca1beb043da00cf2bb9d34722ec72.tar.gz mana-2ec46b9a6e5ca1beb043da00cf2bb9d34722ec72.tar.bz2 mana-2ec46b9a6e5ca1beb043da00cf2bb9d34722ec72.tar.xz mana-2ec46b9a6e5ca1beb043da00cf2bb9d34722ec72.zip |
Compile warning fixes
Mostly unsigned/signed mismatches and an unused variable.
-rw-r--r-- | src/gui/popup.cpp | 8 | ||||
-rw-r--r-- | src/gui/popup.h | 20 | ||||
-rw-r--r-- | src/gui/skin.cpp | 4 | ||||
-rw-r--r-- | src/gui/skin.h | 4 | ||||
-rw-r--r-- | src/gui/window.cpp | 13 | ||||
-rw-r--r-- | src/gui/window.h | 21 |
6 files changed, 33 insertions, 37 deletions
diff --git a/src/gui/popup.cpp b/src/gui/popup.cpp index 85ba3b7a..8dfc3c61 100644 --- a/src/gui/popup.cpp +++ b/src/gui/popup.cpp @@ -163,22 +163,22 @@ void Popup::setLocationRelativeTo(gcn::Widget *widget) getY() + (wy + (widget->getHeight() - getHeight()) / 2 - y)); } -void Popup::setMinWidth(unsigned int width) +void Popup::setMinWidth(int width) { mMinWidth = width > mSkin->getMinWidth() ? width : mSkin->getMinWidth(); } -void Popup::setMinHeight(unsigned int height) +void Popup::setMinHeight(int height) { mMinHeight = height > mSkin->getMinHeight() ? height : mSkin->getMinHeight(); } -void Popup::setMaxWidth(unsigned int width) +void Popup::setMaxWidth(int width) { mMaxWidth = width; } -void Popup::setMaxHeight(unsigned int height) +void Popup::setMaxHeight(int height) { mMaxHeight = height; } diff --git a/src/gui/popup.h b/src/gui/popup.h index 868f2a2b..37c99ded 100644 --- a/src/gui/popup.h +++ b/src/gui/popup.h @@ -96,42 +96,42 @@ class Popup : public gcn::Container /** * Sets the minimum width of the popup. */ - void setMinWidth(unsigned int width); + void setMinWidth(int width); /** * Sets the minimum height of the popup. */ - void setMinHeight(unsigned int height); + void setMinHeight(int height); /** * Sets the maximum width of the popup. */ - void setMaxWidth(unsigned int width); + void setMaxWidth(int width); /** * Sets the minimum height of the popup. */ - void setMaxHeight(unsigned int height); + void setMaxHeight(int height); /** * Gets the minimum width of the popup. */ - int getMinWidth() { return mMinWidth; } + int getMinWidth() const { return mMinWidth; } /** * Gets the minimum height of the popup. */ - int getMinHeight() { return mMinHeight; } + int getMinHeight() const { return mMinHeight; } /** * Gets the maximum width of the popup. */ - int getMaxWidth() { return mMaxWidth; } + int getMaxWidth() const { return mMaxWidth; } /** * Gets the minimum height of the popup. */ - int getMaxHeight() { return mMaxHeight; } + int getMaxHeight() const { return mMaxHeight; } /** * Gets the padding of the popup. The padding is the distance between @@ -149,7 +149,7 @@ class Popup : public gcn::Container * @param padding The padding of the popup. * @see getPadding */ - void setPadding(unsigned int padding) { mPadding = padding; } + void setPadding(int padding) { mPadding = padding; } /** * Returns the parent Window. @@ -186,7 +186,7 @@ class Popup : public gcn::Container int mMinHeight; /**< Minimum popup height */ int mMaxWidth; /**< Maximum popup width */ int mMaxHeight; /**< Maximum popup height */ - unsigned int mPadding; /**< Holds the padding of the popup. */ + int mPadding; /**< Holds the padding of the popup. */ static int instances; /**< Number of popup instances */ diff --git a/src/gui/skin.cpp b/src/gui/skin.cpp index e87f6761..10b9885a 100644 --- a/src/gui/skin.cpp +++ b/src/gui/skin.cpp @@ -76,13 +76,13 @@ void Skin::updateAlpha() closeImage->setAlpha(alpha); } -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 b7e2c29f..1a603e29 100644 --- a/src/gui/skin.h +++ b/src/gui/skin.h @@ -67,12 +67,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; /** * Updates the alpha value of the skin diff --git a/src/gui/window.cpp b/src/gui/window.cpp index f64f1caf..476dcd7e 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -221,23 +221,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; } @@ -292,11 +292,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 66e73e12..8907ead4 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -116,42 +116,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. @@ -167,7 +167,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 @@ -180,7 +181,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 |