diff --git a/main/gbc/gbc_read.c b/main/gbc/gbc_read.c index 4af15843d..6ba78853b 100644 --- a/main/gbc/gbc_read.c +++ b/main/gbc/gbc_read.c @@ -977,7 +977,7 @@ static void add_string() i = xdigit_val(get_char_offset(2)); if (i >= 0) { - car = (car << 4) | i; + car = (car << 4) | (uchar)i; *p = car; source_ptr += 2; continue; diff --git a/main/gbx/gbx_exec_loop.c b/main/gbx/gbx_exec_loop.c index 2b7bfcf20..d4cbf474d 100644 --- a/main/gbx/gbx_exec_loop.c +++ b/main/gbx/gbx_exec_loop.c @@ -717,7 +717,7 @@ _PUSH_INTEGER: _PUSH_CHAR: - STRING_char_value(SP, (char)GET_UX()); + STRING_char_value(SP, GET_UX()); SP++; goto _NEXT; diff --git a/main/gbx/gbx_subr_string.c b/main/gbx/gbx_subr_string.c index 73d61a41f..f43ce5fcc 100644 --- a/main/gbx/gbx_subr_string.c +++ b/main/gbx/gbx_subr_string.c @@ -1071,8 +1071,7 @@ __JAVASCRIPT: for (i = 0; i < lstr; i++) { c = str[i]; - //if (c >= ' ' && c <= 126 && c != '\\' && c != '"') - if (c >= ' ' && c != '\\' && c != '\'') + if (c >= ' ' && c <= 126 && c != '\\' && c != '\'') STRING_make_char(c); else { diff --git a/main/lib/eval/eval_read.c b/main/lib/eval/eval_read.c index 481d6c1ae..cca583c20 100644 --- a/main/lib/eval/eval_read.c +++ b/main/lib/eval/eval_read.c @@ -999,7 +999,7 @@ static void add_string() i = xdigit_val(get_char_offset(2)); if (i >= 0) { - car = (car << 4) | i; + car = (car << 4) | (uchar)i; *p = car; source_ptr += 2; continue; diff --git a/main/share/gb_code.h b/main/share/gb_code.h index 2e16aa3b3..ac8e1277f 100644 --- a/main/share/gb_code.h +++ b/main/share/gb_code.h @@ -134,7 +134,7 @@ void CODE_dup(void); void CODE_return(int return_value); -void CODE_push_char(char car); +void CODE_push_char(uchar car); void CODE_push_void(void); void CODE_subr(short subr, short nparam, short optype, bool fixed); diff --git a/main/share/gb_code_temp.h b/main/share/gb_code_temp.h index d490e87b0..da0087881 100644 --- a/main/share/gb_code_temp.h +++ b/main/share/gb_code_temp.h @@ -1031,7 +1031,7 @@ void CODE_stop(void) #endif /* PROJECT_COMP */ -void CODE_push_char(char car) +void CODE_push_char(uchar car) { LAST_CODE;