Skip to content

Commit 63babce

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 c45da86 commit 63babce

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
@@ -877,12 +877,14 @@ bool Win32_CreateMenuItemAt(SDL_MenuItem *menu_item, size_t index, const char *n
877877
platform_data->self_handle = (UINT_PTR)event_type;
878878
}
879879

880-
// To add items at the back, we need to set the index to -1.
881-
if (index == parent->children) {
882-
index = -1;
880+
UINT win_index = (UINT)index;
881+
882+
// To add items at the back, we need to set the index to -1, despite it being unsigned.
883+
if ((Sint64)index == parent->children) {
884+
win_index = (UINT)-1;
883885
}
884886

885-
if (!InsertMenuA((HMENU)menu_platform_data->self_handle, (UINT)index, flags, platform_data->self_handle, name)) {
887+
if (!InsertMenuA((HMENU)menu_platform_data->self_handle, win_index, flags, platform_data->self_handle, name)) {
886888
return WIN_SetError("Unable to append item to Menu.");
887889
}
888890

0 commit comments

Comments
 (0)