Commit 4f0fa260 authored by Alexandre Julliard's avatar Alexandre Julliard

wmc: Change the prefix on bison-generated names to avoid the name-prefix directive.

parent 86bb809e
......@@ -302,7 +302,7 @@ try_again:
if(!n)
{
yywarning("Re-read line (input was or converted to zilch)");
mcy_warning("Re-read line (input was or converted to zilch)");
goto try_again; /* Should not happen, but could be due to stdin reading and a signal */
}
......@@ -490,7 +490,7 @@ static int scan_number(int ch)
else
{
unget_unichar(ch);
yylval.num = 0;
mcy_lval.num = 0;
return tNUMBER;
}
break;
......@@ -535,7 +535,7 @@ static int scan_number(int ch)
finish:
unget_unichar(ch);
push_char(0);
yylval.num = strtoul(get_char_stack(), NULL, base);
mcy_lval.num = strtoul(get_char_stack(), NULL, base);
return tNUMBER;
}
......@@ -586,7 +586,7 @@ void get_tokentable(token_t **tab, int *len)
* The scanner
*
*/
int yylex(void)
int mcy_lex(void)
{
static const WCHAR ustr_dot1[] = { '.', '\n', 0 };
static const WCHAR ustr_dot2[] = { '.', '\r', '\n', 0 };
......@@ -639,7 +639,7 @@ int yylex(void)
set_codepage(WMC_DEFAULT_CODEPAGE);
return tMSGEND;
}
yylval.str = xunistrdup(get_unichar_stack());
mcy_lval.str = xunistrdup(get_unichar_stack());
return tLINE;
}
......@@ -677,7 +677,7 @@ int yylex(void)
unget_unichar(ch);
push_unichar(0);
want_file = 0;
yylval.str = xunistrdup(get_unichar_stack());
mcy_lval.str = xunistrdup(get_unichar_stack());
return tFILE;
}
......@@ -693,7 +693,7 @@ int yylex(void)
push_unichar(0);
if(!(tok = lookup_token(get_unichar_stack())))
{
yylval.str = xunistrdup(get_unichar_stack());
mcy_lval.str = xunistrdup(get_unichar_stack());
return tIDENT;
}
switch(tok->type)
......@@ -706,7 +706,7 @@ int yylex(void)
/* Fall through */
case tok_severity:
case tok_facility:
yylval.tok = tok;
mcy_lval.tok = tok;
return tTOKEN;
default:
......@@ -738,7 +738,7 @@ int yylex(void)
newline();
push_unichar(ch); /* Include the newline */
push_unichar(0);
yylval.str = xunistrdup(get_unichar_stack());
mcy_lval.str = xunistrdup(get_unichar_stack());
return tCOMMENT;
default:
xyyerror("Invalid character '%c' (0x%04x)", isisochar(ch) && isprint(ch) ? ch : '.', ch);
......
......@@ -95,8 +95,6 @@ static cp_xlat_t *find_cpxlat(int lan);
%}
%name-prefix="yy"
%union {
WCHAR *str;
unsigned num;
......@@ -231,7 +229,7 @@ lmap : token '=' tNUMBER setfile ':' tFILE optcp {
$1->codepage = $7;
do_add_token(tok_language, $1, "language");
if(!find_language($3) && !find_cpxlat($3))
yywarning("Language 0x%x not built-in, using codepage %d; use explicit codepage to override", $3, WMC_DEFAULT_CODEPAGE);
mcy_warning("Language 0x%x not built-in, using codepage %d; use explicit codepage to override", $3, WMC_DEFAULT_CODEPAGE);
}
| token '=' tNUMBER setfile ':' error { xyyerror("Filename expected"); }
| token '=' tNUMBER error { xyyerror(err_colon); }
......@@ -421,7 +419,7 @@ static void do_add_token(tok_e type, token_t *tok, const char *code)
if(tp)
{
if(tok->type != type)
yywarning("Type change in token");
mcy_warning("Type change in token");
if(tp != tok)
xyyerror("Overlapping token not the same");
/* else its already defined and changed */
......@@ -444,7 +442,7 @@ static lanmsg_t *new_lanmsg(lan_cp_t *lcp, WCHAR *msg)
lmp->msg = msg;
lmp->len = unistrlen(msg) + 1; /* Include termination */
if(lmp->len > 4096)
yywarning("Message exceptionally long; might be a missing termination");
mcy_warning("Message exceptionally long; might be a missing termination");
return lmp;
}
......
......@@ -49,7 +49,7 @@ static void generic_msg(const char *s, const char *t, va_list ap)
* The extra routine 'xyyerror' is used to exit after giving a real
* message.
*/
int yyerror(const char *s, ...)
int mcy_error(const char *s, ...)
{
#ifndef SUPPRESS_YACC_ERROR_MESSAGE
va_list ap;
......@@ -70,7 +70,7 @@ int xyyerror(const char *s, ...)
return 1;
}
int yywarning(const char *s, ...)
int mcy_warning(const char *s, ...)
{
va_list ap;
va_start(ap, s);
......@@ -215,7 +215,7 @@ int unistricmp(const WCHAR *s1, const WCHAR *s2)
if(!once)
{
once++;
yywarning(warn);
mcy_warning(warn);
}
i = *s1++ - *s2++;
}
......@@ -228,7 +228,7 @@ int unistricmp(const WCHAR *s1, const WCHAR *s2)
if((*s1 & 0xffff) > 0x7f || (*s2 & 0xffff) > 0x7f)
{
if(!once)
yywarning(warn);
mcy_warning(warn);
return *s1 - *s2;
}
else
......
......@@ -33,9 +33,9 @@ char *xstrdup(const char *str);
#define __attribute__(X)
#endif
int yyerror(const char *s, ...) __attribute__((format (printf, 1, 2)));
int mcy_error(const char *s, ...) __attribute__((format (printf, 1, 2)));
int xyyerror(const char *s, ...) __attribute__((format (printf, 1, 2)));
int yywarning(const char *s, ...) __attribute__((format (printf, 1, 2)));
int mcy_warning(const char *s, ...) __attribute__((format (printf, 1, 2)));
void internal_error(const char *file, int line, const char *s, ...) __attribute__((format (printf, 3, 4)));
void error(const char *s, ...) __attribute__((format (printf, 1, 2)));
void warning(const char *s, ...) __attribute__((format (printf, 1, 2)));
......
......@@ -113,7 +113,7 @@ int char_number = 1; /* The current char pos within the line */
char *cmdline; /* The entire commandline */
time_t now; /* The time of start of wmc */
int yydebug;
int mcy_debug;
int getopt (int argc, char *const *argv, const char *optstring);
static void segvhandler(int sig);
......@@ -239,7 +239,7 @@ int main(int argc,char *argv[])
return 1;
}
yydebug = dodebug;
mcy_debug = dodebug;
if(dodebug)
{
setbuf(stdout, 0);
......@@ -273,7 +273,7 @@ int main(int argc,char *argv[])
else
yyin = stdin;
ret = yyparse();
ret = mcy_parse();
if(input_name)
fclose(yyin);
......
......@@ -56,15 +56,15 @@ extern time_t now;
extern int line_number;
extern int char_number;
int yyparse(void);
extern int yydebug;
int mcy_parse(void);
extern int mcy_debug;
extern int want_nl;
extern int want_line;
extern int want_file;
extern node_t *nodehead;
extern lan_blk_t *lanblockhead;
int yylex(void);
int mcy_lex(void);
FILE *yyin;
void set_codepage(int cp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment