[gnome-commander] src/gnome-cmd-xml-config.cc: fix for -Wmisleading-indentation



commit 3e5eee6a32a5d863d355436dec4363c899e14fa0
Author: Mamoru TASAKA <mtasaka fedoraproject org>
Date:   Tue Apr 25 13:02:43 2017 +0900

    src/gnome-cmd-xml-config.cc: fix for -Wmisleading-indentation
    
    -Wmisleading-indentation is from GCC 6.
    ```
    src/gnome-cmd-xml-config.cc:623:13: error: this 'if' clause does not guard... 
[-Werror=misleading-indentation]
                 if (g_markup_collect_attributes (element_name, attribute_names, attribute_values, error,
                 ^~
    src/gnome-cmd-xml-config.cc:628:17: note: ...this statement, but the latter is misleadingly indented as 
if it were guarded by the 'if'
                     xml_search_profile.content_search = param5;
    ```
    
    Here the original code:
            case XML_GNOMECOMMANDER_SELECTIONS_PROFILE_TEXT:
                if (g_markup_collect_attributes (element_name, attribute_names, attribute_values, error,
                                                 G_MARKUP_COLLECT_BOOLEAN, "match-case", &param4,
                                                 G_MARKUP_COLLECT_BOOLEAN | G_MARKUP_COLLECT_OPTIONAL, 
"content-search", &param5,
                                                 G_MARKUP_COLLECT_INVALID))
                    xml_search_profile.match_case = param4;
                    xml_search_profile.content_search = param5;
                break;
    
    is interpretted as:
            case XML_GNOMECOMMANDER_SELECTIONS_PROFILE_TEXT:
                if (g_markup_collect_attributes (element_name, attribute_names, attribute_values, error,
                                                 G_MARKUP_COLLECT_BOOLEAN, "match-case", &param4,
                                                 G_MARKUP_COLLECT_BOOLEAN | G_MARKUP_COLLECT_OPTIONAL, 
"content-search", &param5,
                                                 G_MARKUP_COLLECT_INVALID))
                {
                    xml_search_profile.match_case = param4;
                }
                    xml_search_profile.content_search = param5;
                break;
    
    but I don't believe this is the actual intention.

 src/gnome-cmd-xml-config.cc |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-cmd-xml-config.cc b/src/gnome-cmd-xml-config.cc
index fdff1d4..c25fc53 100644
--- a/src/gnome-cmd-xml-config.cc
+++ b/src/gnome-cmd-xml-config.cc
@@ -624,8 +624,10 @@ static void xml_start(GMarkupParseContext *context,
                                              G_MARKUP_COLLECT_BOOLEAN, "match-case", &param4,
                                              G_MARKUP_COLLECT_BOOLEAN | G_MARKUP_COLLECT_OPTIONAL, 
"content-search", &param5,
                                              G_MARKUP_COLLECT_INVALID))
+            {
                 xml_search_profile.match_case = param4;
                 xml_search_profile.content_search = param5;
+            }
             break;
 
         case XML_GNOMECOMMANDER_KEYBINDINGS_KEY:


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