Skip to contentSkip to conversation

src: cleanup in mxml and jansson regarding set_id parsing

PATCH In review Arturo Borrero Gonzalez 2 participants 2 messages Oct 10, 2014 – Oct 11, 2014 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 src: cleanup in mxml and jansson regarding set_id parsing

jansson.c: In function 'nft_jansson_expr_parse':
jansson.c:212:6: warning: pointer targets in passing argument 3 of 'nft_set_lookup_id' differ in signedness [-Wpointer-sign] In file included from jansson.c:10:0:
./internal.h:95:5: note: expected 'uint32_t *' but argument is of type 'int *'
jansson.c:195:18: warning: unused variable 'set_cur' [-Wunused-variable]
mxml.c: In function 'nft_mxml_expr_parse':
mxml.c:97:6: warning: pointer targets in passing argument 3 of 'nft_set_lookup_id' differ in signedness [-Wpointer-sign] In file included from mxml.c:12:0:
internal.h:95:5: note: expected 'uint32_t *' but argument is of type 'int *'
mxml.c:68:18: warning: unused variable 'set_cur' [-Wunused-variable]

Spotted with: gcc (Debian 4.7.2-5) 4.7.2

---
 src/jansson.c |    4 ++--
 src/mxml.c    |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
src/jansson.c +2 -2
index 728de12..4c7968a 100644
@@ -192,8 +192,8 @@ struct nft_rule_expr *nft_jansson_expr_parse(json_t *root,
 {
 	struct nft_rule_expr *e;
 	const char *type;
-	struct nft_set *set_cur = NULL;
-	int ret, set_id;
+	uint32_t set_id;
+	int ret;
 
 	type = nft_jansson_parse_str(root, "type", err);
 	if (type == NULL)
src/mxml.c +2 -2
index 22d482f..a97d380 100644
@@ -65,8 +65,8 @@ struct nft_rule_expr *nft_mxml_expr_parse(mxml_node_t *node,
 	struct nft_rule_expr *e;
 	const char *expr_name;
 	char *xml_text;
-	struct nft_set *set_cur = NULL;
-	int ret, set_id;
+	uint32_t set_id;
+	int ret;
 
 	expr_name = mxmlElementGetAttr(node, "type");
 	if (expr_name == NULL) {
#1 lore raw
Quoted 10 lines · Arturo Borrero Gonzalez

jansson.c: In function 'nft_jansson_expr_parse':
jansson.c:212:6: warning: pointer targets in passing argument 3 of 'nft_set_lookup_id' differ in signedness [-Wpointer-sign] In file included from jansson.c:10:0:
./internal.h:95:5: note: expected 'uint32_t *' but argument is of type 'int *'
jansson.c:195:18: warning: unused variable 'set_cur' [-Wunused-variable]
mxml.c: In function 'nft_mxml_expr_parse':
mxml.c:97:6: warning: pointer targets in passing argument 3 of 'nft_set_lookup_id' differ in signedness [-Wpointer-sign] In file included from mxml.c:12:0:
internal.h:95:5: note: expected 'uint32_t *' but argument is of type 'int *'
mxml.c:68:18: warning: unused variable 'set_cur' [-Wunused-variable]

Oops, thanks Arturo.