On 04/09/16 11:54, Christian Couder wrote:
> On Thu, Sep 1, 2016 at 10:19 AM, Christian Couder
> <christian.cou...@gmail.com> wrote:
>> On Thu, Sep 1, 2016 at 12:20 AM, Stefan Beller <sbel...@google.com> wrote:
>>> On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder
>>> <christian.cou...@gmail.com> wrote:
>>>> To avoid printing anything when applying with
>>>> `state->apply_verbosity == verbosity_silent`, let's save the
>>>> existing warn and error routines before applying, and let's
>>>> replace them with a routine that does nothing.
>>>>
>>>> Then after applying, let's restore the saved routines.
>>>>
>>>> Helped-by: Stefan Beller <sbel...@google.com>
>>>> Signed-off-by: Christian Couder <chrisc...@tuxfamily.org>
>>>> ---
>>>>  apply.c | 21 ++++++++++++++++++++-
>>>>  apply.h |  8 ++++++++
>>>>  2 files changed, 28 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/apply.c b/apply.c
>>>> index ddbb0a2..bf81b70 100644
>>>> --- a/apply.c
>>>> +++ b/apply.c
>>>> @@ -112,6 +112,11 @@ void clear_apply_state(struct apply_state *state)
>>>>         /* &state->fn_table is cleared at the end of apply_patch() */
>>>>  }
>>>>
>>>> +static void mute_routine(const char *bla, va_list params)
>>>
>>> Instead of 'bla' you could go with 'format' as the man page for
>>> [f]printf puts it.
>>> Or you could leave it empty, i.e.
>>>
>>>     static void mute_routine(const char *, va_list)
>>>     ...
>>
>> Ok to do that.
> 
> Actually I get the following error when doing that:
> 
> apply.c: In function ‘mute_routine’:
> apply.c:115:1: error: parameter name omitted
>  static void mute_routine(const char *, va_list)
>  ^
> apply.c:115:1: error: parameter name omitted
> make: *** [apply.o] Error 1

Yes, this is not C++. ;-)

> So I will leave it as is.

I think I would prefer to see:

    static void mute_routine(const char *msg, va_list params)

given that it would either be an error-msg or a warning-msg.

ATB,
Ramsay Jones

Reply via email to