From: Wei Liu <wei.liu2@citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [PATCH 1/2] libxl: replace libxl__sprintf(gc, ...) with GCSPRINTF
Date: Tue, 17 Nov 2015 15:51:04 +0000 [thread overview]
Message-ID: <20151117155104.GG1495@citrix.com> (raw)
In-Reply-To: <1447774338.301.47.camel@citrix.com>
On Tue, Nov 17, 2015 at 03:32:18PM +0000, Ian Campbell wrote:
> On Tue, 2015-11-17 at 15:24 +0000, Wei Liu wrote:
> > On Tue, Nov 17, 2015 at 03:21:39PM +0000, Ian Campbell wrote:
> > > On Tue, 2015-11-17 at 15:16 +0000, Wei Liu wrote:
> > > > On Tue, Nov 17, 2015 at 03:08:47PM +0000, Wei Liu wrote:
> > > > > The rune is
> > > > >
> > > > > sed -i 's/libxl__sprintf(gc,\s*\(".*",.*\)/GCSPRINTF(\1/g'
> > > > > libxl*.c
> > > > >
> > > >
> > > > Hmm... It looks like this rune alone doesn't cover all situations.
> > > >
> > > > $ ack-grep 'libxl__sprintf\(gc' | wc -l
> > > > 43
> > > >
> > > > Let me see if I can refine it a bit or use multiple runes to replace
> > > > all
> > > > libxl__sprintf.
> > >
> > > Coccinelle would probably work quite well for this particular case.
> > >
> >
> > Unfortunately no. Coccinelle doesn't support variable arguments,
> > otherwise I would have used it already.
>
> Ah yes, I remember struggling with that at one point.
>
> FWIW xen.git db82cd9251eb55a55242d6a713f710cd72d18fb0
This is me enumerating from 0 to 3 arguments, which at the time covered
90%+ cases.
Actually this time it is not too bad. One sed invocation plus two minor
fixups are enough to make libxl build.
Wei.
> and cb86677d2d1e061bf8d057bf1dd06cbb60210f33 seems to have gotten it to
> work some way or another.
>
> Ian.
>
next prev parent reply other threads:[~2015-11-17 15:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 15:08 [PATCH 0/2] Convert libxl__sprintf(gc) to GCSPRINTF Wei Liu
2015-11-17 15:08 ` [PATCH 1/2] libxl: replace libxl__sprintf(gc, ...) with GCSPRINTF Wei Liu
2015-11-17 15:16 ` Wei Liu
2015-11-17 15:21 ` Ian Campbell
2015-11-17 15:24 ` Wei Liu
2015-11-17 15:32 ` Ian Campbell
2015-11-17 15:51 ` Wei Liu [this message]
2015-11-17 15:08 ` [PATCH 2/2] libxl: fix line wrapping issues introduced by automatic replacement Wei Liu
2015-11-17 15:34 ` [PATCH 0/2] Convert libxl__sprintf(gc) to GCSPRINTF David Vrabel
2015-11-17 15:38 ` Wei Liu
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=20151117155104.GG1495@citrix.com \
--to=wei.liu2@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.