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
&waveform_triangle
};
-static guint num_waveforms = G_N_ELEMENTS (waveforms);
+static const guint num_waveforms = G_N_ELEMENTS (waveforms);
enum
{
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;
}