Private
Public Access
2
0

mraa.c: fix unsigned int comparison by usign UINT_MAX instead of -1

This works since both are essentially 'impossible' values.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-06-29 10:02:46 +01:00
parent de0543923c
commit fe9264c98f

View File

@@ -294,7 +294,8 @@ mraa_setup_mux_mapped(mraa_pin_t meta)
unsigned int mi;
mraa_result_t ret;
mraa_gpio_context mux_i = NULL;
int last_pin = -1;
// avoids the unsigned comparison and we should never have a pin that is UINT_MAX!
unsigned int last_pin = UINT_MAX;
for (mi = 0; mi < meta.mux_total; mi++) {