lex: add std namespace to a few function calls
This commit is contained in:
parent
5889f942b8
commit
521e9a5415
1 changed files with 4 additions and 4 deletions
|
@ -123,7 +123,7 @@ int lex_t::io_error(YYSTYPE *yylval) {
|
|||
}
|
||||
|
||||
int lex_t::syntax_error(YYSTYPE *yylval) {
|
||||
if (ferror(file))
|
||||
if (std::ferror(file))
|
||||
return io_error(yylval);
|
||||
|
||||
yylval->error = "syntax error";
|
||||
|
@ -143,7 +143,7 @@ int lex_t::consume_comment(YYSTYPE *yylval, YYLTYPE *yylloc) {
|
|||
prev = current();
|
||||
}
|
||||
|
||||
if (ferror(file))
|
||||
if (std::ferror(file))
|
||||
return io_error(yylval);
|
||||
|
||||
yylval->error = "unterminated block comment";
|
||||
|
@ -170,7 +170,7 @@ int lex_t::parse_string(YYSTYPE *yylval, YYLTYPE *yylloc) {
|
|||
|
||||
while (true) {
|
||||
if (!next(yylloc, true)) {
|
||||
free(buf);
|
||||
std::free(buf);
|
||||
return unterminated_string(yylval);
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ int lex_t::parse_float(YYSTYPE *yylval, YYLTYPE *yylloc) {
|
|||
yylval->fnum = std::strtof(token, &endptr);
|
||||
|
||||
bool ok = !*endptr;
|
||||
free(token);
|
||||
std::free(token);
|
||||
|
||||
if (!ok)
|
||||
return syntax_error(yylval);
|
||||
|
|
Reference in a new issue