Vincent Povirk : widl: Fix string format warning.
Alexandre Julliard
julliard at winehq.org
Fri Dec 5 07:42:53 CST 2008
Module: wine
Branch: master
Commit: 479f5a1b217a9293528924e3f61498f6757467d0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=479f5a1b217a9293528924e3f61498f6757467d0
Author: Vincent Povirk <madewokherd+d41d at gmail.com>
Date: Thu Dec 4 23:25:56 2008 -0600
widl: Fix string format warning.
yyerror takes a single string argument, not a format string.
---
tools/widl/utils.c | 18 ++++++------------
tools/widl/utils.h | 2 +-
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/tools/widl/utils.c b/tools/widl/utils.c
index 1730e41..2e05add 100644
--- a/tools/widl/utils.c
+++ b/tools/widl/utils.c
@@ -66,18 +66,6 @@ static void generic_msg(const loc_info_t *loc_info, const char *s, const char *t
}
-/* yyerror: yacc assumes this is not newline terminated. */
-void parser_error(const char *s, ...)
-{
- loc_info_t cur_location = CURRENT_LOCATION;
- va_list ap;
- va_start(ap, s);
- generic_msg(&cur_location, s, "Error", ap);
- fprintf(stderr, "\n");
- va_end(ap);
- exit(1);
-}
-
void error_loc(const char *s, ...)
{
loc_info_t cur_loc = CURRENT_LOCATION;
@@ -88,6 +76,12 @@ void error_loc(const char *s, ...)
exit(1);
}
+/* yyerror: yacc assumes this is not newline terminated. */
+void parser_error(const char *s)
+{
+ error_loc("%s\n", s);
+}
+
void error_loc_info(const loc_info_t *loc_info, const char *s, ...)
{
va_list ap;
diff --git a/tools/widl/utils.h b/tools/widl/utils.h
index 761d3b4..5c440be 100644
--- a/tools/widl/utils.h
+++ b/tools/widl/utils.h
@@ -33,7 +33,7 @@ char *xstrdup(const char *str);
#define __attribute__(X)
#endif
-void parser_error(const char *s, ...) __attribute__((format (printf, 1, 2))) __attribute__((noreturn));
+void parser_error(const char *s) __attribute__((noreturn));
int parser_warning(const char *s, ...) __attribute__((format (printf, 1, 2)));
void error_loc(const char *s, ...) __attribute__((format (printf, 1, 2))) __attribute__((noreturn));
void error(const char *s, ...) __attribute__((format (printf, 1, 2))) __attribute__((noreturn));
More information about the wine-cvs
mailing list