wpp: Shed an unused parameter from generic_msg. (RESEND)

Gerald Pfeifer gerald at pfeifer.com
Sat Sep 10 21:58:48 CDT 2011


On Thu, 8 Sep 2011, Alexandre Julliard wrote:
> It's still wrong, the parameter is used inside the #ifdef.

Fair enough!  How about the patch below then?  Tested with and
without WANT_NEAR_INDICATION defined this time.

Or would you rather see a patch that remove WANT_NEAR_INDICATION
altogether?

Gerald


diff --git a/libs/wpp/preproc.c b/libs/wpp/preproc.c
index 99934d6..996c0f8 100644
--- a/libs/wpp/preproc.c
+++ b/libs/wpp/preproc.c
@@ -684,7 +684,11 @@ int pp_get_if_depth(void)
 
 /* #define WANT_NEAR_INDICATION */
 
-static void generic_msg(const char *s, const char *t, const char *n, va_list ap)
+static void generic_msg(const char *s, const char *t,
+#ifdef WANT_NEAR_INDICATION 
+                        const char *n,
+#endif
+                        va_list ap)
 {
 	fprintf(stderr, "%s:%d:%d: %s: ", pp_status.input ? pp_status.input : "stdin",
                 pp_status.line_number, pp_status.char_number, t);
@@ -709,13 +713,21 @@ end:
 
 static void wpp_default_error(const char *file, int line, int col, const char *near, const char *msg, va_list ap)
 {
+#ifdef WANT_NEAR_INDICATION 
 	generic_msg(msg, "Error", near, ap);
+#else
+	generic_msg(msg, "Error", ap);
+#endif
 	exit(1);
 }
 
 static void wpp_default_warning(const char *file, int line, int col, const char *near, const char *msg, va_list ap)
 {
+#ifdef WANT_NEAR_INDICATION 
 	generic_msg(msg, "Warning", near, ap);
+#else
+	generic_msg(msg, "Warning", ap);
+#endif
 }
 
 static const struct wpp_callbacks default_callbacks =



More information about the wine-devel mailing list