From 46e401b6d940c99bf1b5b0a3ba33f7a29a6a29b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 13 Sep 2011 23:04:09 +0100 Subject: [PATCH] lfocontrolsource: fix clang compiler warning Cast enum to int before checking for negative values, which are impossible according to the enum list. gstlfocontrolsource.c:652:45: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare] if (waveform >= num_waveforms || waveform < 0) { ~~~~~~~~ ^ ~ https://bugzilla.gnome.org/show_bug.cgi?id=653137 --- libs/gst/controller/gstlfocontrolsource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/gst/controller/gstlfocontrolsource.c b/libs/gst/controller/gstlfocontrolsource.c index 46061e4..06711b2 100644 --- a/libs/gst/controller/gstlfocontrolsource.c +++ b/libs/gst/controller/gstlfocontrolsource.c @@ -566,7 +566,7 @@ static GstWaveformImplementation *waveforms[] = { &waveform_triangle }; -static guint num_waveforms = G_N_ELEMENTS (waveforms); +static const guint num_waveforms = G_N_ELEMENTS (waveforms); enum { @@ -649,7 +649,7 @@ gst_lfo_control_source_set_waveform (GstLFOControlSource * self, GstControlSource *csource = GST_CONTROL_SOURCE (self); gboolean ret = TRUE; - if (waveform >= num_waveforms || waveform < 0) { + if (waveform >= num_waveforms || (int) waveform < 0) { GST_WARNING ("waveform %d invalid or not implemented yet", waveform); return FALSE; } -- 2.7.4