From 45c957a4c292a7a638d2957af9c7ab5720921060 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Mon, 11 Apr 2022 17:42:26 +0900 Subject: [PATCH] seq: client_pool: use an utility macro to declare GObject-derived object Since gobject v2.44, an utility macro is available to declare GObject-derived objects. This commit replaces existent boireplates with it. Signed-off-by: Takashi Sakamoto --- src/seq/client-pool.c | 4 ++-- src/seq/client-pool.h | 32 +------------------------------- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/seq/client-pool.c b/src/seq/client-pool.c index 81ed916..c363f73 100644 --- a/src/seq/client-pool.c +++ b/src/seq/client-pool.c @@ -15,9 +15,9 @@ * * The object wraps 'struct snd_seq_client_pool' in UAPI of Linux sound subsystem. */ -struct _ALSASeqClientPoolPrivate { +typedef struct { struct snd_seq_client_pool pool; -}; +} ALSASeqClientPoolPrivate; G_DEFINE_TYPE_WITH_PRIVATE(ALSASeqClientPool, alsaseq_client_pool, G_TYPE_OBJECT) enum seq_client_pool_prop_type { diff --git a/src/seq/client-pool.h b/src/seq/client-pool.h index b2c2414..ca80dba 100644 --- a/src/seq/client-pool.h +++ b/src/seq/client-pool.h @@ -8,42 +8,12 @@ G_BEGIN_DECLS #define ALSASEQ_TYPE_CLIENT_POOL (alsaseq_client_pool_get_type()) -#define ALSASEQ_CLIENT_POOL(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - ALSASEQ_TYPE_CLIENT_POOL, \ - ALSASeqClientPool)) -#define ALSASEQ_IS_CLIENT_POOL(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - ALSASEQ_TYPE_CLIENT_POOL)) - -#define ALSASEQ_CLIENT_POOL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), \ - ALSASEQ_TYPE_CLIENT_POOL, \ - ALSASeqClientPoolClass)) -#define ALSASEQ_IS_CLIENT_POOL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), \ - ALSASEQ_TYPE_CLIENT_POOL)) -#define ALSASEQ_CLIENT_POOL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj), \ - ALSASEQ_TYPE_CLIENT_POOL, \ - ALSASeqClientPoolClass)) - -typedef struct _ALSASeqClientPool ALSASeqClientPool; -typedef struct _ALSASeqClientPoolClass ALSASeqClientPoolClass; -typedef struct _ALSASeqClientPoolPrivate ALSASeqClientPoolPrivate; - -struct _ALSASeqClientPool { - GObject parent_instance; - - ALSASeqClientPoolPrivate *priv; -}; +G_DECLARE_DERIVABLE_TYPE(ALSASeqClientPool, alsaseq_client_pool, ALSASEQ, CLIENT_POOL, GObject); struct _ALSASeqClientPoolClass { GObjectClass parent_class; }; -GType alsaseq_client_pool_get_type() G_GNUC_CONST; - ALSASeqClientPool *alsaseq_client_pool_new(); G_END_DECLS -- 2.47.3