Re: [PATCH v13 10/14] apply: change error_routine when silent
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Sep 4, 2016, 10:54 UTC
- Message-ID
- <CAP8UFD38CC-Ah9zVcnU3a4nGH2CzOn74Adx=42pmckjPv=e_Bg@mail.gmail.com>
- In-Reply-To
- <CAP8UFD2Lwd_1+cWT702deF8=iFmBRKCi9gLSOizPbyLmeKepsw@mail.gmail.com>
On Thu, Sep 1, 2016 at 10:19 AM, Christian Couder <christian.couder@gmail.com> wrote:
Show 35 quoted lines
> On Thu, Sep 1, 2016 at 12:20 AM, Stefan Beller <sbeller@google.com> wrote: >> On Sat, Aug 27, 2016 at 11:45 AM, Christian Couder >> <christian.couder@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 <sbeller@google.com> >>> Signed-off-by: Christian Couder <chriscool@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
So I will leave it as is.