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

Michael Stefaniuc mstefani at redhat.com
Sun Sep 11 16:07:05 CDT 2011


On 09/11/2011 04:58 AM, Gerald Pfeifer wrote:
> 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.
This is patch is ugly. Just keeping the unused parameter warning is way
better. Code needs to be optimized for the human reader not perverted to
make a tool stfu.

bye
	michael

> 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 =
> 
> 


-- 
Michael Stefaniuc                           Tel.: +49-711-96437-199
Consulting Communications Engineer          Fax.: +49-711-96437-111
--------------------------------------------------------------------
Reg. Adresse: Red Hat GmbH, Otto-Hahn-Strasse 20, 85609 Dornach
Handelsregister: Amtsgericht Muenchen HRB 153243
Geschäftsführer: Brendan Lane, Charlie Peters, Michael Cunningham,
                 Charles Cachera



More information about the wine-devel mailing list