summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2021-10-01 18:23:12 -0500
committerBjorn Andersson <bjorn.andersson@linaro.org>2021-10-04 12:18:31 -0500
commit6b15855aadea29b9b0d04929fc4da6bca9ecce3f (patch)
treeda9d9b627374e5656b694918c42be663fee2f06a
parent28c48a5e1846f5d4de7c6fc56b1e026baff6b894 (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.c6
1 files 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))
;