summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-02-06 11:32:37 +0100
committerraveit65 <[email protected]>2021-03-04 11:49:41 +0100
commit7a329dd77653eca80f62e819dc1ce3a3b380fca8 (patch)
treea051e0dd8e64fa24f24a86d37917799c883062f4
parent8cacf7c2a4741e61468bbcac439e85c5d7779442 (diff)
downloadpluma-7a329dd77653eca80f62e819dc1ce3a3b380fca8.tar.bz2
pluma-7a329dd77653eca80f62e819dc1ce3a3b380fca8.tar.xz
cppcheck warning: Local variable shadows outer variable
-rw-r--r--pluma/pluma-file-chooser-dialog.c16
-rw-r--r--pluma/pluma-tab.c3
2 files changed, 10 insertions, 9 deletions
diff --git a/pluma/pluma-file-chooser-dialog.c b/pluma/pluma-file-chooser-dialog.c
index 290821d4..822c14d0 100644
--- a/pluma/pluma-file-chooser-dialog.c
+++ b/pluma/pluma-file-chooser-dialog.c
@@ -300,7 +300,7 @@ all_text_files_filter (const GtkFileFilterInfo *filter_info,
while ((languages != NULL) && (*languages != NULL))
{
- gchar **mime_types;
+ gchar **mime_types_srtv;
gint i;
GtkSourceLanguage *lang;
@@ -308,24 +308,24 @@ all_text_files_filter (const GtkFileFilterInfo *filter_info,
g_return_val_if_fail (GTK_SOURCE_IS_LANGUAGE (lang), FALSE);
++languages;
- mime_types = gtk_source_language_get_mime_types (lang);
- if (mime_types == NULL)
+ mime_types_srtv = gtk_source_language_get_mime_types (lang);
+ if (mime_types_srtv == NULL)
continue;
- for (i = 0; mime_types[i] != NULL; i++)
+ for (i = 0; mime_types_srtv[i] != NULL; i++)
{
- if (!g_content_type_is_a (mime_types[i], "text/plain"))
+ if (!g_content_type_is_a (mime_types_srtv[i], "text/plain"))
{
pluma_debug_message (DEBUG_COMMANDS,
"Mime-type %s is not related to text/plain",
- mime_types[i]);
+ mime_types_srtv[i]);
known_mime_types = g_slist_prepend (known_mime_types,
- g_strdup (mime_types[i]));
+ g_strdup (mime_types_srtv[i]));
}
}
- g_strfreev (mime_types);
+ g_strfreev (mime_types_srtv);
}
/* known_mime_types always has "text/plain" as first item" */
diff --git a/pluma/pluma-tab.c b/pluma/pluma-tab.c
index 2b096568..35517396 100644
--- a/pluma/pluma-tab.c
+++ b/pluma/pluma-tab.c
@@ -897,7 +897,6 @@ document_loaded (PlumaDocument *document,
const GError *error,
PlumaTab *tab)
{
- GtkWidget *emsg;
GFile *location;
gchar *uri;
@@ -921,6 +920,8 @@ document_loaded (PlumaDocument *document,
if (error != NULL &&
(error->domain != PLUMA_DOCUMENT_ERROR || error->code != PLUMA_DOCUMENT_ERROR_CONVERSION_FALLBACK))
{
+ GtkWidget *emsg;
+
if (tab->priv->state == PLUMA_TAB_STATE_LOADING)
pluma_tab_set_state (tab, PLUMA_TAB_STATE_LOADING_ERROR);
else