mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-28 20:37:24 +02:00
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:
committed by
Sam Lantinga
parent
fe403220f0
commit
83fb7b6636
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user