C: Fixes for sign compares in C libraries

Added explicit error for sign compares to CMake.  Updated a handful of C
source which compared unsigned vs signed.

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck
2018-02-07 12:17:54 -08:00
parent 460fdc2eb5
commit fe7bd75c91
14 changed files with 21 additions and 24 deletions

View File

@ -347,14 +347,14 @@ RN2903_RESPONSE_T rn2903_waitfor_response(const rn2903_context dev,
dev->resp_len++;
}
} while ( (elapsed = upm_elapsed_ms(&clock)) < wait_ms);
} while ( (int)(elapsed = upm_elapsed_ms(&clock)) < wait_ms);
if (dev->debug)
printf("\tRESP (%d): '%s'\n", (int)dev->resp_len,
(dev->resp_len) ? dev->resp_data : "");
// check for and return obvious errors
if (elapsed >= wait_ms)
if ((int)elapsed >= wait_ms)
return RN2903_RESPONSE_TIMEOUT;
else if (rn2903_find(dev, RN2903_PHRASE_INV_PARAM))
return RN2903_RESPONSE_INVALID_PARAM;