From 4d0caf410bc49d7919beabee6f66edb60fa6f3d2 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Tue, 14 Jun 2022 19:23:21 +0900 Subject: [PATCH] seq: tstamp: remove unused boxed structure The boxed structure for time stamp union is not used anymore. Signed-off-by: Takashi Sakamoto --- src/seq/alsaseq.h | 1 - src/seq/alsaseq.map | 6 ---- src/seq/meson.build | 2 -- src/seq/tstamp.c | 81 --------------------------------------------- src/seq/tstamp.h | 24 -------------- 5 files changed, 114 deletions(-) delete mode 100644 src/seq/tstamp.c delete mode 100644 src/seq/tstamp.h diff --git a/src/seq/alsaseq.h b/src/seq/alsaseq.h index f003db5..ce06789 100644 --- a/src/seq/alsaseq.h +++ b/src/seq/alsaseq.h @@ -10,7 +10,6 @@ #include #include -#include #include #include #include diff --git a/src/seq/alsaseq.map b/src/seq/alsaseq.map index 35cde92..65243ea 100644 --- a/src/seq/alsaseq.map +++ b/src/seq/alsaseq.map @@ -37,12 +37,6 @@ ALSA_GOBJECT_0_0_0 { "alsaseq_client_pool_get_type"; - "alsaseq_tstamp_get_type"; - "alsaseq_tstamp_get_tick_time"; - "alsaseq_tstamp_set_tick_time"; - "alsaseq_tstamp_get_real_time"; - "alsaseq_tstamp_set_real_time"; - "alsaseq_event_get_type"; "alsaseq_event_data_result_get_type"; diff --git a/src/seq/meson.build b/src/seq/meson.build index a195f64..24b8b11 100644 --- a/src/seq/meson.build +++ b/src/seq/meson.build @@ -16,7 +16,6 @@ sources = files( 'addr.c', 'port-info.c', 'client-pool.c', - 'tstamp.c', 'event-data-result.c', 'event-data-note.c', 'event-data-ctl.c', @@ -40,7 +39,6 @@ headers = files( 'addr.h', 'port-info.h', 'client-pool.h', - 'tstamp.h', 'event-data-result.h', 'event-data-note.h', 'event-data-ctl.h', diff --git a/src/seq/tstamp.c b/src/seq/tstamp.c deleted file mode 100644 index 845ba81..0000000 --- a/src/seq/tstamp.c +++ /dev/null @@ -1,81 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -#include "privates.h" - -/** - * ALSASeqTstamp: - * A boxed object to represent timestamp. - * - * A [struct@Tstamp] is a boxed object to represent timestamp. The object shares storage for two - * types of time; tick time and real time. - * - * The object wraps `struct snd_seq_timestamp` in UAPI of Linux sound subsystem. - */ -ALSASeqTstamp *seq_tstamp_copy(const ALSASeqTstamp *self) -{ -#ifdef g_memdup2 - return g_memdup2(self, sizeof(*self)); -#else - // GLib v2.68 deprecated g_memdup() with concern about overflow by narrow conversion from size_t to - // unsigned int however it's safe in the local case. - gpointer ptr = g_malloc(sizeof(*self)); - memcpy(ptr, self, sizeof(*self)); - return ptr; -#endif -} - -G_DEFINE_BOXED_TYPE(ALSASeqTstamp, alsaseq_tstamp, seq_tstamp_copy, g_free) - -/** - * alsaseq_tstamp_get_tick_time: - * @self: A [struct@Tstamp]. - * @tick_time: (out): The value of MIDI ticks. - * - * Get time as MIDI ticks. - */ -void alsaseq_tstamp_get_tick_time(const ALSASeqTstamp *self, guint32 *tick_time) -{ - *tick_time = self->tick; -} - -/** - * alsaseq_tstamp_set_tick_time: - * @self: A [struct@Tstamp]. - * @tick_time: The number of MIDI ticks. - * - * Set time as MIDI ticks. - */ -void alsaseq_tstamp_set_tick_time(ALSASeqTstamp *self, const guint32 tick_time) -{ - self->tick = tick_time; -} - -/** - * alsaseq_tstamp_get_real_time: - * @self: A [struct@Tstamp]. - * @real_time: (array fixed-size=2)(out)(transfer none): The array with two elements for sec part - * and nsec part of real time. - * - * Refer to the time as wall-clock time. - */ -void alsaseq_tstamp_get_real_time(const ALSASeqTstamp *self, - const guint32 *real_time[2]) -{ - // MEMO: I wish 32-bit storage size is aligned to 32 bit offset in all of - // supported ABIs. - *real_time = (guint32 *)&self->time; -} - - -/** - * alsaseq_tstamp_set_real_time: - * @self: A [struct@Tstamp]. - * @real_time: (array fixed-size=2)(transfer none): The array with two elements for sec part and - * nsec part of real time. - * - * Copy the time as wall-clock time. - */ -void alsaseq_tstamp_set_real_time(ALSASeqTstamp *self, const guint32 real_time[2]) -{ - self->time.tv_sec = real_time[0]; - self->time.tv_nsec = real_time[1]; -} diff --git a/src/seq/tstamp.h b/src/seq/tstamp.h deleted file mode 100644 index bb00392..0000000 --- a/src/seq/tstamp.h +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -#ifndef __ALSA_GOBJECT_ALSASEQ_TSTAMP_H__ -#define __ALSA_GOBJECT_ALSASEQ_TSTAMP_H__ - -#include - -G_BEGIN_DECLS - -#define ALSASEQ_TYPE_TSTAMP (alsaseq_tstamp_get_type()) - -typedef union snd_seq_timestamp ALSASeqTstamp; - -GType alsaseq_tstamp_get_type() G_GNUC_CONST; - -void alsaseq_tstamp_get_tick_time(const ALSASeqTstamp *self, guint32 *tick_time); -void alsaseq_tstamp_set_tick_time(ALSASeqTstamp *self, const guint32 tick_time); - -void alsaseq_tstamp_get_real_time(const ALSASeqTstamp *self, - const guint32 *real_time[2]); -void alsaseq_tstamp_set_real_time(ALSASeqTstamp *self, const guint32 real_time[2]); - -G_END_DECLS - -#endif -- 2.47.3