fix gcc/clang warning and unnecessary implicit type conversion to different size/signedness (#187)

* fixed gcc/clang warnings regarding implicit numeric to enum type conversion

* fixed unnecessary implicit type casts regarding size and signedness

Co-authored-by: Toni Uhlig <Toni.Uhlig@rohde-schwarz.com>
master
Toni Uhlig 5 years ago committed by GitHub
parent 7b6858a585
commit a91022a07d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,13 +8,13 @@ static int vtokeq(const char *s, jsmntok_t *t, unsigned long numtok,
if (numtok > 0) { if (numtok > 0) {
unsigned long i; unsigned long i;
int start, end, size; int start, end, size;
int type; jsmntype_t type;
char *value; char *value;
size = -1; size = -1;
value = NULL; value = NULL;
for (i = 0; i < numtok; i++) { for (i = 0; i < numtok; i++) {
type = va_arg(ap, int); type = va_arg(ap, jsmntype_t);
if (type == JSMN_STRING) { if (type == JSMN_STRING) {
value = va_arg(ap, char *); value = va_arg(ap, char *);
size = va_arg(ap, int); size = va_arg(ap, int);
@ -61,7 +61,7 @@ static int vtokeq(const char *s, jsmntok_t *t, unsigned long numtok,
return 1; return 1;
} }
static int tokeq(const char *s, jsmntok_t *tokens, int numtok, ...) { static int tokeq(const char *s, jsmntok_t *tokens, unsigned long numtok, ...) {
int ok; int ok;
va_list args; va_list args;
va_start(args, numtok); va_start(args, numtok);
@ -70,7 +70,7 @@ static int tokeq(const char *s, jsmntok_t *tokens, int numtok, ...) {
return ok; return ok;
} }
static int parse(const char *s, int status, int numtok, ...) { static int parse(const char *s, int status, unsigned long numtok, ...) {
int r; int r;
int ok = 1; int ok = 1;
va_list args; va_list args;

Loading…
Cancel
Save