Use 'int' instead of 'char' for character variables
MINIX libc headers define the ctype.h toupper() etc. functions as preprocessor macros that don't cast their argument to int! So a char argument causes clang to say "warning: array subscript is of type 'char'".
This commit is contained in:
parent
10eb936836
commit
4a89521493
8
c/read.h
8
c/read.h
|
@ -172,7 +172,7 @@ static char buf[256];
|
||||||
static char nextchar(void)
|
static char nextchar(void)
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
char c;
|
int c;
|
||||||
struct ios *f = F;
|
struct ios *f = F;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -207,7 +207,7 @@ static void accumchar(char c, int *pi)
|
||||||
}
|
}
|
||||||
|
|
||||||
// return: 1 if escaped (forced to be symbol)
|
// return: 1 if escaped (forced to be symbol)
|
||||||
static int read_token(char c, int digits)
|
static int read_token(int c, int digits)
|
||||||
{
|
{
|
||||||
int i = 0, ch, escaped = 0, issym = 0, first = 1;
|
int i = 0, ch, escaped = 0, issym = 0, first = 1;
|
||||||
|
|
||||||
|
@ -244,9 +244,9 @@ static value_t do_read_sexpr(value_t label);
|
||||||
|
|
||||||
static uint32_t peek(void)
|
static uint32_t peek(void)
|
||||||
{
|
{
|
||||||
char c, *end;
|
char *end;
|
||||||
fixnum_t x;
|
fixnum_t x;
|
||||||
int ch, base;
|
int c, ch, base;
|
||||||
|
|
||||||
if (toktype != TOK_NONE)
|
if (toktype != TOK_NONE)
|
||||||
return toktype;
|
return toktype;
|
||||||
|
|
Loading…
Reference in New Issue