diff --git a/src/cheatman.c b/src/cheatman.c index e992713ef..26858865a 100644 --- a/src/cheatman.c +++ b/src/cheatman.c @@ -75,7 +75,7 @@ static code_t make_code(const char *s) int i = 0; while (*s) { - if (isxdigit(*s)) + if (isxdigit((int)*s)) digits[i++] = *s; s++; } @@ -99,10 +99,10 @@ static int is_cheat_code(const char *s) int i = 0; while (*s) { - if (isxdigit(*s)) { + if (isxdigit((int)*s)) { if (++i > CODE_DIGITS) return 0; - } else if (!isspace(*s)) { + } else if (!isspace((int)*s)) { return 0; } s++; @@ -178,7 +178,7 @@ static int is_empty_str(const char *s) size_t slen = strlen(s); while (slen--) { - if (isgraph(*s++)) + if (isgraph((int)*s++)) return 0; } @@ -200,13 +200,13 @@ static int trim_str(char *s) return -1; /* Get first non-space char */ - while (isspace(*t++)) + while (isspace((int)*t++)) first++; /* Get last non-space char */ last = strlen(s) - 1; t = &s[last]; - while (isspace(*t--)) + while (isspace((int)*t--)) last--; /* Kill leading/trailing spaces */ @@ -224,7 +224,7 @@ static int trim_str(char *s) static int is_empty_substr(const char *s, size_t count) { while (count--) { - if (isgraph(*s++)) + if (isgraph((int)*s++)) return 0; } diff --git a/src/opl.c b/src/opl.c index 2074a2e5a..61de8d714 100644 --- a/src/opl.c +++ b/src/opl.c @@ -401,7 +401,7 @@ int oplPath2Mode(const char *path) if (blkdevnameend != NULL) { blkdevnamelen = (int)(blkdevnameend - appsPath); - while ((blkdevnamelen > 0) && isdigit(appsPath[blkdevnamelen - 1])) + while ((blkdevnamelen > 0) && isdigit((int)appsPath[blkdevnamelen - 1])) blkdevnamelen--; //Ignore the unit number. if (strncmp(path, appsPath, blkdevnamelen) == 0) diff --git a/src/ps2cnf.c b/src/ps2cnf.c index 6beb72f22..bb2f97994 100644 --- a/src/ps2cnf.c +++ b/src/ps2cnf.c @@ -15,7 +15,7 @@ static const char *CNFGetToken(const char *cnf, const char *key) { - for (; isspace(*cnf); cnf++) { + for (; isspace((int)*cnf); cnf++) { } for (; *key != '\0'; key++, cnf++) { @@ -45,7 +45,7 @@ static const char *CNFGetKey(const char *line, char *key) int i; //Skip leading whitespace - for (; isspace(*line); line++) { + for (; isspace((int)*line); line++) { } if (*line == '\0') { //Unexpected end of file @@ -53,11 +53,11 @@ static const char *CNFGetKey(const char *line, char *key) } for (i = 0; i < CNF_PATH_LEN_MAX && *line != '\0'; i++) { - if (isgraph(*line)) { + if (isgraph((int)*line)) { *key = *line; line++; key++; - } else if (isspace(*line)) { + } else if (isspace((int)*line)) { *key = '\0'; break; } else if (*line == '\0') { //Unexpected end of file. This check exists, along with the other similar check above.