[gtk+] gtksizegroup: Add explicit braces to avoid dangling else
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtksizegroup: Add explicit braces to avoid dangling else
- Date: Tue, 7 May 2013 12:03:36 +0000 (UTC)
commit 19e6db7997106bb2485b3982fb625ed964e19b3c
Author: Kalev Lember <kalevlember gmail com>
Date: Wed Apr 3 00:35:27 2013 +0200
gtksizegroup: Add explicit braces to avoid dangling else
Otherwise the else after the for loop becomes attached to the wrong if.
gtk/gtksizegroup.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c
index e31dfa8..f84ed47 100644
--- a/gtk/gtksizegroup.c
+++ b/gtk/gtksizegroup.c
@@ -667,15 +667,22 @@ size_group_start_element (GMarkupParseContext *context,
GSListSubParserData *data = (GSListSubParserData*)user_data;
if (strcmp (element_name, "widget") == 0)
- for (i = 0; names[i]; i++)
- if (strcmp (names[i], "name") == 0)
- data->items = g_slist_prepend (data->items, g_strdup (values[i]));
+ {
+ for (i = 0; names[i]; i++)
+ {
+ if (strcmp (names[i], "name") == 0)
+ data->items = g_slist_prepend (data->items, g_strdup (values[i]));
+ }
+ }
else if (strcmp (element_name, "widgets") == 0)
- return;
+ {
+ return;
+ }
else
- g_warning ("Unsupported type tag for GtkSizeGroup: %s\n",
- element_name);
-
+ {
+ g_warning ("Unsupported type tag for GtkSizeGroup: %s\n",
+ element_name);
+ }
}
static const GMarkupParser size_group_parser =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]