From 55c633829073dd4c53a8ef984b609d0e50316a68 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 13 Nov 2023 12:51:56 +0100 Subject: [PATCH] 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 --- include/seqmid.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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 -- 2.47.1