summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2012-12-03 21:03:13 +0000
committerglx <glx@openttd.org>2012-12-03 21:03:13 +0000
commit5d74b679e6fdaf1732843056e36f91a221443689 (patch)
tree1835177f1d2f5cf0a923baae986a76db177b41a7 /src/window.cpp
parentefd6e29b52a480bd3fad95b8b6c8f162ad1f8a23 (diff)
downloadopenttd-5d74b679e6fdaf1732843056e36f91a221443689.tar.xz
(svn r24780) -Fix [FS#5378]: passing an int to a function expecting a byte can have side effects when MSVC optimises it
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/window.cpp b/src/window.cpp
index aa4e5a644..c50c02253 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -304,10 +304,10 @@ void Window::UnfocusFocusedWidget()
* @param widget_index Index of the widget in the window to set the focus to.
* @return Focus has changed.
*/
-bool Window::SetFocusedWidget(byte widget_index)
+bool Window::SetFocusedWidget(int widget_index)
{
/* Do nothing if widget_index is already focused, or if it wasn't a valid widget. */
- if (widget_index >= this->nested_array_size) return false;
+ if ((uint)widget_index >= this->nested_array_size) return false;
assert(this->nested_array[widget_index] != NULL); // Setting focus to a non-existing widget is a bad idea.
if (this->nested_focus != NULL) {