diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-07 01:53:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-07 01:53:51 +0300 |
commit | 2492b561385859b7ef76fe816a8dc845f0b9bd09 (patch) | |
tree | 62633f8cd7c027c2a8e1bae61264a79394aeb751 /src/gui/gui.cpp | |
parent | ce14a018a6f66aa1309ebe71a8217082d83cd0da (diff) | |
download | mv-2492b561385859b7ef76fe816a8dc845f0b9bd09.tar.gz mv-2492b561385859b7ef76fe816a8dc845f0b9bd09.tar.bz2 mv-2492b561385859b7ef76fe816a8dc845f0b9bd09.tar.xz mv-2492b561385859b7ef76fe816a8dc845f0b9bd09.zip |
Fix some casts between signed and unsigned in some files.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 1aa898a49..f10b386af 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -112,7 +112,7 @@ Gui::Gui() : mFocusHandler(new FocusHandler), mKeyListeners(), mLastMousePressButton(MouseButton::EMPTY), - mLastMousePressTimeStamp(0), + mLastMousePressTimeStamp(0U), mLastMouseX(0), mLastMouseY(0), mClickCount(1), @@ -501,7 +501,7 @@ void Gui::draw() } #endif Image *const mouseCursor = mMouseCursors->get( - static_cast<int>(mCursorType)); + static_cast<size_t>(mCursorType)); if (mouseCursor) { mouseCursor->setAlpha(mMouseCursorAlpha); @@ -638,7 +638,7 @@ void Gui::handleMouseMoved(const MouseInput &mouseInput) true, true); mClickCount = 1; - mLastMousePressTimeStamp = 0; + mLastMousePressTimeStamp = 0U; mWidgetWithMouseQueue.erase(iter); break; } @@ -741,7 +741,7 @@ void Gui::handleMousePressed(const MouseInput &mouseInput) const int x = mouseInput.getX(); const int y = mouseInput.getY(); const MouseButtonT button = mouseInput.getButton(); - const int timeStamp = mouseInput.getTimeStamp(); + const unsigned int timeStamp = mouseInput.getTimeStamp(); Widget *sourceWidget = getMouseEventSource(x, y); @@ -761,8 +761,9 @@ void Gui::handleMousePressed(const MouseInput &mouseInput) sourceWidget->requestFocus(); } - if (mDoubleClick && timeStamp - mLastMousePressTimeStamp < 250 - && mLastMousePressButton == button) + if (mDoubleClick && + timeStamp - mLastMousePressTimeStamp < 250U && + mLastMousePressButton == button) { mClickCount ++; } @@ -1466,7 +1467,7 @@ int Gui::getMousePressLength() const { if (!mLastMousePressTimeStamp) return 0; - int ticks = SDL_GetTicks(); + unsigned int ticks = SDL_GetTicks(); if (ticks > mLastMousePressTimeStamp) return ticks - mLastMousePressTimeStamp; return mLastMousePressTimeStamp - ticks; |