From 4f0fa2608a4bf9ea40da9d234def91aad3806405 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 12 Sep 2006 09:05:15 +0200 Subject: [PATCH] wmc: Change the prefix on bison-generated names to avoid the name-prefix directive. --- tools/wmc/mcl.c | 18 +++++++++--------- tools/wmc/mcy.y | 8 +++----- tools/wmc/utils.c | 8 ++++---- tools/wmc/utils.h | 4 ++-- tools/wmc/wmc.c | 6 +++--- tools/wmc/wmc.h | 6 +++--- 6 files changed, 24 insertions(+), 26 deletions(-) diff --git a/tools/wmc/mcl.c b/tools/wmc/mcl.c index 99abfad0252..62cdf2534e6 100644 --- a/tools/wmc/mcl.c +++ b/tools/wmc/mcl.c @@ -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); diff --git a/tools/wmc/mcy.y b/tools/wmc/mcy.y index abe5d0253d6..fad56de67f7 100644 --- a/tools/wmc/mcy.y +++ b/tools/wmc/mcy.y @@ -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; } diff --git a/tools/wmc/utils.c b/tools/wmc/utils.c index 6b2de4cc279..2b3b87cd894 100644 --- a/tools/wmc/utils.c +++ b/tools/wmc/utils.c @@ -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 diff --git a/tools/wmc/utils.h b/tools/wmc/utils.h index 361917a05d8..5a1faf143a6 100644 --- a/tools/wmc/utils.h +++ b/tools/wmc/utils.h @@ -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))); diff --git a/tools/wmc/wmc.c b/tools/wmc/wmc.c index 4dd98895c0d..29412194833 100644 --- a/tools/wmc/wmc.c +++ b/tools/wmc/wmc.c @@ -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); diff --git a/tools/wmc/wmc.h b/tools/wmc/wmc.h index b18c7f05f3b..86ccd6f17fb 100644 --- a/tools/wmc/wmc.h +++ b/tools/wmc/wmc.h @@ -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);