Prefer SDL_arraysize()

Replace uses of (sizeof(arr)/sizeof(arr[0]), and similar,
with the SDL_arraysize() macro.
This commit is contained in:
Eddy Jansson
2025-12-30 20:59:46 +01:00
committed by Sam Lantinga
parent d33642b710
commit 3d354eeaad
10 changed files with 17 additions and 17 deletions

View File

@@ -836,7 +836,7 @@ static bool SDL_HIDAPI_HapticDriverLg4ff_JoystickSupported(SDL_Joystick *joystic
if (vendor_id != USB_VENDOR_ID_LOGITECH) {
return false;
}
for (int i = 0;i < sizeof(supported_device_ids) / sizeof(Uint32);i++) {
for (int i = 0;i < SDL_arraysize(supported_device_ids);i++) {
if (supported_device_ids[i] == product_id) {
return true;
}