diff options
author | Urvang Joshi <urvang@google.com> | 2016-07-08 16:09:36 -0700 |
---|---|---|
committer | Johann <johannkoenig@google.com> | 2016-09-27 12:39:36 -0700 |
commit | 097b31c7f0272c39016ce11ae182e8424b4ee762 (patch) | |
tree | 20d10c9dcfebb82d55eecbe8897e0165b876962e /args.c | |
parent | 0aa3e2564fd7ae2b63984b6bf993f57c4b436073 (diff) | |
download | libvpx-097b31c7f0272c39016ce11ae182e8424b4ee762.tar.gz |
Add compiler flag -Wsign-compare
Also, fix the warnings generated by this flag.
(cherry picked from commit ebeb1155d4fa6d28e2f40c92265245f8df097fcb)
From AOM. Don't actually add -Wsign-compare. It will be covered by
-Wextra.
Switch to vpx_integer.h from df9c9d6d4c43f02c58d4e776c53323788e013cbc
BUG=webm:1069
Change-Id: I1dc6e61caa5d56af4a55b6692ab620bb3144652a
Diffstat (limited to 'args.c')
-rw-r--r-- | args.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -13,6 +13,7 @@ #include <limits.h> #include "args.h" +#include "vpx/vpx_integer.h" #include "vpx_ports/msvc.h" #if defined(__GNUC__) && __GNUC__ @@ -118,13 +119,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 (unsigned int)rawval; + if (rawval <= UINT_MAX) return rawval; die("Option %s: Value %ld out of range for unsigned int\n", arg->name, rawval); @@ -135,7 +136,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); |