1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 02:05:13 +01:00

Don't use sizeof() in pointer arithmetic or as indices; use found variables

This commit is contained in:
Adrian Wielgosik
2014-09-14 21:24:12 +02:00
parent e487d325df
commit f47ea4fd27
3 changed files with 5 additions and 5 deletions

View File

@@ -234,7 +234,7 @@ static int window_wheel_input(rct_window *w, int wheel)
continue;
// Originally always checked first scroll view, bug maybe?
scroll = &w->scrolls[i * sizeof(rct_scroll)];
scroll = &w->scrolls[i];
if (scroll->flags & (HSCROLLBAR_VISIBLE | VSCROLLBAR_VISIBLE)) {
window_scroll_wheel_input(w, i, wheel);
return 1;
@@ -308,7 +308,7 @@ static void window_all_wheel_input()
if (widgetIndex != -1) {
widget = &w->widgets[widgetIndex];
if (widget->type == WWT_SCROLL) {
scroll = &w->scrolls[RCT2_GLOBAL(0x01420075, uint8) * sizeof(rct_scroll)];
scroll = &w->scrolls[RCT2_GLOBAL(0x01420075, uint8)];
if (scroll->flags & (HSCROLLBAR_VISIBLE | VSCROLLBAR_VISIBLE)) {
window_scroll_wheel_input(w, window_get_scroll_index(w, widgetIndex), wheel);
return;