From 6b15855aadea29b9b0d04929fc4da6bca9ecce3f Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Fri, 1 Oct 2021 18:23:12 -0500 Subject: [PATCH] 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 Message-Id: <20211001232338.769309-9-elder@linaro.org> Signed-off-by: Bjorn Andersson --- parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parser.c b/parser.c index c94da50..788129f 100644 --- a/parser.c +++ b/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)) ;