[gtksourceview] Fix some dead assignments.



commit a18a42d7407fc154def5294ae530be1cafa4bad4
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Nov 6 18:39:30 2010 +0100

    Fix some dead assignments.

 gtksourceview/gtksourcebuffer.c          |    2 +-
 gtksourceview/gtksourcecompletion.c      |    8 ++------
 gtksourceview/gtksourcecompletionutils.c |   17 ++++++-----------
 gtksourceview/gtksourcegutter.c          |   10 ++++------
 gtksourceview/gtksourceview.c            |   19 ++++++++++---------
 5 files changed, 23 insertions(+), 33 deletions(-)
---
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index ac97897..f15e51b 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -1091,7 +1091,7 @@ gtk_source_buffer_find_bracket_match_real (GtkSourceBuffer           *buffer,
 
 	cur_char = gtk_text_iter_get_char (&iter);
 
-	base_char = search_char = cur_char;
+	base_char = cur_char;
 	cclass_mask = get_context_class_mask (buffer, &iter);
 
 	search_char = bracket_pair (base_char, &addition);
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index bc2fe3a..47718aa 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -878,11 +878,11 @@ select_first_provider (GtkSourceCompletion *completion)
 static void
 update_info_position (GtkSourceCompletion *completion)
 {
+	GdkScreen *screen;
 	gint x, y;
 	gint width, height;
-	gint sw, sh;
+	gint sw;
 	gint info_width;
-	GdkScreen *screen;
 
 	gtk_window_get_position (GTK_WINDOW (completion->priv->window), &x, &y);
 	gtk_window_get_size (GTK_WINDOW (completion->priv->window),
@@ -891,7 +891,6 @@ update_info_position (GtkSourceCompletion *completion)
 
 	screen = gtk_window_get_screen (GTK_WINDOW (completion->priv->window));
 	sw = gdk_screen_get_width (screen);
-	sh = gdk_screen_get_height (screen);
 
 	/* Determine on which side to place it */
 	if (x + width + info_width >= sw)
@@ -1559,7 +1558,6 @@ minimum_auto_complete_delay (GtkSourceCompletion *completion,
 static gboolean
 auto_completion_prematch (GtkSourceCompletion *completion)
 {
-	GtkTextBuffer *buffer;
 	GtkTextIter iter;
 	GtkSourceCompletionContext *context;
 	gint delay;
@@ -1576,8 +1574,6 @@ auto_completion_prematch (GtkSourceCompletion *completion)
 		return FALSE;
 	}
 
-	buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (completion->priv->view));
-
 	/* Check if the user has changed the cursor position. If yes, we don't complete */
 	get_iter_at_insert (completion, &iter);
 
diff --git a/gtksourceview/gtksourcecompletionutils.c b/gtksourceview/gtksourcecompletionutils.c
index 2fe75c2..1b46eee 100644
--- a/gtksourceview/gtksourcecompletionutils.c
+++ b/gtksourceview/gtksourcecompletionutils.c
@@ -295,20 +295,15 @@ gtk_source_completion_utils_move_to_iter (GtkWindow     *window,
 					  GtkSourceView *view,
 					  GtkTextIter   *iter)
 {
-	gint x;
-	gint y;
-	gint w;
-	gint h;
-	gint cx;
-	gint cy;
+	GdkScreen *screen;
+	gint x, y;
+	gint w, h;
+	gint sw, sh;
+	gint cx, cy;
 	gint oy;
 	gint height;
-	GdkScreen *screen;
 	gboolean overlapup;
 
-	gint sw = gdk_screen_width();
-	gint sh = gdk_screen_height();
-	
 	if (window != NULL)
 	{
 		screen = gtk_window_get_screen (window);
@@ -323,7 +318,7 @@ gtk_source_completion_utils_move_to_iter (GtkWindow     *window,
 
 	get_iter_pos (view, iter, &x, &y, &height);
 	gtk_window_get_size (window, &w, &h);
-	
+
 	oy = y;
 	compensate_for_gravity (window, &cx, &cy, w, h);
 
diff --git a/gtksourceview/gtksourcegutter.c b/gtksourceview/gtksourcegutter.c
index 4f0c608..72ad148 100644
--- a/gtksourceview/gtksourcegutter.c
+++ b/gtksourceview/gtksourcegutter.c
@@ -773,8 +773,7 @@ get_lines (GtkTextView  *text_view,
 {
 	GtkTextIter iter;
 	gint count;
-	gint size;
-      	gint last_line_num = -1;
+	gint last_line_num = -1;
 
 	g_array_set_size (buffer_coords, 0);
 	g_array_set_size (numbers, 0);
@@ -788,10 +787,9 @@ get_lines (GtkTextView  *text_view,
 	/* For each iter, get its location and add it to the arrays.
 	 * Stop when we pass last_y */
 	count = 0;
-  	size = 0;
 
-  	while (!gtk_text_iter_is_end (&iter))
-    	{
+	while (!gtk_text_iter_is_end (&iter))
+	{
 		gint y, height;
 
 		gtk_text_view_get_line_yrange (text_view, &iter, &y, &height);
@@ -815,7 +813,7 @@ get_lines (GtkTextView  *text_view,
 	}
 
 	if (gtk_text_iter_is_end (&iter))
-    	{
+	{
 		gint y, height;
 		gint line_num;
 
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 3752604..7b68df0 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -2343,8 +2343,7 @@ gtk_source_view_get_lines (GtkTextView  *text_view,
 {
 	GtkTextIter iter;
 	gint count;
-	gint size;
-      	gint last_line_num = -1;
+	gint last_line_num = -1;
 
 	g_array_set_size (buffer_coords, 0);
 	g_array_set_size (numbers, 0);
@@ -2357,17 +2356,19 @@ gtk_source_view_get_lines (GtkTextView  *text_view,
 	/* For each iter, get its location and add it to the arrays.
 	 * Stop when we pass last_y */
 	count = 0;
-  	size = 0;
 
-  	while (!gtk_text_iter_is_end (&iter))
-    	{
+	while (!gtk_text_iter_is_end (&iter))
+	{
 		gint y, height;
 
 		gtk_text_view_get_line_yrange (text_view, &iter, &y, &height);
 
 		g_array_append_val (buffer_coords, y);
 		if (line_heights)
+		{
 			g_array_append_val (line_heights, height);
+		}
+
 		last_line_num = gtk_text_iter_get_line (&iter);
 		g_array_append_val (numbers, last_line_num);
 
@@ -2380,7 +2381,7 @@ gtk_source_view_get_lines (GtkTextView  *text_view,
 	}
 
 	if (gtk_text_iter_is_end (&iter))
-    	{
+	{
 		gint y, height;
 		gint line_num;
 
@@ -4989,7 +4990,6 @@ gtk_source_view_get_visual_column (GtkSourceView     *view,
 				   const GtkTextIter *iter)
 {
 	gunichar tab_char;
-	GtkTextBuffer *buffer;
 	GtkTextIter position;
 	guint column, indent_width;
 
@@ -4997,7 +4997,6 @@ gtk_source_view_get_visual_column (GtkSourceView     *view,
 	g_return_val_if_fail (iter != NULL, 0);
 
 	tab_char = g_utf8_get_char ("\t");
-	buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
 
 	column = 0;
 	indent_width = get_real_indent_width (view);
@@ -5017,7 +5016,7 @@ gtk_source_view_get_visual_column (GtkSourceView     *view,
 		}
 
 		/* FIXME: this does not handle invisible text correctly, but
-                 * gtk_text_iter_forward_visible_cursor_position is too slow */
+		 * gtk_text_iter_forward_visible_cursor_position is too slow */
 		if (!gtk_text_iter_forward_char (&position))
 			break;
 	}
@@ -5046,7 +5045,9 @@ gtk_source_view_style_set (GtkWidget *widget, GtkStyle *previous_style)
 		/* re-set tab stops, but only if we already modified them, i.e.
 		 * do nothing with good old 8-space tabs */
 		if (view->priv->tabs_set)
+		{
 			set_tab_stops_internal (view);
+		}
 
 		/* make sure the margin position is recalculated on next expose */
 		view->priv->cached_right_margin_pos = -1;



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