Skip to content

Commit

Permalink
seq: Add snd_seq_ump_ev_clear()
Browse files Browse the repository at this point in the history
Like snd_seq_ev_clear(), let's add a helper to clear the event record
for a UMP-capable sequencer event.

While we're at it, change snd_seq_ev_clear() to be a static inline
function, so that we make sure that the proper pointer type is
passed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
tiwai committed Jan 18, 2024
1 parent 31f2ab5 commit 55c6338
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions include/seqmid.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,21 @@ extern "C" {
*
* This macro clears the given event record pointer to the default status.
*/
#define snd_seq_ev_clear(ev) \
memset(ev, 0, sizeof(snd_seq_event_t))
static inline void snd_seq_ev_clear(snd_seq_event_t *ev)
{
memset(ev, 0, sizeof(*ev));
}

/**
* \brief initialize event record for UMP
* \param ev event record pointer
*
* This macro clears the given UMP event record pointer to the default status.
*/
static inline void snd_seq_ump_ev_clear(snd_seq_ump_event_t *ev)
{
memset(ev, 0, sizeof(*ev));
}

/**
* \brief set the tag for given event
Expand Down

0 comments on commit 55c6338

Please sign in to comment.