qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: armbru@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org,
	wenchaoqemu@gmail.com, mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v6 2/3] qapi: add const prefix to 'char *' insider c_type()
Date: Wed, 18 Jun 2014 15:54:21 +0800	[thread overview]
Message-ID: <20140618075421.GD32372@z.redhat.com> (raw)
In-Reply-To: <53A10CB9.8010809@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1770 bytes --]

On Tue, Jun 17, 2014 at 09:51:21PM -0600, Eric Blake wrote:
> On 06/10/2014 05:25 AM, Amos Kong wrote:
> > It's ugly to add const prefix for parameter type by an if statement
> > outside c_type(). This patch adds a parameter to do it.
> > 
> > Signed-off-by: Amos Kong <akong@redhat.com>
> > Suggested-by: Markus Armbruster <armbru@redhat.com>
> > Reviewed-by: Eric Blake <eblake@redhat.com>
> > Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> > Reviewed-by: Markus Armbruster <armbru@redhat.com>
> > ---
> >  scripts/qapi-commands.py | 4 +---
> >  scripts/qapi.py          | 4 +++-
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> Wenchao's series introduces another client that needs this treatment:
> https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01225.html
> 
> Depending on what order things get merged in, you may need followup
> patches or conflict resolution.

Thanks for the reminder.

I just checked the patch, c_type() is only used once, and the output
is used insider mcgen().

So it's safe to apply my patchset.

> > diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
> > index 7d93d01..34f200a 100644
> > --- a/scripts/qapi-commands.py
> > +++ b/scripts/qapi-commands.py
> > @@ -29,9 +29,7 @@ def type_visitor(name):
> >  def generate_command_decl(name, args, ret_type):
> >      arglist=""
> >      for argname, argtype, optional, structured in parse_args(args):
> > -        argtype = c_type(argtype)
> > -        if argtype == "char *":
> > -            argtype = "const char *"
> > +        argtype = c_type(argtype, is_param=True)
> 
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 



-- 
			Amos.

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-06-18  7:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 11:25 [Qemu-devel] [PATCH v6 0/3] qapi: fix coding style in generated code Amos Kong
2014-06-10 11:25 ` [Qemu-devel] [PATCH v6 1/3] qapi: fix coding style in parameters list Amos Kong
2014-06-10 11:25 ` [Qemu-devel] [PATCH v6 2/3] qapi: add const prefix to 'char *' insider c_type() Amos Kong
2014-06-18  3:51   ` Eric Blake
2014-06-18  7:54     ` Amos Kong [this message]
2014-06-10 11:25 ` [Qemu-devel] [PATCH v6 3/3] qapi: Suppress unwanted space between type and identifier Amos Kong
2014-06-19 14:40 ` [Qemu-devel] [PATCH v6 0/3] qapi: fix coding style in generated code Luiz Capitulino

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=20140618075421.GD32372@z.redhat.com \
    --to=akong@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wenchaoqemu@gmail.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;
as well as URLs for NNTP newsgroup(s).