]> git.alsa-project.org Git - alsa-lib.git/commitdiff
seq: Add snd_seq_ump_ev_clear()
authorTakashi Iwai <tiwai@suse.de>
Mon, 13 Nov 2023 11:51:56 +0000 (12:51 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 18 Jan 2024 15:43:55 +0000 (16:43 +0100)
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>
include/seqmid.h

index da34699994b0883a05149cb8f32a3460dc099b58..4464c2d3af0bee0da260c5d18c53f9f6812f8103 100644 (file)
@@ -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