From 7478e13e61905fdc00da57c1e372acd72f4ccc5b Mon Sep 17 00:00:00 2001 From: Rikard Falkeborn Date: Sun, 9 Jun 2019 11:35:42 +0200 Subject: [PATCH] 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. --- src/openrct2-ui/windows/Scenery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 04a2a66e35..3a1db09df6 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -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;