Re: [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-22 Thread Markus Armbruster
Peter Xu writes: > Fix two places to use literal printf format when possible. > > Signed-off-by: Peter Xu Reviewed-by: Markus Armbruster

Re: [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-21 Thread Peter Xu
On Mon, Mar 21, 2016 at 03:14:48PM -0600, Eric Blake wrote: > On 03/09/2016 06:46 PM, Peter Xu wrote: > > > > Is this a grammar btw? > > Yes, C has an ugly grammar, because [] is just syntactic sugar for > deferencing pointer addition with nicer operator precedence. Quoting > C99 6.5.2.1: > > "

Re: [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-21 Thread Eric Blake
On 03/09/2016 06:46 PM, Peter Xu wrote: > On Wed, Mar 09, 2016 at 03:14:03PM -0700, Eric Blake wrote: >>> +func_fprintf(f, "%*s[%i]:%c", indentation * 4, "", i, >>> + composite ? '\n' : ' '); >> >> [The nerd in me wants to point out that you could avoid the ternary by >>

Re: [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-09 Thread Peter Xu
On Wed, Mar 09, 2016 at 03:14:03PM -0700, Eric Blake wrote: > > +func_fprintf(f, "%*s[%i]:%c", indentation * 4, "", i, > > + composite ? '\n' : ' '); > > [The nerd in me wants to point out that you could avoid the ternary by > writing '"\n "[composite]', but that's too

Re: [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-09 Thread Eric Blake
On 03/08/2016 10:56 PM, Peter Xu wrote: > Fix two places to use literal printf format when possible. > > Signed-off-by: Peter Xu > --- > block/qapi.c | 10 -- > 1 file changed, 4 insertions(+), 6 deletions(-) Reviewed-by: Eric Blake > > diff --git a/block/qapi.c b/block/qapi.c > inde

[Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-08 Thread Peter Xu
Fix two places to use literal printf format when possible. Signed-off-by: Peter Xu --- block/qapi.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index db2d3fb..c4c2115 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -619,9 +619,8 @@ s