[geany/geany-plugins] 798868: spellcheck: Remove unused parameter

Colomban Wendling git-noreply at xxxxx
Sat Feb 20 21:51:17 UTC 2016


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 20 Feb 2016 21:51:17 UTC
Commit:      798868602f268255bccce5e4456867b5fb618c75
             https://github.com/geany/geany-plugins/commit/798868602f268255bccce5e4456867b5fb618c75

Log Message:
-----------
spellcheck: Remove unused parameter


Modified Paths:
--------------
    spellcheck/src/gui.c
    spellcheck/src/speller.c
    spellcheck/src/speller.h

Modified: spellcheck/src/gui.c
5 lines changed, 1 insertions(+), 4 deletions(-)
===================================================================
@@ -498,21 +498,18 @@ static gboolean check_lines(gpointer data)
 	/* since we're in an timeout callback, the document may have been closed */
 	if (DOC_VALID (doc))
 	{
-		gchar *line;
 		gint line_number = check_line_data.line_number;
 		gint line_count = check_line_data.line_count;
 		gint i;
 
 		for (i = 0; i < line_count; i++)
 		{
-			line = sci_get_line(doc->editor->sci, line_number);
 			indicator_clear_on_line(doc, line_number);
-			if (sc_speller_process_line(doc, line_number, line) != 0)
+			if (sc_speller_process_line(doc, line_number) != 0)
 			{
 				if (sc_info->use_msgwin)
 					msgwin_switch_tab(MSG_MESSAGE, FALSE);
 			}
-			g_free(line);
 			line_number++;
 		}
 	}


Modified: spellcheck/src/speller.c
14 lines changed, 3 insertions(+), 11 deletions(-)
===================================================================
@@ -199,7 +199,7 @@ static gint sc_speller_check_word(GeanyDocument *doc, gint line_number, const gc
 }
 
 
-gint sc_speller_process_line(GeanyDocument *doc, gint line_number, const gchar *line)
+gint sc_speller_process_line(GeanyDocument *doc, gint line_number)
 {
 	gint pos_start, pos_end;
 	gint wstart, wend;
@@ -210,7 +210,6 @@ gint sc_speller_process_line(GeanyDocument *doc, gint line_number, const gchar *
 
 	g_return_val_if_fail(sc_speller_dict != NULL, 0);
 	g_return_val_if_fail(doc != NULL, 0);
-	g_return_val_if_fail(line != NULL, 0);
 
 	/* add ' (single quote) temporarily to wordchars
 	 * to be able to check for "doesn't", "isn't" and similar */
@@ -259,7 +258,6 @@ gint sc_speller_process_line(GeanyDocument *doc, gint line_number, const gchar *
 
 void sc_speller_check_document(GeanyDocument *doc)
 {
-	gchar *line;
 	gint i;
 	gint first_line, last_line;
 	gchar *dict_string = NULL;
@@ -299,22 +297,16 @@ void sc_speller_check_document(GeanyDocument *doc)
 
 	if (first_line == last_line)
 	{
-		line = sci_get_selection_contents(doc->editor->sci);
-		suggestions_found += sc_speller_process_line(doc, first_line, line);
-		g_free(line);
+		suggestions_found += sc_speller_process_line(doc, first_line);
 	}
 	else
 	{
 		for (i = first_line; i < last_line; i++)
 		{
-			line = sci_get_line(doc->editor->sci, i);
-
-			suggestions_found += sc_speller_process_line(doc, i, line);
+			suggestions_found += sc_speller_process_line(doc, i);
 
 			/* process other GTK events to keep the GUI being responsive */
 			while (g_main_context_iteration(NULL, FALSE));
-
-			g_free(line);
 		}
 	}
 	if (suggestions_found == 0 && sc_info->use_msgwin)


Modified: spellcheck/src/speller.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -27,7 +27,7 @@
 #define SC_SPELLER_H 1
 
 
-gint sc_speller_process_line(GeanyDocument *doc, gint line_number, const gchar *line);
+gint sc_speller_process_line(GeanyDocument *doc, gint line_number);
 
 void sc_speller_check_document(GeanyDocument *doc);
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list