summaryrefslogtreecommitdiff
path: root/gst/parse/grammar.y
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-04-07 12:24:14 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-04-07 19:09:23 +0100
commita26879b7a0d170f38d76973f15f3518b00ef6c32 (patch)
tree54ee2c1711f0ddece33a0f6fa60203320de08b24 /gst/parse/grammar.y
parent05d663a7022142c3e3968d7fa1de8de9427a3ded (diff)
downloadgstreamer-a26879b7a0d170f38d76973f15f3518b00ef6c32.tar.gz
parse: fix compiler warning
Fix 'grammar.y:668: passing argument 1 of ‘g_free’ discards qualifiers from pointer target type' compiler warning.
Diffstat (limited to 'gst/parse/grammar.y')
-rw-r--r--gst/parse/grammar.y19
1 files changed, 12 insertions, 7 deletions
diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y
index 5bcb1e2a77..cd900cf880 100644
--- a/gst/parse/grammar.y
+++ b/gst/parse/grammar.y
@@ -207,7 +207,13 @@ YYPRINTF(const char *format, ...)
g_list_append ((graph)->ctx->missing_elements, g_strdup (name)); \
} } G_STMT_END
-#define GST_BIN_MAKE(res, type, chainval, assign, free_string) \
+static void
+no_free (gconstpointer foo)
+{
+ /* do nothing */
+}
+
+#define GST_BIN_MAKE(res, type, chainval, assign, type_string_free_func) \
G_STMT_START { \
chain_t *chain = chainval; \
GSList *walk; \
@@ -218,8 +224,7 @@ G_STMT_START { \
g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
g_slist_free (assign); \
gst_object_unref (bin); \
- if (free_string) \
- gst_parse_strfree (type); /* Need to clean up the string */ \
+ type_string_free_func (type); /* Need to clean up the string */ \
YYERROR; \
} else if (!bin) { \
ADD_MISSING_ELEMENT(graph, type); \
@@ -665,14 +670,14 @@ element: IDENTIFIER { $$ = gst_element_factory_make ($1, NULL);
assignments: /* NOP */ { $$ = NULL; }
| assignments ASSIGNMENT { $$ = g_slist_prepend ($1, $2); }
;
-bin: '(' assignments chain ')' { GST_BIN_MAKE ($$, "bin", $3, $2, FALSE); }
- | BINREF assignments chain ')' { GST_BIN_MAKE ($$, $1, $3, $2, TRUE);
+bin: '(' assignments chain ')' { GST_BIN_MAKE ($$, "bin", $3, $2, no_free); }
+ | BINREF assignments chain ')' { GST_BIN_MAKE ($$, $1, $3, $2, gst_parse_strfree);
gst_parse_strfree ($1);
}
- | BINREF assignments ')' { GST_BIN_MAKE ($$, $1, NULL, $2, TRUE);
+ | BINREF assignments ')' { GST_BIN_MAKE ($$, $1, NULL, $2, gst_parse_strfree);
gst_parse_strfree ($1);
}
- | BINREF assignments error ')' { GST_BIN_MAKE ($$, $1, NULL, $2, TRUE);
+ | BINREF assignments error ')' { GST_BIN_MAKE ($$, $1, NULL, $2, gst_parse_strfree);
gst_parse_strfree ($1);
}
;