From 39e08bd3b8e0914567540315307e34f1b2f7d97b Mon Sep 17 00:00:00 2001 From: chingyinwan123 Date: Tue, 11 Dec 2018 19:38:12 +0800 Subject: [PATCH] Fix warnings when building xed 2.0.1 (#264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove unused variables Fixes the following warnings when building xed: ../plugins/filebrowser/xed-file-browser-plugin.c: In function ‘xed_file_browser_plugin_activate’: ../plugins/filebrowser/xed-file-browser-plugin.c:532:22: warning: unused variable ‘schema’ [-Wunused-variable] GSettingsSchema *schema; ^~~~~~ ../plugins/filebrowser/xed-file-browser-plugin.c:531:28: warning: unused variable ‘schema_source’ [-Wunused-variable] GSettingsSchemaSource *schema_source; ^~~~~~~~~~~~~ * Remove an unused variable Fixes the following warning when building xed: ../plugins/sort/xed-sort-plugin.c: In function ‘buffer_sort_lines’: ../plugins/sort/xed-sort-plugin.c:168:12: warning: variable ‘last_line’ set but not used [-Wunused-but-set-variable] gchar *last_line = NULL; ^~~~~~~~~ * Remove an unused variable Fixes the following warning when building xed: ../plugins/wordcompletion/xed-wordcompletion-plugin.c: In function ‘xed_wordcompletion_view_deactivate’: ../plugins/wordcompletion/xed-wordcompletion-plugin.c:306:34: warning: unused variable ‘provider’ [-Wunused-variable] GtkSourceCompletionProvider *provider; ^~~~~~~~ * Remove an unused variable Fixes the following warning when building xed: ../plugins/spell/xed-spell-plugin.c: In function ‘update_ui’: ../plugins/spell/xed-spell-plugin.c:495:24: warning: unused variable ‘buffer’ [-Wunused-variable] GtkTextBuffer *buffer; ^~~~~~ --- plugins/filebrowser/xed-file-browser-plugin.c | 2 -- plugins/sort/xed-sort-plugin.c | 3 --- plugins/spell/xed-spell-plugin.c | 1 - plugins/wordcompletion/xed-wordcompletion-plugin.c | 1 - 4 files changed, 7 deletions(-) diff --git a/plugins/filebrowser/xed-file-browser-plugin.c b/plugins/filebrowser/xed-file-browser-plugin.c index be70b45..b15bb02 100644 --- a/plugins/filebrowser/xed-file-browser-plugin.c +++ b/plugins/filebrowser/xed-file-browser-plugin.c @@ -528,8 +528,6 @@ xed_file_browser_plugin_activate (XedWindowActivatable *activatable) XedPanel *panel; XedFileBrowserStore *store; gchar *data_dir; - GSettingsSchemaSource *schema_source; - GSettingsSchema *schema; priv = plugin->priv; diff --git a/plugins/sort/xed-sort-plugin.c b/plugins/sort/xed-sort-plugin.c index aec8c6a..62ddb6e 100644 --- a/plugins/sort/xed-sort-plugin.c +++ b/plugins/sort/xed-sort-plugin.c @@ -165,7 +165,6 @@ buffer_sort_lines (GtkSourceBuffer *buffer, gint end_line; gint num_lines; SortLine *lines; - gchar *last_line = NULL; gint i; g_return_if_fail (GTK_SOURCE_IS_BUFFER (buffer)); @@ -226,8 +225,6 @@ buffer_sort_lines (GtkSourceBuffer *buffer, { gtk_text_buffer_insert (text_buffer, start, lines[i].line, -1); gtk_text_buffer_insert (text_buffer, start, "\n", -1); - - last_line = lines[i].line; } gtk_text_buffer_end_user_action (text_buffer); diff --git a/plugins/spell/xed-spell-plugin.c b/plugins/spell/xed-spell-plugin.c index e0340c9..7015537 100644 --- a/plugins/spell/xed-spell-plugin.c +++ b/plugins/spell/xed-spell-plugin.c @@ -492,7 +492,6 @@ update_ui (XedSpellPlugin *plugin) if (view != NULL) { XedTab *tab; - GtkTextBuffer *buffer; tab = xed_window_get_active_tab (priv->window); g_return_if_fail (xed_tab_get_view (tab) == view); diff --git a/plugins/wordcompletion/xed-wordcompletion-plugin.c b/plugins/wordcompletion/xed-wordcompletion-plugin.c index 3a49c1d..613016a 100644 --- a/plugins/wordcompletion/xed-wordcompletion-plugin.c +++ b/plugins/wordcompletion/xed-wordcompletion-plugin.c @@ -303,7 +303,6 @@ xed_wordcompletion_view_deactivate (XedViewActivatable *activatable) { XedWordCompletionPluginPrivate *priv; GtkSourceCompletion *completion; - GtkSourceCompletionProvider *provider; GtkTextBuffer *buf; xed_debug (DEBUG_PLUGINS);