From bd6c4a0dec073d6f3ec360bc0045536c211c4cd1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 19 May 2019 15:41:12 +0000 Subject: [PATCH] Padding review Ensure that the class structs of all subclassable types have sufficient padding (standardizing on 8 slots, here). GtkApplication GtkWidget GtkContainer GtkWindow GtkDialog GtkApplicationWindow GtkToolItem GtkBin --- gtk/gtkapplication.h | 2 +- gtk/gtkapplicationwindow.h | 2 +- gtk/gtkbin.h | 6 +----- gtk/gtkcontainer.h | 10 +--------- gtk/gtkdialog.h | 6 +----- gtk/gtktoolitem.h | 6 +----- gtk/gtkwidget.h | 3 +-- gtk/gtkwindow.h | 6 +----- 8 files changed, 8 insertions(+), 33 deletions(-) diff --git a/gtk/gtkapplication.h b/gtk/gtkapplication.h index 253644376d..9678b6bf38 100644 --- a/gtk/gtkapplication.h +++ b/gtk/gtkapplication.h @@ -65,7 +65,7 @@ struct _GtkApplicationClass GtkWindow *window); /*< private >*/ - gpointer padding[12]; + gpointer padding[8]; }; GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkapplicationwindow.h b/gtk/gtkapplicationwindow.h index 7f243ee555..d978b5f593 100644 --- a/gtk/gtkapplicationwindow.h +++ b/gtk/gtkapplicationwindow.h @@ -62,7 +62,7 @@ struct _GtkApplicationWindowClass GtkWindowClass parent_class; /*< private >*/ - gpointer padding[14]; + gpointer padding[8]; }; GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkbin.h b/gtk/gtkbin.h index b86bad52f0..72010a06e1 100644 --- a/gtk/gtkbin.h +++ b/gtk/gtkbin.h @@ -60,11 +60,7 @@ struct _GtkBinClass /*< private >*/ - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); + gpointer padding[8]; }; diff --git a/gtk/gtkcontainer.h b/gtk/gtkcontainer.h index f092e40c86..e3dd79a0ac 100644 --- a/gtk/gtkcontainer.h +++ b/gtk/gtkcontainer.h @@ -89,15 +89,7 @@ struct _GtkContainerClass /*< private >*/ - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); - void (*_gtk_reserved5) (void); - void (*_gtk_reserved6) (void); - void (*_gtk_reserved7) (void); - void (*_gtk_reserved8) (void); + gpointer padding[8]; }; diff --git a/gtk/gtkdialog.h b/gtk/gtkdialog.h index 408bc61a4e..056253041d 100644 --- a/gtk/gtkdialog.h +++ b/gtk/gtkdialog.h @@ -128,11 +128,7 @@ struct _GtkDialogClass /*< private >*/ - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); + gpointer padding[8]; }; diff --git a/gtk/gtktoolitem.h b/gtk/gtktoolitem.h index 143db85053..6482a09e20 100644 --- a/gtk/gtktoolitem.h +++ b/gtk/gtktoolitem.h @@ -69,11 +69,7 @@ struct _GtkToolItemClass /*< private >*/ - /* Padding for future expansion */ - void (* _gtk_reserved1) (void); - void (* _gtk_reserved2) (void); - void (* _gtk_reserved3) (void); - void (* _gtk_reserved4) (void); + gpointer padding[8]; }; diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 42a8021e8f..8e1024fade 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -339,8 +339,7 @@ struct _GtkWidgetClass GtkWidgetClassPrivate *priv; - /* Padding for future expansion */ - void (*_gtk_reserved7) (void); + gpointer padding[8]; }; diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 89e5365679..1d0766593e 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -81,11 +81,7 @@ struct _GtkWindowClass gboolean (* close_request) (GtkWindow *window); /*< private >*/ - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); + gpointer padding[8]; }; /**