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

@ -86,7 +86,7 @@ upm_result_t es08a_set_angle(es08a_context dev, int32_t angle){
upm_result_t es08a_calc_pulse_travelling(const es08a_context dev,
int32_t* ret_val, int32_t value){
if (value > dev->max_pulse_width) {
if (value > (int)dev->max_pulse_width) {
return dev->max_pulse_width;
}

View File

@ -87,7 +87,7 @@ upm_result_t es9257_set_angle(es9257_context dev, int32_t angle){
upm_result_t es9257_calc_pulse_travelling(const es9257_context dev,
int32_t* ret_val, int32_t value){
if (value > dev->max_pulse_width) {
if (value > (int)dev->max_pulse_width) {
return dev->max_pulse_width;
}