qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qapi: generate space in c_type() to fix coding


From: Amos Kong
Subject: Re: [Qemu-devel] [PATCH] qapi: generate space in c_type() to fix coding style
Date: Mon, 21 Apr 2014 23:25:39 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Apr 19, 2014 at 03:16:52PM -0600, Eric Blake wrote:
> On 04/18/2014 09:56 PM, Amos Kong wrote:
> > Currently we always add a space after c_type in mcgen(), there is
> > some redundant space in generated code. The space isn't needed for
> > points by the coding style.
> 
> Second sentence is awkward; maybe:
> 
> Avoiding the space when appropriate makes us match the coding style.
> 
> > 
> >   char * value;
> >         ^
> >   qapi_free_NameInfo(NameInfo * obj)
> >                                ^
> > It's fussy to add checking in each mcgen(), this patch just addes
> 
> s/addes/adds/
> 
> > the necessary space in c_type(), and remove original space in mcgen().
> 
> s/remove/removes the/
> 
> > 
> > Signed-off-by: Amos Kong <address@hidden>
> > ---
> >  scripts/qapi-types.py | 10 +++++-----
> >  scripts/qapi-visit.py | 20 ++++++++++----------
> >  scripts/qapi.py       | 14 +++++++-------
> >  3 files changed, 22 insertions(+), 22 deletions(-)
> 
> >      union {
> > -        %(type)s value;
> > +        %(type)svalue;
> 
> Code itself does what it claims.  It's a bit harder to read the
> generator without the space, and I might have added a comment to
> c_type() explaining that the output string includes the space except for
> pointer types.  I'll let others decide whether to take the patch, but
> I'm comfortable if the commit message is fixed and you want to add:
> 
> Reviewed-by: Eric Blake <address@hidden>


I queued this patch for long time, I'm also not sure if it's
necessary. I planed to send it out when I saw your recent comment
about this issue.

Michael, what's your opinion?
 
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 



-- 
                        Amos.

Attachment: pgpydC1o8QXWN.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]