Verified Commit 575ec017 authored by Camil Staps's avatar Camil Staps 🚀

Fix GCC warnings when comparing a char to EOF

parent 236f6570
Pipeline #43199 passed with stages
in 22 minutes and 13 seconds
...@@ -278,7 +278,7 @@ static int parse_integer (int64_t *integer_p) ...@@ -278,7 +278,7 @@ static int parse_integer (int64_t *integer_p)
static int parse_string_character (char *c_p) static int parse_string_character (char *c_p)
{ {
if (last_char!='\\'){ if (last_char!='\\'){
if (last_char==EOF) if (last_char=='\0')
return 0; return 0;
*c_p=last_char; *c_p=last_char;
last_char=next_character(); last_char=next_character();
...@@ -308,7 +308,7 @@ static int parse_string_character (char *c_p) ...@@ -308,7 +308,7 @@ static int parse_string_character (char *c_p)
case 'r': *c_p='\r'; break; case 'r': *c_p='\r'; break;
#endif #endif
case 't': *c_p='\t'; break; case 't': *c_p='\t'; break;
case EOF: return 0; case '\0': return 0;
default: *c_p=last_char; default: *c_p=last_char;
} }
last_char=next_character(); last_char=next_character();
...@@ -365,7 +365,7 @@ static int parse_descriptor_string (char *string,int *string_length_p) ...@@ -365,7 +365,7 @@ static int parse_descriptor_string (char *string,int *string_length_p)
while (last_char!='"'){ while (last_char!='"'){
char c; char c;
if (last_char==EOF) if (last_char=='\0')
abc_parser_error_i ("Error in string at line %d\n",line_number); abc_parser_error_i ("Error in string at line %d\n",line_number);
c=last_char; c=last_char;
......
...@@ -159,7 +159,7 @@ instr_endF t = foldl (flip append) t ...@@ -159,7 +159,7 @@ instr_endF t = foldl (flip append) t
, "\tIO_error(\"FEnd: not allowed for StdIO and StdErr\");" , "\tIO_error(\"FEnd: not allowed for StdIO and StdErr\");"
, "else" , "else"
, "\th=f->file_handle;" , "\th=f->file_handle;"
, "char c=getc(h);" , "int c=getc(h);"
, "if (c==EOF) {" , "if (c==EOF) {"
, "\t*--bsp=1;" , "\t*--bsp=1;"
, "} else {" , "} else {"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment