From: Takashi Iwai Date: Mon, 13 Nov 2023 11:51:56 +0000 (+0100) Subject: seq: Add snd_seq_ump_ev_clear() X-Git-Tag: v1.2.11~13 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=55c633829073dd4c53a8ef984b609d0e50316a68;p=alsa-lib.git seq: Add snd_seq_ump_ev_clear() 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 --- diff --git a/include/seqmid.h b/include/seqmid.h index da346999..4464c2d3 100644 --- a/include/seqmid.h +++ b/include/seqmid.h @@ -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