From 2be38f6926d8bf2738c3898e831dcb3928925f90 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Tue, 22 Jun 2010 12:12:16 -0400 Subject: [PATCH] GDBus: update padding Add lots of padding for public class structures. Notably, we seemed to lack any padding whatsoever in the GDBusMessageClass struct (spotted by Dan Winship). Also switch to using gpointer padding[N]; instead of void (*_g_reserved1) (void); ... void (*_g_reservedN) (void); Signed-off-by: David Zeuthen --- gio/gdbusauth.h | 4 ++++ gio/gdbusauthmechanism.h | 18 +----------------- gio/gdbusauthmechanismanon.h | 17 +---------------- gio/gdbusauthmechanismexternal.h | 17 +---------------- gio/gdbusauthmechanismsha1.h | 17 +---------------- gio/gdbusauthobserver.h | 17 +---------------- gio/gdbusconnection.h | 18 ++---------------- gio/gdbusmessage.h | 4 ++++ gio/gdbusmethodinvocation.h | 9 +-------- gio/gdbusproxy.h | 9 +-------- gio/gdbusserver.h | 9 +-------- 11 files changed, 18 insertions(+), 121 deletions(-) diff --git a/gio/gdbusauth.h b/gio/gdbusauth.h index 039565932..b1ebe06e6 100644 --- a/gio/gdbusauth.h +++ b/gio/gdbusauth.h @@ -46,6 +46,10 @@ struct _GDBusAuthClass { /*< private >*/ GObjectClass parent_class; + + /*< private >*/ + /* Padding for future expansion */ + gpointer padding[16]; }; struct _GDBusAuth diff --git a/gio/gdbusauthmechanism.h b/gio/gdbusauthmechanism.h index fd46d71ca..3ad610bec 100644 --- a/gio/gdbusauthmechanism.h +++ b/gio/gdbusauthmechanism.h @@ -101,25 +101,9 @@ struct _GDBusAuthMechanismClass gsize *out_data_len); void (*client_shutdown) (GDBusAuthMechanism *mechanism); - /*< private >*/ /* Padding for future expansion */ - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); - void (*_g_reserved6) (void); - void (*_g_reserved7) (void); - void (*_g_reserved8) (void); - void (*_g_reserved9) (void); - void (*_g_reserved10) (void); - void (*_g_reserved11) (void); - void (*_g_reserved12) (void); - void (*_g_reserved13) (void); - void (*_g_reserved14) (void); - void (*_g_reserved15) (void); - void (*_g_reserved16) (void); + gpointer padding[16]; }; struct _GDBusAuthMechanism diff --git a/gio/gdbusauthmechanismanon.h b/gio/gdbusauthmechanismanon.h index b770e20b3..92d11b96a 100644 --- a/gio/gdbusauthmechanismanon.h +++ b/gio/gdbusauthmechanismanon.h @@ -50,22 +50,7 @@ struct _GDBusAuthMechanismAnonClass /*< private >*/ /* Padding for future expansion */ - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); - void (*_g_reserved6) (void); - void (*_g_reserved7) (void); - void (*_g_reserved8) (void); - void (*_g_reserved9) (void); - void (*_g_reserved10) (void); - void (*_g_reserved11) (void); - void (*_g_reserved12) (void); - void (*_g_reserved13) (void); - void (*_g_reserved14) (void); - void (*_g_reserved15) (void); - void (*_g_reserved16) (void); + gpointer padding[16]; }; struct _GDBusAuthMechanismAnon diff --git a/gio/gdbusauthmechanismexternal.h b/gio/gdbusauthmechanismexternal.h index 552dd2e71..7c086f9b9 100644 --- a/gio/gdbusauthmechanismexternal.h +++ b/gio/gdbusauthmechanismexternal.h @@ -50,22 +50,7 @@ struct _GDBusAuthMechanismExternalClass /*< private >*/ /* Padding for future expansion */ - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); - void (*_g_reserved6) (void); - void (*_g_reserved7) (void); - void (*_g_reserved8) (void); - void (*_g_reserved9) (void); - void (*_g_reserved10) (void); - void (*_g_reserved11) (void); - void (*_g_reserved12) (void); - void (*_g_reserved13) (void); - void (*_g_reserved14) (void); - void (*_g_reserved15) (void); - void (*_g_reserved16) (void); + gpointer padding[16]; }; struct _GDBusAuthMechanismExternal diff --git a/gio/gdbusauthmechanismsha1.h b/gio/gdbusauthmechanismsha1.h index 762fc5abf..5b0cbf9a4 100644 --- a/gio/gdbusauthmechanismsha1.h +++ b/gio/gdbusauthmechanismsha1.h @@ -50,22 +50,7 @@ struct _GDBusAuthMechanismSha1Class /*< private >*/ /* Padding for future expansion */ - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); - void (*_g_reserved6) (void); - void (*_g_reserved7) (void); - void (*_g_reserved8) (void); - void (*_g_reserved9) (void); - void (*_g_reserved10) (void); - void (*_g_reserved11) (void); - void (*_g_reserved12) (void); - void (*_g_reserved13) (void); - void (*_g_reserved14) (void); - void (*_g_reserved15) (void); - void (*_g_reserved16) (void); + gpointer padding[16]; }; struct _GDBusAuthMechanismSha1 diff --git a/gio/gdbusauthobserver.h b/gio/gdbusauthobserver.h index f5f6385ad..4ea3a98b6 100644 --- a/gio/gdbusauthobserver.h +++ b/gio/gdbusauthobserver.h @@ -65,22 +65,7 @@ struct _GDBusAuthObserverClass /*< private >*/ /* Padding for future expansion */ - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); - void (*_g_reserved6) (void); - void (*_g_reserved7) (void); - void (*_g_reserved8) (void); - void (*_g_reserved9) (void); - void (*_g_reserved10) (void); - void (*_g_reserved11) (void); - void (*_g_reserved12) (void); - void (*_g_reserved13) (void); - void (*_g_reserved14) (void); - void (*_g_reserved15) (void); - void (*_g_reserved16) (void); + gpointer padding[32]; }; /** diff --git a/gio/gdbusconnection.h b/gio/gdbusconnection.h index 7390dc561..d80daf24d 100644 --- a/gio/gdbusconnection.h +++ b/gio/gdbusconnection.h @@ -77,14 +77,7 @@ struct _GDBusConnectionClass /*< private >*/ /* Padding for future expansion */ - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); - void (*_g_reserved6) (void); - void (*_g_reserved7) (void); - void (*_g_reserved8) (void); + gpointer padding[64]; }; GType g_dbus_connection_get_type (void) G_GNUC_CONST; @@ -304,14 +297,7 @@ struct _GDBusInterfaceVTable /*< private >*/ /* Padding for future expansion */ - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); - void (*_g_reserved6) (void); - void (*_g_reserved7) (void); - void (*_g_reserved8) (void); + gpointer padding[8]; }; guint g_dbus_connection_register_object (GDBusConnection *connection, diff --git a/gio/gdbusmessage.h b/gio/gdbusmessage.h index f344f09fd..6c350062d 100644 --- a/gio/gdbusmessage.h +++ b/gio/gdbusmessage.h @@ -52,6 +52,10 @@ struct _GDBusMessageClass { /*< private >*/ GObjectClass parent_class; + + /*< private >*/ + /* Padding for future expansion */ + gpointer padding[32]; }; /** diff --git a/gio/gdbusmethodinvocation.h b/gio/gdbusmethodinvocation.h index 633226eab..1eeee322c 100644 --- a/gio/gdbusmethodinvocation.h +++ b/gio/gdbusmethodinvocation.h @@ -70,14 +70,7 @@ struct _GDBusMethodInvocationClass /*< private >*/ /* Padding for future expansion */ - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); - void (*_g_reserved6) (void); - void (*_g_reserved7) (void); - void (*_g_reserved8) (void); + gpointer padding[32]; }; GType g_dbus_method_invocation_get_type (void) G_GNUC_CONST; diff --git a/gio/gdbusproxy.h b/gio/gdbusproxy.h index 52942295e..d9858c172 100644 --- a/gio/gdbusproxy.h +++ b/gio/gdbusproxy.h @@ -83,14 +83,7 @@ struct _GDBusProxyClass /*< private >*/ /* Padding for future expansion */ - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); - void (*_g_reserved6) (void); - void (*_g_reserved7) (void); - void (*_g_reserved8) (void); + gpointer padding[32]; }; GType g_dbus_proxy_get_type (void) G_GNUC_CONST; diff --git a/gio/gdbusserver.h b/gio/gdbusserver.h index 48788484e..ce4030d01 100644 --- a/gio/gdbusserver.h +++ b/gio/gdbusserver.h @@ -76,14 +76,7 @@ struct _GDBusServerClass /*< private >*/ /* Padding for future expansion */ - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); - void (*_g_reserved6) (void); - void (*_g_reserved7) (void); - void (*_g_reserved8) (void); + gpointer padding[16]; }; GType g_dbus_server_get_type (void) G_GNUC_CONST;