From bcdeaa639b88bafd2d260ec262a2a38a19dfbeb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 26 Dec 2007 16:03:57 +0000 Subject: [PATCH] Fix 'xyz may be used uninitialized' compiler warnings caused by broken g_assert_not_reached() macro in GLib-2.15.x (i... Original commit message from CVS: * gst/avi/gstavidemux.c: (gst_avi_demux_loop): * gst/wavparse/gstwavparse.c: (gst_wavparse_chain): * sys/ximage/gstximagesrc.c: (composite_pixel): Fix 'xyz may be used uninitialized' compiler warnings caused by broken g_assert_not_reached() macro in GLib-2.15.x (it's not really nice to abort in any case). Fixes #505745. --- ChangeLog | 9 +++++++++ gst/avi/gstavidemux.c | 4 +++- gst/wavparse/gstwavparse.c | 2 +- sys/ximage/gstximagesrc.c | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16d231cfad..6d967b04a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-12-26 Tim-Philipp Müller + + * gst/avi/gstavidemux.c: (gst_avi_demux_loop): + * gst/wavparse/gstwavparse.c: (gst_wavparse_chain): + * sys/ximage/gstximagesrc.c: (composite_pixel): + Fix 'xyz may be used uninitialized' compiler warnings caused + by broken g_assert_not_reached() macro in GLib-2.15.x (it's + not really nice to abort in any case). Fixes #505745. + 2007-12-18 Tim-Philipp Müller * tests/check/elements/avisubtitle.c: (check_correct_buffer): diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index e6eb49ee11..628e21da5e 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -3734,7 +3734,9 @@ gst_avi_demux_loop (GstPad * pad) } break; default: - g_assert_not_reached (); + GST_ERROR_OBJECT (avi, "unknown state %d", avi->state); + res = GST_FLOW_ERROR; + goto pause; } GST_LOG_OBJECT (avi, "state: %d res:%s", avi->state, gst_flow_get_name (res)); diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 40ad3219a7..c9e3a52a02 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -1821,7 +1821,7 @@ gst_wavparse_chain (GstPad * pad, GstBuffer * buf) goto done; break; default: - g_assert_not_reached (); + g_return_val_if_reached (GST_FLOW_ERROR); } done: return ret; diff --git a/sys/ximage/gstximagesrc.c b/sys/ximage/gstximagesrc.c index 115d271b2e..c5ed9c26a3 100644 --- a/sys/ximage/gstximagesrc.c +++ b/sys/ximage/gstximagesrc.c @@ -280,7 +280,7 @@ composite_pixel (GstXContext * xcontext, guchar * dest, guchar * src) break; default: /* Should not reach here */ - g_assert_not_reached (); + g_return_if_reached (); } /* possible optimisation: