[gtksourceview] buffer: small code improvement



commit 00daa5eb897b442617687a034e2ce9c57cfddd6f
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Jun 12 16:32:23 2016 +0200

    buffer: small code improvement
    
    - group related instance variables together.
    - check user_data param with GTK_SOURCE_BUFFER() macro, to get a warning
    in case user_data is not of the right type.

 gtksourceview/gtksourcebuffer.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index 2c9de89..cb29980 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -198,15 +198,15 @@ struct _GtkSourceBufferPrivate
 {
        GtkTextTag *bracket_match_tag;
        GtkSourceBracketMatchType bracket_match_state;
+       guint bracket_update_handler;
 
        /* Hash table: category -> MarksSequence */
        GHashTable *source_marks;
        GtkSourceMarksSequence *all_source_marks;
 
+       GtkSourceStyleScheme *style_scheme;
        GtkSourceLanguage *language;
-
        GtkSourceEngine *highlight_engine;
-       GtkSourceStyleScheme *style_scheme;
 
        GtkSourceUndoManager *undo_manager;
        gint max_undo_levels;
@@ -218,8 +218,6 @@ struct _GtkSourceBufferPrivate
 
        GtkTextTag *invalid_char_tag;
 
-       guint bracket_update_handler;
-
        guint highlight_syntax : 1;
        guint highlight_brackets : 1;
        guint implicit_trailing_newline : 1;
@@ -1074,7 +1072,7 @@ update_bracket_highlighting (GtkSourceBuffer *source_buffer)
 static gboolean
 do_bracket_update (gpointer user_data)
 {
-       GtkSourceBuffer *buffer = user_data;
+       GtkSourceBuffer *buffer = GTK_SOURCE_BUFFER (user_data);
 
        buffer->priv->bracket_update_handler = 0;
 


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