Prefer SDL_zero()/SDL_zerop()

Replace uses of 'SDL_memset(E, 0, sizeof(E))' and similar
with the SDL_zero()/SDL_zerop() macros.
This commit is contained in:
Eddy Jansson
2026-01-23 19:42:06 +01:00
committed by Sam Lantinga
parent fe403220f0
commit 83fb7b6636
17 changed files with 30 additions and 30 deletions

View File

@@ -809,7 +809,7 @@ static void GIP_MetadataFree(GIP_Metadata *metadata)
SDL_free(metadata->device.hid_descriptor);
SDL_free(metadata->message_metadata);
SDL_memset(metadata, 0, sizeof(*metadata));
SDL_zerop(metadata);
}
static bool GIP_ParseDeviceMetadata(GIP_Metadata *metadata, const Uint8 *bytes, int num_bytes, int *offset)

View File

@@ -450,7 +450,7 @@ static bool ReadProprietaryReply(SDL_DriverSwitch_Context *ctx, ESwitchProprieta
static void ConstructSubcommand(SDL_DriverSwitch_Context *ctx, ESwitchSubcommandIDs ucCommandID, const Uint8 *pBuf, Uint8 ucLen, SwitchSubcommandOutputPacket_t *outPacket)
{
SDL_memset(outPacket, 0, sizeof(*outPacket));
SDL_zerop(outPacket);
outPacket->commonData.ucPacketType = k_eSwitchOutputReportIDs_RumbleAndSubcommand;
outPacket->commonData.ucPacketNumber = ctx->m_nCommandNumber;