[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] qapi: add struct strList and visit_type_strL
From: |
Amos Kong |
Subject: |
Re: [Qemu-devel] [PATCH v2] qapi: add struct strList and visit_type_strList() |
Date: |
Thu, 25 Apr 2013 00:48:55 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Apr 24, 2013 at 06:11:55PM +0200, Paolo Bonzini wrote:
> Il 24/04/2013 18:08, Amos Kong ha scritto:
> > diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
> > index 9e19920..e449a14 100644
> > --- a/scripts/qapi-types.py
> > +++ b/scripts/qapi-types.py
> > @@ -276,6 +276,7 @@ fdecl.write(mcgen('''
> > #include <stdbool.h>
> > #include <stdint.h>
> >
> > +struct strList;
> > ''',
> > guard=guardname(h_file)))
> >
> > diff --git a/scripts/qapi.py b/scripts/qapi.py
> > index afc5f32..14f9f4d 100644
> > --- a/scripts/qapi.py
> > +++ b/scripts/qapi.py
> > @@ -166,11 +166,11 @@ def c_fun(name, protect=True):
> > return c_var(name, protect).replace('.', '_')
> >
> > def c_list_type(name):
> > - return '%sList' % name
> > + return 'struct %sList' % name
> >
> > def type_name(name):
> > if type(name) == list:
> > - return c_list_type(name[0])
> > + return '%sList' % name[0]
> > return name
>
> This second change is needed to generate the correct function names,
> right? If so,
Yes, otherwise, the visit function name will be "visit_type_struct nameList".
> Reviewed-by: Paolo Bonzini <address@hidden>
>
> Paolo
Thanks
--
Amos.
- Re: [Qemu-devel] [qapi] Cannot use list of strings, (continued)