[gtksourceview] Save a few more bits.



commit 44302f747b0b67b43dddc046ef25690caa8b260b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Jan 12 14:55:15 2011 +0100

    Save a few more bits.

 gtksourceview/gtksourcebuffer.c          |   10 ++++------
 gtksourceview/gtksourcecompletion.c      |   13 +++++++------
 gtksourceview/gtksourcecompletionmodel.c |   20 +++++++++++---------
 gtksourceview/gtksourcegutterrenderer.c  |   10 ++++++----
 4 files changed, 28 insertions(+), 25 deletions(-)
---
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index f15e51b..384bc93 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -107,11 +107,6 @@ enum {
 
 struct _GtkSourceBufferPrivate
 {
-	gint                   highlight_syntax:1;
-	gint                   highlight_brackets:1;
-
-	gint                   constructed:1;
-
 	GtkTextTag            *bracket_match_tag;
 	GtkTextMark           *bracket_mark_cursor;
 	GtkTextMark           *bracket_mark_match;
@@ -127,7 +122,10 @@ struct _GtkSourceBufferPrivate
 	GtkSourceUndoManager  *undo_manager;
 	gint                   max_undo_levels;
 
-	gint                   allow_bracket_match:1;
+	guint                  highlight_syntax : 1;
+	guint                  highlight_brackets : 1;
+	guint                  constructed : 1;
+	guint                  allow_bracket_match : 1;
 };
 
 G_DEFINE_TYPE (GtkSourceBuffer, gtk_source_buffer, GTK_TYPE_TEXT_BUFFER)
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index c4b49c4..d2a207d 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -124,10 +124,6 @@ struct _GtkSourceCompletionPrivate
 	GtkWidget *tree_view_proposals;
 	GtkSourceCompletionModel *model_proposals;
 
-	gboolean remember_info_visibility;
-	gboolean info_visible;
-	gboolean select_on_show;
-	gboolean show_headers;
 	guint num_accelerators;
 
 	/* Page size */
@@ -151,14 +147,19 @@ struct _GtkSourceCompletionPrivate
 	gint typing_line_offset;
 
 	gulong signals_ids[LAST_EXTERNAL_SIGNAL];
-	gboolean select_first;
-	gboolean show_icons;
 
 	gint min_auto_complete_delay;
 	GList *auto_completion_selection;
 	GtkSourceCompletionContext *auto_completion_context;
 
 	gint block_count;
+
+	guint remember_info_visibility : 1;
+	guint info_visible : 1;
+	guint select_on_show : 1;
+	guint show_headers : 1;
+	guint select_first : 1;
+	guint show_icons : 1;
 };
 
 static guint signals[LAST_SIGNAL] = { 0 };
diff --git a/gtksourceview/gtksourcecompletionmodel.c b/gtksourceview/gtksourcecompletionmodel.c
index 733411c..7d4e5f4 100644
--- a/gtksourceview/gtksourcecompletionmodel.c
+++ b/gtksourceview/gtksourcecompletionmodel.c
@@ -33,9 +33,9 @@ typedef struct
 	GtkSourceCompletionProposal *proposal;
 
 	gulong changed_id;
-	gboolean mark;
-	
-	gboolean filtered;
+
+	guint mark : 1;
+	guint filtered : 1;
 } ProposalNode;
 
 typedef struct
@@ -43,12 +43,12 @@ typedef struct
 	GtkSourceCompletionProvider *provider;
 	GHashTable *proposals;
 	guint num_proposals;
-	gboolean filtered;
 
 	GList *first;
 	GList *last;
 	GList *ptr;
-	gboolean first_batch;
+	guint first_batch : 1;
+	guint filtered : 1;
 } ProviderInfo;
 
 struct _GtkSourceCompletionModelPrivate
@@ -62,9 +62,9 @@ struct _GtkSourceCompletionModelPrivate
 	GList *visible_providers;
 	
 	guint num;
-	gboolean show_headers;
-	
-	gboolean marking;
+
+	guint show_headers : 1;
+	guint marking : 1;
 };
 
 enum
@@ -1355,7 +1355,9 @@ gtk_source_completion_model_set_show_headers (GtkSourceCompletionModel *model,
                                               gboolean                  show_headers)
 {
 	g_return_if_fail (GTK_IS_SOURCE_COMPLETION_MODEL (model));
-	
+
+	show_headers = (show_headers != FALSE);
+
 	if (model->priv->show_headers != show_headers)
 	{
 		model->priv->show_headers = show_headers;
diff --git a/gtksourceview/gtksourcegutterrenderer.c b/gtksourceview/gtksourcegutterrenderer.c
index 31bc591..af5ce39 100644
--- a/gtksourceview/gtksourcegutterrenderer.c
+++ b/gtksourceview/gtksourcegutterrenderer.c
@@ -52,11 +52,11 @@ struct _GtkSourceGutterRendererPrivate
 
 	gint size;
 
-	GdkRGBA background_color;
-	gboolean background_set;
-
 	GtkSourceGutterRendererAlignmentMode alignment_mode;
 
+	GdkRGBA background_color;
+
+	guint background_set : 1;
 	guint visible : 1;
 };
 
@@ -276,8 +276,10 @@ set_size (GtkSourceGutterRenderer *renderer,
 
 static void
 set_background_color_set (GtkSourceGutterRenderer *renderer,
-                         gboolean                 isset)
+                          gboolean                 isset)
 {
+	isset = (isset != FALSE);
+
 	if (isset != renderer->priv->background_set)
 	{
 		renderer->priv->background_set = isset;



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