Skip to content

Commit

Permalink
Ported to NetBSD (2/2): Add casts for character class detection
Browse files Browse the repository at this point in the history
NetBSD's character class test macros are defined such that they produce
a compiler warning when given a char argument. Adding a cast to the call
fixes this.
  • Loading branch information
TQ Hirsch committed Apr 13, 2014
1 parent 426a3f8 commit 849178d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cfgrammar.c
Expand Up @@ -648,7 +648,7 @@ void h_pprint_char(FILE *f, char c)
case '\n': fputs("\\n", f); break;
case '\r': fputs("\\r", f); break;
default:
if(isprint(c)) {
if(isprint((int)c)) {
fputc(c, f);
} else {
fprintf(f, "\\x%.2X", c);
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/whitespace.c
Expand Up @@ -10,7 +10,7 @@ static HParseResult* parse_whitespace(void* env, HParseState *state) {
c = h_read_bits(&state->input_stream, 8, false);
if (state->input_stream.overrun)
break;
} while (isspace(c));
} while (isspace((int)c));
state->input_stream = bak;
return h_do_parse((HParser*)env, state);
}
Expand Down

0 comments on commit 849178d

Please sign in to comment.