All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: Richard Henderson <rth@twiddle.net>, qemu-devel@nongnu.org
Cc: lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Adjust qapi-visit for python-2.4.3
Date: Fri, 01 Nov 2013 12:02:08 -0500	[thread overview]
Message-ID: <20131101170208.22021.84796@loki> (raw)
In-Reply-To: <1383251161-10441-1-git-send-email-rth@twiddle.net>

Quoting Richard Henderson (2013-10-31 15:26:01)
> We say we support python 2.4, but python 2.4.3 does not
> support the "expr if test else expr" syntax used here.
> 
> This allows QEMU to compile on RHEL 5.3, the last release for ia64.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>

> ---
>  scripts/qapi-visit.py | 17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
> index c39e628..65f1a54 100644
> --- a/scripts/qapi-visit.py
> +++ b/scripts/qapi-visit.py
> @@ -20,7 +20,10 @@ import errno
>  def generate_visit_struct_fields(name, field_prefix, fn_prefix, members, base = None):
>      substructs = []
>      ret = ''
> -    full_name = name if not fn_prefix else "%s_%s" % (name, fn_prefix)
> +    if not fn_prefix:
> +        full_name = name
> +    else:
> +        full_name = "%s_%s" % (name, fn_prefix)
> 
>      for argname, argentry, optional, structured in parse_args(members):
>          if structured:
> @@ -97,7 +100,10 @@ if (!error_is_set(errp)) {
>  ''')
>      push_indent()
> 
> -    full_name = name if not field_prefix else "%s_%s" % (field_prefix, name)
> +    if not field_prefix:
> +        full_name = name
> +    else:
> +        full_name = "%s_%s" % (field_prefix, name)
> 
>      if len(field_prefix):
>          ret += mcgen('''
> @@ -283,12 +289,17 @@ void visit_type_%(name)s(Visitor *m, %(name)s ** obj, const char *name, Error **
>              name=name)
> 
>      pop_indent()
> +
> +    if not discriminator:
> +        desc_type = "type"
> +    else:
> +        desc_type = discriminator
>      ret += mcgen('''
>          visit_type_%(name)sKind(m, &(*obj)->kind, "%(type)s", &err);
>          if (!err) {
>              switch ((*obj)->kind) {
>  ''',
> -                 name=name, type="type" if not discriminator else discriminator)
> +                 name=name, type=desc_type)
> 
>      for key in members:
>          if not discriminator:
> -- 
> 1.8.3.1

      parent reply	other threads:[~2013-11-01 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31 20:26 [Qemu-devel] [PATCH] Adjust qapi-visit for python-2.4.3 Richard Henderson
2013-11-01 14:42 ` Luiz Capitulino
2013-11-01 17:02 ` Michael Roth [this message]

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=20131101170208.22021.84796@loki \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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.