Skip to content

Commit

Permalink
SDL_hidapi_switch.c: fix build with older compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Jan 15, 2021
1 parent 69bd7eb commit bdb3e6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/joystick/hidapi/SDL_hidapi_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bdb3e6b

Please sign in to comment.