parse: fix compiler warning

Fix 'grammar.y:668: passing argument 1 of ‘g_free’ discards qualifiers
from pointer target type' compiler warning.
This commit is contained in:
Tim-Philipp Müller 2010-04-07 12:24:14 +01:00
parent 05d663a702
commit a26879b7a0

View file

@ -207,7 +207,13 @@ YYPRINTF(const char *format, ...)
g_list_append ((graph)->ctx->missing_elements, g_strdup (name)); \ g_list_append ((graph)->ctx->missing_elements, g_strdup (name)); \
} } G_STMT_END } } 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 { \ G_STMT_START { \
chain_t *chain = chainval; \ chain_t *chain = chainval; \
GSList *walk; \ GSList *walk; \
@ -218,8 +224,7 @@ G_STMT_START { \
g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \ g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
g_slist_free (assign); \ g_slist_free (assign); \
gst_object_unref (bin); \ gst_object_unref (bin); \
if (free_string) \ type_string_free_func (type); /* Need to clean up the string */ \
gst_parse_strfree (type); /* Need to clean up the string */ \
YYERROR; \ YYERROR; \
} else if (!bin) { \ } else if (!bin) { \
ADD_MISSING_ELEMENT(graph, type); \ ADD_MISSING_ELEMENT(graph, type); \
@ -665,14 +670,14 @@ element: IDENTIFIER { $$ = gst_element_factory_make ($1, NULL);
assignments: /* NOP */ { $$ = NULL; } assignments: /* NOP */ { $$ = NULL; }
| assignments ASSIGNMENT { $$ = g_slist_prepend ($1, $2); } | assignments ASSIGNMENT { $$ = g_slist_prepend ($1, $2); }
; ;
bin: '(' assignments chain ')' { GST_BIN_MAKE ($$, "bin", $3, $2, FALSE); } bin: '(' assignments chain ')' { GST_BIN_MAKE ($$, "bin", $3, $2, no_free); }
| BINREF assignments chain ')' { GST_BIN_MAKE ($$, $1, $3, $2, TRUE); | BINREF assignments chain ')' { GST_BIN_MAKE ($$, $1, $3, $2, gst_parse_strfree);
gst_parse_strfree ($1); 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); 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); gst_parse_strfree ($1);
} }
; ;