mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r24780) -Fix [FS#5378]: passing an int to a function expecting a byte can have side effects when MSVC optimises it
This commit is contained in:
parent
efd6e29b52
commit
5d74b679e6
|
@ -304,10 +304,10 @@ void Window::UnfocusFocusedWidget()
|
||||||
* @param widget_index Index of the widget in the window to set the focus to.
|
* @param widget_index Index of the widget in the window to set the focus to.
|
||||||
* @return Focus has changed.
|
* @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. */
|
/* 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.
|
assert(this->nested_array[widget_index] != NULL); // Setting focus to a non-existing widget is a bad idea.
|
||||||
if (this->nested_focus != NULL) {
|
if (this->nested_focus != NULL) {
|
||||||
|
|
|
@ -463,7 +463,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnfocusFocusedWidget();
|
void UnfocusFocusedWidget();
|
||||||
bool SetFocusedWidget(byte widget_index);
|
bool SetFocusedWidget(int widget_index);
|
||||||
|
|
||||||
EventState HandleEditBoxKey(int wid, uint16 key, uint16 keycode);
|
EventState HandleEditBoxKey(int wid, uint16 key, uint16 keycode);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue