Add compiler flag -Wsign-compare

Also, fix the warnings generated by this flag.

Conflicts:
	examples/aom_cx_set_ref.c

Change-Id: I0451e119c52000aa7c1c55027d53f1da5a02a11f
This commit is contained in:
Urvang Joshi
2016-07-08 16:09:36 -07:00
committed by Yaowu Xu
parent 97aa09f658
commit d3a7576fbc
3 changed files with 13 additions and 7 deletions

9
args.c
View File

@@ -9,6 +9,7 @@
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
@@ -119,13 +120,13 @@ void arg_show_usage(FILE *fp, const struct arg_def *const *defs) {
}
unsigned int arg_parse_uint(const struct arg *arg) {
long int rawval;
uint32_t rawval;
char *endptr;
rawval = strtol(arg->val, &endptr, 10);
rawval = strtoul(arg->val, &endptr, 10);
if (arg->val[0] != '\0' && endptr[0] == '\0') {
if (rawval >= 0 && rawval <= UINT_MAX) return rawval;
if (rawval <= UINT_MAX) return rawval;
die("Option %s: Value %ld out of range for unsigned int\n", arg->name,
rawval);
@@ -136,7 +137,7 @@ unsigned int arg_parse_uint(const struct arg *arg) {
}
int arg_parse_int(const struct arg *arg) {
long int rawval;
int32_t rawval;
char *endptr;
rawval = strtol(arg->val, &endptr, 10);