}
{IDENT} {
- unsigned x = cdecl__to_keyword(yytext, yyleng, yyextra);
- int tok;
+ int len = yyleng, tok;
+ unsigned x;
+ x = cdecl__to_keyword(yytext, len, yyextra);
yylval->spectype = UNPACK_SPEC(x & 0xff);
if ((tok = (x >> 8)) == PACK_TOKEN(T_IDENT)) {
/*
* downsides.
*/
#if 1
- if ((c = strchr(yytext, '-')))
+ if ((c = memchr(yytext, '-', len)))
goto invalid_char;
#else
yyless(strcspn(yytext, "-"));
#endif
- if (!(yylval->item = cdecl__alloc_item(yyleng+1)))
+ if (!(yylval->item = cdecl__alloc_item(len+1)))
return T_LEX_ERROR; \
- memcpy(yylval->item->s, yytext, yyleng+1);
+ memcpy(yylval->item->s, yytext, len+1);
}
return UNPACK_TOKEN(tok);
}