[librest/wip/rishi/autocleanups: 1/7] oauth-proxy: Use G_DECLARE_DERIVABLE_TYPE




commit 781a01b713aa2a4ccb629cfe34437bb575bedabc
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Jun 2 16:49:07 2021 +0200

    oauth-proxy: Use G_DECLARE_DERIVABLE_TYPE

 rest/oauth-proxy.h | 25 +++----------------------
 1 file changed, 3 insertions(+), 22 deletions(-)
---
diff --git a/rest/oauth-proxy.h b/rest/oauth-proxy.h
index fa1a89e..843b27d 100644
--- a/rest/oauth-proxy.h
+++ b/rest/oauth-proxy.h
@@ -28,37 +28,20 @@
 G_BEGIN_DECLS
 
 #define OAUTH_TYPE_PROXY oauth_proxy_get_type()
-
-#define OAUTH_PROXY(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST ((obj), OAUTH_TYPE_PROXY, OAuthProxy))
-
-#define OAUTH_PROXY_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST ((klass), OAUTH_TYPE_PROXY, OAuthProxyClass))
-
-#define OAUTH_IS_PROXY(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OAUTH_TYPE_PROXY))
-
-#define OAUTH_IS_PROXY_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE ((klass), OAUTH_TYPE_PROXY))
-
-#define OAUTH_PROXY_GET_CLASS(obj) \
-  (G_TYPE_INSTANCE_GET_CLASS ((obj), OAUTH_TYPE_PROXY, OAuthProxyClass))
+G_DECLARE_DERIVABLE_TYPE (OAuthProxy, oauth_proxy, OAUTH, PROXY, RestProxy)
 
 /**
  * OAuthProxy:
  *
  * #OAuthProxy has no publicly available members.
  */
-typedef struct {
-  RestProxy parent;
-} OAuthProxy;
 
-typedef struct {
+struct _OAuthProxyClass {
   RestProxyClass parent_class;
   /*< private >*/
   /* padding for future expansion */
   gpointer _padding_dummy[8];
-} OAuthProxyClass;
+};
 
 GType oauth_signature_method_get_type (void) G_GNUC_CONST;
 #define OAUTH_TYPE_SIGNATURE_METHOD (oauth_signature_method_get_type())
@@ -77,8 +60,6 @@ typedef enum {
   HMAC_SHA1
 } OAuthSignatureMethod;
 
-GType oauth_proxy_get_type (void);
-
 RestProxy* oauth_proxy_new (const char *consumer_key,
                             const char *consumer_secret,
                             const gchar *url_format,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]