diff options
author | Alex Elder <elder@linaro.org> | 2021-10-01 18:23:12 -0500 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2021-10-04 12:18:31 -0500 |
commit | 6b15855aadea29b9b0d04929fc4da6bca9ecce3f (patch) | |
tree | da9d9b627374e5656b694918c42be663fee2f06a | |
parent | 28c48a5e1846f5d4de7c6fc56b1e026baff6b894 (diff) |
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>
-rw-r--r-- | parser.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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)) ; |