From b967592289d4ad45c3c19b24300127855cde8954 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Fri, 24 Sep 2021 22:14:04 +0100 Subject: [PATCH] Fix coding style --- src/common/dir.c | 3 ++- src/common/grab-file.c | 2 +- src/menu/menu.c | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/dir.c b/src/common/dir.c index 15000518..616c96da 100644 --- a/src/common/dir.c +++ b/src/common/dir.c @@ -94,7 +94,8 @@ find_dir(struct ctx *ctx) if (!prefix) { continue; } - gchar **prefixes = g_strsplit(prefix, ":", -1); + gchar **prefixes; + prefixes = g_strsplit(prefix, ":", -1); for (gchar **p = prefixes; *p; p++) { ctx->build_path_fn(ctx, *p, d.path); if (debug) { diff --git a/src/common/grab-file.c b/src/common/grab-file.c index 13f01cd5..aad0b489 100644 --- a/src/common/grab-file.c +++ b/src/common/grab-file.c @@ -30,5 +30,5 @@ grab_file(const char *filename) } free(line); fclose(stream); - return (buffer.buf); + return buffer.buf; } diff --git a/src/menu/menu.c b/src/menu/menu.c index e226a516..d6db5909 100644 --- a/src/menu/menu.c +++ b/src/menu/menu.c @@ -20,7 +20,7 @@ #include "theme.h" /* state-machine variables for processing */ -static bool in_item = false; +static bool in_item; static struct menuitem *current_item; #define MENUWIDTH (110) @@ -88,7 +88,7 @@ static void fill_item(char *nodename, char *content, struct menu *menu) static void entry(xmlNode *node, char *nodename, char *content, struct menu *menu) { - static bool in_root_menu = false; + static bool in_root_menu; if (!nodename) { return; @@ -130,8 +130,10 @@ static void xml_tree_walk(xmlNode *node, struct menu *menu); static void traverse(xmlNode *n, struct menu *menu) { + xmlAttr *attr; + process_node(n, menu); - for (xmlAttr *attr = n->properties; attr; attr = attr->next) { + for (attr = n->properties; attr; attr = attr->next) { xml_tree_walk(attr->children, menu); } xml_tree_walk(n->children, menu);