[gtk+] Improve struct packing in various places



commit e5317f0f9ad3c8dfb9df0d90e3d7b16524334f49
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Sep 21 23:37:48 2013 -0400

    Improve struct packing in various places

 gtk/gtkapplication.c           |   10 +++++-----
 gtk/gtkapplicationwindow.c     |    2 +-
 gtk/gtkcontainer.c             |    2 +-
 gtk/gtkcssanimationprivate.h   |    2 +-
 gtk/gtkcssimagescaledprivate.h |    3 ++-
 gtk/gtkentry.c                 |    5 ++---
 gtk/gtkentryprivate.h          |    5 +++--
 gtk/gtkimage.c                 |    6 +++---
 gtk/gtklevelbar.c              |    4 ++--
 gtk/gtkmenubutton.c            |    2 +-
 gtk/gtkplacessidebar.c         |   11 +++++------
 gtk/gtkrbtree.h                |    9 +++++----
 gtk/gtkstylecontext.c          |    2 +-
 gtk/gtktreemodelsort.c         |    4 ++--
 gtk/gtktreestore.c             |    2 +-
 gtk/gtktreeview.c              |   17 +++++++++--------
 gtk/gtktreeviewcolumn.c        |    2 +-
 gtk/gtkwidget.c                |    2 +-
 gtk/gtkwidgetpath.c            |    2 +-
 19 files changed, 47 insertions(+), 45 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index 2727ece..0da7bfc 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -141,12 +141,14 @@ struct _GtkApplicationPrivate
 {
   GList *windows;
 
-  gboolean register_session;
-
   GMenuModel      *app_menu;
   GMenuModel      *menubar;
 
+  gboolean register_session;
+
 #ifdef GDK_WINDOWING_X11
+  guint next_id;
+
   GDBusConnection *session_bus;
   const gchar     *application_id;
   const gchar     *object_path;
@@ -154,10 +156,8 @@ struct _GtkApplicationPrivate
   gchar           *app_menu_path;
   guint            app_menu_id;
 
-  gchar           *menubar_path;
   guint            menubar_id;
-
-  guint next_id;
+  gchar           *menubar_path;
 
   GDBusProxy *sm_proxy;
   GDBusProxy *client_proxy;
diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c
index 5d931be..c0bf5b6 100644
--- a/gtk/gtkapplicationwindow.c
+++ b/gtk/gtkapplicationwindow.c
@@ -221,9 +221,9 @@ struct _GtkApplicationWindowPrivate
   GSList *accel_closures;
   guint accel_map_changed_id;
 
+  gboolean show_menubar;
   GMenu *app_menu_section;
   GMenu *menubar_section;
-  gboolean show_menubar;
 
   GDBusConnection *session;
   gchar           *object_path;
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 84dcd84..b3b1094 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -236,8 +236,8 @@ struct _GtkContainerPrivate
 {
   GtkWidget *focus_child;
 
-  guint resize_handler;
   GdkFrameClock *resize_clock;
+  guint resize_handler;
 
   guint border_width : 16;
 
diff --git a/gtk/gtkcssanimationprivate.h b/gtk/gtkcssanimationprivate.h
index 08dc663..928b614 100644
--- a/gtk/gtkcssanimationprivate.h
+++ b/gtk/gtkcssanimationprivate.h
@@ -45,10 +45,10 @@ struct _GtkCssAnimation
   GtkCssValue     *ease;
   gint64           timestamp;           /* elapsed time when paused, start time when playing (can be 
negative) */
   gint64           duration;            /* duration of 1 cycle */
+  double           iteration_count;
   GtkCssDirection  direction;
   GtkCssPlayState  play_state;
   GtkCssFillMode   fill_mode;
-  double           iteration_count;
 };
 
 struct _GtkCssAnimationClass
diff --git a/gtk/gtkcssimagescaledprivate.h b/gtk/gtkcssimagescaledprivate.h
index ec1b669..b415d08 100644
--- a/gtk/gtkcssimagescaledprivate.h
+++ b/gtk/gtkcssimagescaledprivate.h
@@ -38,9 +38,10 @@ struct _GtkCssImageScaled
 {
   GtkCssImage parent;
 
-  int          scale;
   GtkCssImage **images;
   int          n_images;
+
+  int          scale;
 };
 
 struct _GtkCssImageScaledClass
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 01fa816..d124b46 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -234,10 +234,9 @@ struct _EntryIconInfo
   guint in_drag        : 1;
   guint pressed        : 1;
 
-  GtkIconHelper *icon_helper;
-
-  GtkTargetList *target_list;
   GdkDragAction actions;
+  GtkTargetList *target_list;
+  GtkIconHelper *icon_helper;
 };
 
 struct _GtkEntryPasswordHint
diff --git a/gtk/gtkentryprivate.h b/gtk/gtkentryprivate.h
index 9d6f1e9..7e84d06 100644
--- a/gtk/gtkentryprivate.h
+++ b/gtk/gtkentryprivate.h
@@ -34,7 +34,6 @@ struct _GtkEntryCompletionPrivate
   GtkTreeViewColumn *column;
   GtkTreeModelFilter *filter_model;
   GtkListStore *actions;
-  gboolean first_sel_changed;
   GtkCellArea *cell_area;
 
   GtkEntryCompletionMatchFunc match_func;
@@ -43,7 +42,6 @@ struct _GtkEntryCompletionPrivate
 
   gint minimum_key_length;
   gint text_column;
-  gint current_selected;
 
   gchar *case_normalized_key;
 
@@ -57,6 +55,9 @@ struct _GtkEntryCompletionPrivate
   gulong changed_id;
   gulong insert_text_id;
 
+  gint current_selected;
+
+  guint first_sel_changed : 1;
   guint ignore_enter      : 1;
   guint has_completion    : 1;
   guint inline_completion : 1;
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index a6b6572..5128c0e 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -136,13 +136,13 @@ struct _GtkImagePrivate
 {
   GtkIconHelper *icon_helper;
 
-  gint animation_timeout;
   GdkPixbufAnimationIter *animation_iter;
+  gint animation_timeout;
+
+  float baseline_align;
 
   gchar                *filename;       /* Only used with GTK_IMAGE_ANIMATION, GTK_IMAGE_PIXBUF */
   gchar                *resource_path;  /* Only used with GTK_IMAGE_PIXBUF */
-
-  float baseline_align;
 };
 
 
diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c
index 744ee2c..6a1a706 100644
--- a/gtk/gtklevelbar.c
+++ b/gtk/gtklevelbar.c
@@ -136,14 +136,14 @@ typedef struct {
 struct _GtkLevelBarPrivate {
   GtkOrientation orientation;
 
+  GtkLevelBarMode bar_mode;
+
   gdouble min_value;
   gdouble max_value;
   gdouble cur_value;
 
   GList *offsets;
 
-  GtkLevelBarMode bar_mode;
-
   guint inverted : 1;
 };
 
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index d185a31..60573da 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -160,9 +160,9 @@ struct _GtkMenuButtonPrivate
   GtkMenuButtonShowMenuCallback func;
   gpointer user_data;
 
-  GtkArrowType arrow_type;
   GtkWidget *align_widget;
   gpointer arrow_widget;
+  GtkArrowType arrow_type;
 };
 
 enum
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index a019dcd..d38d38d 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -144,16 +144,12 @@ struct _GtkPlacesSidebar {
 
        /* DnD */
        GList     *drag_list; /* list of GFile */
-       gboolean  drag_data_received;
        int       drag_data_info;
-       gboolean  drop_occured;
-
-       GtkWidget *popup_menu;
 
        /* volume mounting - delayed open process */
-       gboolean mounting;
        GtkPlacesOpenFlags go_to_after_mount_open_flags;
 
+       GtkWidget *popup_menu;
        GSList *shortcuts;
 
        GDBusProxy *hostnamed_proxy;
@@ -165,9 +161,12 @@ struct _GtkPlacesSidebar {
        DropState drop_state;
        int new_bookmark_index;
        guint drag_leave_timeout_id;
-       guint switch_location_timer;
        char *drop_target_uri;
+       guint switch_location_timer;
 
+       guint mounting : 1;
+       guint  drag_data_received : 1;
+       guint drop_occured : 1;
        guint show_desktop : 1;
        guint show_connect_to_server : 1;
 };
diff --git a/gtk/gtkrbtree.h b/gtk/gtkrbtree.h
index a1b27a2..9e088a1 100644
--- a/gtk/gtkrbtree.h
+++ b/gtk/gtkrbtree.h
@@ -63,14 +63,15 @@ struct _GtkRBNode
 {
   guint flags : 14;
 
-  GtkRBNode *left;
-  GtkRBNode *right;
-  GtkRBNode *parent;
-
   /* count is the number of nodes beneath us, plus 1 for ourselves.
    * i.e. node->left->count + node->right->count + 1
    */
   gint count;
+
+  GtkRBNode *left;
+  GtkRBNode *right;
+  GtkRBNode *parent;
+
   /* count the number of total nodes beneath us, including nodes
    * of children trees.
    * i.e. node->left->count + node->right->count + node->children->root->count + 1
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index f205059..cf7ea20 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -365,8 +365,8 @@ struct _GtkStyleContextPrivate
   GtkStyleInfo *info;
   gint scale;
 
-  GdkFrameClock *frame_clock;
   guint frame_clock_update_id;
+  GdkFrameClock *frame_clock;
 
   GtkCssChange relevant_changes;
   GtkCssChange pending_changes;
diff --git a/gtk/gtktreemodelsort.c b/gtk/gtktreemodelsort.c
index 4033dbb..7e5dc57 100644
--- a/gtk/gtktreemodelsort.c
+++ b/gtk/gtktreemodelsort.c
@@ -228,8 +228,8 @@ struct _SortElt
   gint           offset;
   gint           ref_count;
   gint           zero_ref_count;
-  GSequenceIter *siter; /* iter into seq */
   gint           old_index; /* used while sorting */
+  GSequenceIter *siter; /* iter into seq */
 };
 
 struct _SortLevel
@@ -247,8 +247,8 @@ struct _SortData
   gpointer sort_data;
 
   GtkTreePath *parent_path;
-  gint parent_path_depth;
   gint *parent_path_indices;
+  gint parent_path_depth;
 };
 
 /* Properties */
diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c
index de76a8f..bbf6e5d 100644
--- a/gtk/gtktreestore.c
+++ b/gtk/gtktreestore.c
@@ -65,12 +65,12 @@
 struct _GtkTreeStorePrivate
 {
   gint stamp;
+  GtkSortType order;
   gpointer root;
   gpointer last;
   gint n_columns;
   gint sort_column_id;
   GList *sort_list;
-  GtkSortType order;
   GType *column_headers;
   GtkTreeIterCompareFunc default_sort_func;
   gpointer default_sort_data;
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 718174c..d228360 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -294,6 +294,8 @@ struct _GtkTreeViewPrivate
   GList *children;
   gint width;
 
+  guint presize_handler_tick_cb;
+
   /* Adjustments */
   GtkAdjustment *hadjustment;
   GtkAdjustment *vadjustment;
@@ -313,7 +315,6 @@ struct _GtkTreeViewPrivate
   /* we cache it for simplicity of the code */
   gint dy;
 
-  guint presize_handler_tick_cb;
   guint validate_rows_timer;
   guint scroll_sync_timer;
 
@@ -364,9 +365,9 @@ struct _GtkTreeViewPrivate
   GtkTreeSelection *selection;
 
   /* Header information */
+  gint header_height;
   gint n_columns;
   GList *columns;
-  gint header_height;
 
   GtkTreeViewColumnDropFunc column_drop_func;
   gpointer column_drop_func_data;
@@ -376,6 +377,9 @@ struct _GtkTreeViewPrivate
 
   gint prev_width_before_expander;
 
+  /* Scroll timeout (e.g. during dnd, rubber banding) */
+  guint scroll_timeout;
+
   /* Interactive Header reordering */
   GdkWindow *drag_window;
   GdkWindow *drag_highlight_window;
@@ -396,9 +400,6 @@ struct _GtkTreeViewPrivate
   gpointer destroy_count_data;
   GDestroyNotify destroy_count_destroy;
 
-  /* Scroll timeout (e.g. during dnd, rubber banding) */
-  guint scroll_timeout;
-
   /* Row drag-and-drop */
   GtkTreeRowReference *drag_dest_row;
   GtkTreeViewDropPosition drag_dest_pos;
@@ -411,15 +412,15 @@ struct _GtkTreeViewPrivate
   gint rubber_band_extend;
   gint rubber_band_modify;
 
+  /* fixed height */
+  gint fixed_height;
+
   GtkRBNode *rubber_band_start_node;
   GtkRBTree *rubber_band_start_tree;
 
   GtkRBNode *rubber_band_end_node;
   GtkRBTree *rubber_band_end_tree;
 
-  /* fixed height */
-  gint fixed_height;
-
   /* Scroll-to functionality when unrealized */
   GtkTreeRowReference *scroll_to_path;
   GtkTreeViewColumn *scroll_to_column;
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index ff3b46c..ea16706 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -133,8 +133,8 @@ struct _GtkTreeViewColumnPrivate
   GtkWidget *arrow;
   GtkWidget *alignment;
   GdkWindow *window;
-  gfloat xalign;
   gulong property_changed_signal;
+  gfloat xalign;
 
   /* Sizing fields */
   /* see gtk+/doc/tree-column-sizing.txt for more information on them */
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c49fb57..b29396e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -524,9 +524,9 @@ struct _GtkWidgetPrivate
 
 struct _GtkWidgetClassPrivate
 {
+  GtkWidgetTemplate *template;
   GType accessible_type;
   AtkRole accessible_role;
-  GtkWidgetTemplate *template;
 };
 
 enum {
diff --git a/gtk/gtkwidgetpath.c b/gtk/gtkwidgetpath.c
index 855902f..342ddec 100644
--- a/gtk/gtkwidgetpath.c
+++ b/gtk/gtkwidgetpath.c
@@ -89,10 +89,10 @@ struct GtkPathElement
 {
   GType type;
   GQuark name;
+  guint sibling_index;
   GHashTable *regions;
   GArray *classes;
   GtkWidgetPath *siblings;
-  guint sibling_index;
 };
 
 struct _GtkWidgetPath


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