mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-28 00:38:45 +00: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:
parent
fe403220f0
commit
83fb7b6636
17 changed files with 30 additions and 30 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue