mirror of
https://github.com/linux-msm/qmic.git
synced 2024-11-23 17:54:01 +08:00
parser: use unsigned for array indexes
We have no use for negative array indexes, so change the types of the static variables scratch_pos, input_pos, and input_len to be unsigned. Signed-off-by: Alex Elder <elder@linaro.org> Message-Id: <20211001232338.769309-3-elder@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
0d92483f4a
commit
8dcad17a55
8
parser.c
8
parser.c
@ -38,15 +38,15 @@ struct token {
|
||||
};
|
||||
|
||||
static char scratch_buf[128];
|
||||
static int scratch_pos;
|
||||
static unsigned scratch_pos;
|
||||
|
||||
static int yyline = 1;
|
||||
|
||||
static int input()
|
||||
{
|
||||
static char input_buf[128];
|
||||
static int input_pos;
|
||||
static int input_len;
|
||||
static unsigned input_pos;
|
||||
static unsigned input_len;
|
||||
int ret;
|
||||
int ch;
|
||||
|
||||
@ -189,7 +189,7 @@ static void yyerror(const char *fmt, ...)
|
||||
va_start(ap, fmt);
|
||||
|
||||
vsprintf(buf, fmt, ap);
|
||||
printf("parse error on line %d: %s\n", yyline, buf);
|
||||
printf("parse error on line %u: %s\n", yyline, buf);
|
||||
|
||||
va_end(ap);
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user