mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
SDL_hidapi_switch.c: fix build with older compilers
This commit is contained in:
parent
69bd7ebbca
commit
bdb3e6b84f
@ -533,9 +533,10 @@ static SDL_bool BReadDeviceInfo(SDL_DriverSwitch_Context *ctx)
|
|||||||
|
|
||||||
if (WriteProprietary(ctx, k_eSwitchProprietaryCommandIDs_Status, NULL, 0, SDL_TRUE)) {
|
if (WriteProprietary(ctx, k_eSwitchProprietaryCommandIDs_Status, NULL, 0, SDL_TRUE)) {
|
||||||
SwitchProprietaryStatusPacket_t *status = (SwitchProprietaryStatusPacket_t *)&ctx->m_rgucReadBuffer[0];
|
SwitchProprietaryStatusPacket_t *status = (SwitchProprietaryStatusPacket_t *)&ctx->m_rgucReadBuffer[0];
|
||||||
|
size_t i;
|
||||||
|
|
||||||
ctx->m_eControllerType = (ESwitchDeviceInfoControllerType)status->ucDeviceType;
|
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 ];
|
ctx->m_rgucMACAddress[i] = status->rgucMACAddress[ sizeof(ctx->m_rgucMACAddress) - i - 1 ];
|
||||||
|
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user