mirror of
https://github.com/linux-msm/qmic.git
synced 2024-11-23 09:44:06 +08:00
parser: make input() return char
Now that read errors are dealt with immediately, input() will never return anything but a character. Change its return type to char, and change the type of the variable in yylex() that holds its return value to char as well. Signed-off-by: Alex Elder <elder@linaro.org> Message-Id: <20211001232338.769309-9-elder@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
28c48a5e18
commit
6b15855aad
6
parser.c
6
parser.c
@ -58,13 +58,13 @@ static void yyerror(const char *fmt, ...)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static int input()
|
||||
static char input()
|
||||
{
|
||||
static char input_buf[128];
|
||||
static unsigned input_pos;
|
||||
static unsigned input_len;
|
||||
int ret;
|
||||
int ch;
|
||||
char ch;
|
||||
|
||||
if (scratch_pos) {
|
||||
ch = scratch_buf[--scratch_pos];
|
||||
@ -148,7 +148,7 @@ static struct token yylex()
|
||||
char buf[128];
|
||||
char *p = buf;
|
||||
int base;
|
||||
int ch;
|
||||
char ch;
|
||||
|
||||
while ((ch = input()) && isspace(ch))
|
||||
;
|
||||
|
Loading…
Reference in New Issue
Block a user