From 5ccda2f8f48df0370c894d64b5dc51db653b88d8 Mon Sep 17 00:00:00 2001 From: Josep Torra Date: Mon, 25 Apr 2011 11:10:47 +0200 Subject: [PATCH] Small cosmetic cleanups Make sure the return values from g_return_* are of the right type. --- gst/gstformat.c | 6 +++--- gst/gstparse.c | 5 +++-- gst/gstquery.c | 6 +++--- gst/gsttagsetter.c | 2 +- gst/gstutils.c | 2 +- libs/gst/base/gstbaseparse.c | 6 +++--- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/gst/gstformat.c b/gst/gstformat.c index 263fa1d..6652de1 100644 --- a/gst/gstformat.c +++ b/gst/gstformat.c @@ -144,8 +144,8 @@ gst_format_register (const gchar * nick, const gchar * description) GstFormatDefinition *format; GstFormat query; - g_return_val_if_fail (nick != NULL, 0); - g_return_val_if_fail (description != NULL, 0); + g_return_val_if_fail (nick != NULL, GST_FORMAT_UNDEFINED); + g_return_val_if_fail (description != NULL, GST_FORMAT_UNDEFINED); query = gst_format_get_by_nick (nick); if (query != GST_FORMAT_UNDEFINED) @@ -182,7 +182,7 @@ gst_format_get_by_nick (const gchar * nick) { GstFormatDefinition *format; - g_return_val_if_fail (nick != NULL, 0); + g_return_val_if_fail (nick != NULL, GST_FORMAT_UNDEFINED); g_static_mutex_lock (&mutex); format = g_hash_table_lookup (_nick_to_format, nick); diff --git a/gst/gstparse.c b/gst/gstparse.c index 80a169e..839d08e 100644 --- a/gst/gstparse.c +++ b/gst/gstparse.c @@ -223,7 +223,7 @@ _gst_parse_escape (const gchar * str) GstElement * gst_parse_launchv (const gchar ** argv, GError ** error) { - return gst_parse_launchv_full (argv, NULL, 0, error); + return gst_parse_launchv_full (argv, NULL, GST_PARSE_FLAG_NONE, error); } /** @@ -299,7 +299,8 @@ gst_parse_launchv_full (const gchar ** argv, GstParseContext * context, GstElement * gst_parse_launch (const gchar * pipeline_description, GError ** error) { - return gst_parse_launch_full (pipeline_description, NULL, 0, error); + return gst_parse_launch_full (pipeline_description, NULL, GST_PARSE_FLAG_NONE, + error); } /** diff --git a/gst/gstquery.c b/gst/gstquery.c index 7ab0c9c..a50ec57 100644 --- a/gst/gstquery.c +++ b/gst/gstquery.c @@ -189,8 +189,8 @@ gst_query_type_register (const gchar * nick, const gchar * description) GstQueryTypeDefinition *query; GstQueryType lookup; - g_return_val_if_fail (nick != NULL, 0); - g_return_val_if_fail (description != NULL, 0); + g_return_val_if_fail (nick != NULL, GST_QUERY_NONE); + g_return_val_if_fail (description != NULL, GST_QUERY_NONE); lookup = gst_query_type_get_by_nick (nick); if (lookup != GST_QUERY_NONE) @@ -227,7 +227,7 @@ gst_query_type_get_by_nick (const gchar * nick) { GstQueryTypeDefinition *query; - g_return_val_if_fail (nick != NULL, 0); + g_return_val_if_fail (nick != NULL, GST_QUERY_NONE); g_static_mutex_lock (&mutex); query = g_hash_table_lookup (_nick_to_query, nick); diff --git a/gst/gsttagsetter.c b/gst/gsttagsetter.c index 5a5f967..5048a63 100644 --- a/gst/gsttagsetter.c +++ b/gst/gsttagsetter.c @@ -412,7 +412,7 @@ gst_tag_setter_get_tag_merge_mode (GstTagSetter * setter) GstTagMergeMode mode; GstTagData *data; - g_return_val_if_fail (GST_IS_TAG_SETTER (setter), FALSE); + g_return_val_if_fail (GST_IS_TAG_SETTER (setter), GST_TAG_MERGE_UNDEFINED); data = gst_tag_setter_get_data (setter); diff --git a/gst/gstutils.c b/gst/gstutils.c index 075bb3f..55b61ae 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -3649,7 +3649,7 @@ gst_parse_bin_from_description (const gchar * bin_description, gboolean ghost_unlinked_pads, GError ** err) { return gst_parse_bin_from_description_full (bin_description, - ghost_unlinked_pads, NULL, 0, err); + ghost_unlinked_pads, NULL, GST_PARSE_FLAG_NONE, err); } /** diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 01b1f40..524957f 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -3189,9 +3189,9 @@ gst_base_parse_find_frame (GstBaseParse * parse, gint64 * pos, GstBuffer *buf = NULL; GstBaseParseFrame frame; - g_return_val_if_fail (GST_FLOW_ERROR, pos != NULL); - g_return_val_if_fail (GST_FLOW_ERROR, time != NULL); - g_return_val_if_fail (GST_FLOW_ERROR, duration != NULL); + g_return_val_if_fail (pos != NULL, GST_FLOW_ERROR); + g_return_val_if_fail (time != NULL, GST_FLOW_ERROR); + g_return_val_if_fail (duration != NULL, GST_FLOW_ERROR); klass = GST_BASE_PARSE_GET_CLASS (parse); -- 2.7.4