April 27, 2026
4:34 p.m.
Rémi Bernon (@rbernon) commented about dlls/dinput/joystick_hid.c:
static struct list joystick_cache = LIST_INIT( joystick_cache );
+#define JOY_ID_EMPTY 17u +#define JOY_ID_UNASSIGNED ~0u +#define JOY_ID_MASK_INIT 0xffffu +static DWORD joy_ids = JOY_ID_MASK_INIT; +static BOOL is_joy_id_available( DWORD joy_id ) +{ + BOOL available = (joy_id < 16) && !!(joy_ids & (1 << joy_id)); + + if (available) joy_ids &= ~(1 << joy_id); + return available; +}
It looks misleading to update the available IDs when the function name seem to only indicate a check. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10755#note_137765