Make it compile on platforms where char is unsigned

Linux on powerpc seems to be one such platform.
This commit is contained in:
Petri Lehtinen 2009-10-01 21:52:12 +03:00
parent afc9c1a23a
commit 9c5a8430db
2 changed files with 3 additions and 3 deletions

View File

@ -70,7 +70,7 @@ static int dump_string(const char *str, dump_func dump, void *data)
char seq[7]; char seq[7];
int length; int length;
while(*end && *end != '\\' && *end != '"' && (*end < 0 || *end > 0x1F)) while(*end && *end != '\\' && *end != '"' && (unsigned char)*end > 0x1F)
end++; end++;
if(end != str) { if(end != str) {

View File

@ -135,7 +135,7 @@ static char stream_get(stream_t *stream, json_error_t *error)
c = stream->buffer[0]; c = stream->buffer[0];
if(c < 0 && c != EOF) if((unsigned char)c >= 0x80 && c != (char)EOF)
{ {
/* multi-byte UTF-8 sequence */ /* multi-byte UTF-8 sequence */
int i, count; int i, count;
@ -519,7 +519,7 @@ static int lex_scan(lex_t *lex, json_error_t *error)
c = lex_get(lex, error); c = lex_get(lex, error);
} }
if(c == EOF) { if(c == (char)EOF) {
if(lex_eof(lex)) if(lex_eof(lex))
lex->token = TOKEN_EOF; lex->token = TOKEN_EOF;
else else