From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Michael Hudson-Doyle <michael.hudson@linaro.org>
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@redhat.com>,
Will Deacon <will.deacon@arm.com>,
Jean Pihet <jean.pihet@linaro.org>
Subject: Re: [PATCH v2] perf tools: Remove cast of non-variadic function to variadic
Date: Fri, 1 Nov 2013 11:36:26 -0200 [thread overview]
Message-ID: <20131101133626.GA6409@infradead.org> (raw)
In-Reply-To: <87zjppvw7y.fsf@canonical.com>
Em Thu, Oct 31, 2013 at 04:47:45PM -0700, Michael Hudson-Doyle escreveu:
> -int percent_color_snprintf(char *bf, size_t size, const char *fmt, double percent)
> +int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...)
> {
> - const char *color = get_percent_color(percent);
> + va_list args;
> + double percent;
> + const char *color;
> +
> + va_start(args, fmt);
> + percent = va_arg(args, double);
> + va_end(args);
> + color = get_percent_color(percent);
> return color_snprintf(bf, size, color, fmt, percent);
> }
As a bug fix I'm merging this now, but I wonder if, since we're doing
the va_start/end dance here, can't we call some color_vsnprintf variant
so as to avoid doing it twice?
I'll look into that after going thru more urgent stuff.
- Arnaldo
next prev parent reply other threads:[~2013-11-01 13:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-31 23:47 [PATCH v2] perf tools: Remove cast of non-variadic function to variadic Michael Hudson-Doyle
2013-11-01 13:36 ` Arnaldo Carvalho de Melo [this message]
2013-11-01 18:10 ` Michael Hudson-Doyle
2013-11-04 6:54 ` [tip:perf/core] " tip-bot for Michael Hudson-Doyle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131101133626.GA6409@infradead.org \
--to=acme@redhat.com \
--cc=jean.pihet@linaro.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hudson@linaro.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox