summaryrefslogtreecommitdiff
path: root/gcr
diff options
context:
space:
mode:
authorCorentin Noël <corentin.noel@collabora.com>2021-12-09 12:08:33 +0100
committerCorentin Noël <tintou@noel.tf>2022-04-09 00:44:24 +0200
commit964f3a3eaccfeee980e008958611195724bc0696 (patch)
treef7277cb473c5aaefd532ccbcb9eccdbf9391cad1 /gcr
parentf95e334de77c8408982ff482bfe3471078b0cba4 (diff)
downloadgcr-964f3a3eaccfeee980e008958611195724bc0696.tar.gz
gcr-comparable: Use G_DECLARE_INTERFACE to define the interface
This means that GcrComparableIface becomes GcrComparableInterface and GCR_COMPARABLE_GET_INTERFACE becomes GCR_COMPARABLE_GET_IFACE. Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Diffstat (limited to 'gcr')
-rw-r--r--gcr/gcr-certificate.c2
-rw-r--r--gcr/gcr-certificate.h2
-rw-r--r--gcr/gcr-comparable.c9
-rw-r--r--gcr/gcr-comparable.h13
4 files changed, 9 insertions, 17 deletions
diff --git a/gcr/gcr-certificate.c b/gcr/gcr-certificate.c
index dd2b666..eb1b10a 100644
--- a/gcr/gcr-certificate.c
+++ b/gcr/gcr-certificate.c
@@ -1081,7 +1081,7 @@ gcr_certificate_mixin_emit_notify (GcrCertificate *self)
* macro instead of this function.
*/
void
-gcr_certificate_mixin_comparable_init (GcrComparableIface *iface)
+gcr_certificate_mixin_comparable_init (GcrComparableInterface *iface)
{
iface->compare = gcr_certificate_compare;
}
diff --git a/gcr/gcr-certificate.h b/gcr/gcr-certificate.h
index b414325..3cd2c18 100644
--- a/gcr/gcr-certificate.h
+++ b/gcr/gcr-certificate.h
@@ -137,7 +137,7 @@ gboolean gcr_certificate_get_basic_constraints (GcrCertificate *self
void gcr_certificate_mixin_emit_notify (GcrCertificate *self);
-void gcr_certificate_mixin_comparable_init (GcrComparableIface *iface);
+void gcr_certificate_mixin_comparable_init (GcrComparableInterface *iface);
void gcr_certificate_mixin_class_init (GObjectClass *object_class);
diff --git a/gcr/gcr-comparable.c b/gcr/gcr-comparable.c
index 91d54e9..4572dd1 100644
--- a/gcr/gcr-comparable.c
+++ b/gcr/gcr-comparable.c
@@ -30,18 +30,17 @@
*/
/**
- * GcrComparableIface:
+ * GcrComparableInterface:
* @parent: type interface
* @compare: Compare whether tow objects represent the same thing.
*
* The interface to implement for [iface@Comparable]
*/
-typedef GcrComparableIface GcrComparableInterface;
G_DEFINE_INTERFACE (GcrComparable, gcr_comparable, G_TYPE_OBJECT);
static void
-gcr_comparable_default_init (GcrComparableIface *iface)
+gcr_comparable_default_init (GcrComparableInterface *iface)
{
}
@@ -61,9 +60,9 @@ gint
gcr_comparable_compare (GcrComparable *self, GcrComparable *other)
{
g_return_val_if_fail (GCR_IS_COMPARABLE (self), -1);
- g_return_val_if_fail (GCR_COMPARABLE_GET_INTERFACE (self)->compare, -1);
+ g_return_val_if_fail (GCR_COMPARABLE_GET_IFACE (self)->compare, -1);
g_return_val_if_fail (G_IS_OBJECT (self), -1);
- return GCR_COMPARABLE_GET_INTERFACE (self)->compare (self, other);
+ return GCR_COMPARABLE_GET_IFACE (self)->compare (self, other);
}
/**
diff --git a/gcr/gcr-comparable.h b/gcr/gcr-comparable.h
index 5a8e28f..8d2208e 100644
--- a/gcr/gcr-comparable.h
+++ b/gcr/gcr-comparable.h
@@ -24,21 +24,14 @@
G_BEGIN_DECLS
-#define GCR_TYPE_COMPARABLE (gcr_comparable_get_type())
-#define GCR_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_COMPARABLE, GcrComparable))
-#define GCR_IS_COMPARABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_COMPARABLE))
-#define GCR_COMPARABLE_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GCR_TYPE_COMPARABLE, GcrComparableIface))
+#define GCR_TYPE_COMPARABLE gcr_comparable_get_type ()
+G_DECLARE_INTERFACE (GcrComparable, gcr_comparable, GCR, COMPARABLE, GObject)
-typedef struct _GcrComparable GcrComparable;
-typedef struct _GcrComparableIface GcrComparableIface;
-
-struct _GcrComparableIface {
+struct _GcrComparableInterface {
GTypeInterface parent;
gint (*compare) (GcrComparable *self, GcrComparable *other);
};
-GType gcr_comparable_get_type (void);
-
gint gcr_comparable_compare (GcrComparable *self,
GcrComparable *other);