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

Add suffix constant to avoid shifting too many bits (#9389)

Since WIDX_SCENERY_BUILD_CLUSTER_BUTTON is 31, add suffix ULL to
avoid shifting 1 (which is an int and 4 bytes on most systems) 31 bits
which is technically undefined behaviour. This is already done in the
shift at line 463.

Detected by the help of cppcheck.
This commit is contained in:
Rikard Falkeborn
2019-06-09 11:35:42 +02:00
committed by Michael Steenbeek
parent 66b6a2b65c
commit 7478e13e61

View File

@@ -970,7 +970,7 @@ void window_scenery_invalidate(rct_window* w)
if (gWindowSceneryEyedropperEnabled)
w->pressed_widgets |= (1 << WIDX_SCENERY_EYEDROPPER_BUTTON);
if (gWindowSceneryClusterEnabled == 1)
w->pressed_widgets |= (1 << WIDX_SCENERY_BUILD_CLUSTER_BUTTON);
w->pressed_widgets |= (1ULL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON);
window_scenery_widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WWT_EMPTY;
window_scenery_widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WWT_EMPTY;