Skip to content

Commit 4447d64

Browse files
committed
Try to fix a couple warnings I missed, I feel like there's a cmake flag I need to pass...
1 parent 49b0823 commit 4447d64

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/video/windows/SDL_windowsvideo.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -962,12 +962,14 @@ bool Win32_CreateMenuItemAt(SDL_MenuItem *menu_item, size_t index, const char *n
962962
platform_data->self_handle = (UINT_PTR)event_type;
963963
}
964964

965-
// To add items at the back, we need to set the index to -1.
966-
if (index == parent->children) {
967-
index = -1;
965+
UINT win_index = (UINT)index;
966+
967+
// To add items at the back, we need to set the index to -1, despite it being unsigned.
968+
if ((Sint64)index == parent->children) {
969+
win_index = (UINT)-1;
968970
}
969971

970-
if (!InsertMenuA((HMENU)menu_platform_data->self_handle, (UINT)index, flags, platform_data->self_handle, name)) {
972+
if (!InsertMenuA((HMENU)menu_platform_data->self_handle, win_index, flags, platform_data->self_handle, name)) {
971973
return WIN_SetError("Unable to append item to Menu.");
972974
}
973975

0 commit comments

Comments
 (0)