From bdb3e6b84ffa08ea173de60ce9919381ccaaf4cb Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 15 Jan 2021 12:40:00 +0300 Subject: [PATCH] SDL_hidapi_switch.c: fix build with older compilers --- src/joystick/hidapi/SDL_hidapi_switch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c index 885c6ea1f..920fa673c 100644 --- a/src/joystick/hidapi/SDL_hidapi_switch.c +++ b/src/joystick/hidapi/SDL_hidapi_switch.c @@ -533,9 +533,10 @@ static SDL_bool BReadDeviceInfo(SDL_DriverSwitch_Context *ctx) if (WriteProprietary(ctx, k_eSwitchProprietaryCommandIDs_Status, NULL, 0, SDL_TRUE)) { SwitchProprietaryStatusPacket_t *status = (SwitchProprietaryStatusPacket_t *)&ctx->m_rgucReadBuffer[0]; + size_t i; ctx->m_eControllerType = (ESwitchDeviceInfoControllerType)status->ucDeviceType; - for (size_t i = 0; i < sizeof (ctx->m_rgucMACAddress); ++i) + for (i = 0; i < sizeof (ctx->m_rgucMACAddress); ++i) ctx->m_rgucMACAddress[i] = status->rgucMACAddress[ sizeof(ctx->m_rgucMACAddress) - i - 1 ]; return SDL_TRUE;