Message ID | 20191029155436.14376-5-ian.jackson@eu.citrix.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [XEN,for-4.13,v2,1/4] tools/libxl: gentypes.py: Prefer init_val to init_fn | expand |
On Tue, Oct 29, 2019 at 03:54:36PM +0000, Ian Jackson wrote: > diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py > index 124285cd66..c74445f16e 100644 > --- a/tools/libxl/gentypes.py > +++ b/tools/libxl/gentypes.py > @@ -461,6 +461,10 @@ def libxl_C_type_parse_json(ty, w, v, indent = " ", parent = None, discrimina > s += " goto out;\n" > s += " }\n" > s += " for (i=0; (t=libxl__json_array_get(x,i)); i++) {\n" > + s += libxl_C_type_do_init(ty.elem_type, > + lambda(by): ("&" if by == idl.PASS_BY_REFERENCE else "")+ The syntax for using `lambda' is without "()" for the list of parameters. python3 complains about it. With that fix: Acked-by: Anthony PERARD <anthony.perard@citrix.com> > + ("%s[i]" % v), > + need_zero=False, indent=indent+" ") > s += libxl_C_type_parse_json(ty.elem_type, "t", v+"[i]", > indent + " ", parent) > s += " }\n" Thanks,
Anthony PERARD writes ("Re: [Xen-devel] [XEN PATCH for-4.13 v2 4/4] libxl: gentypes: initialise array elements in json"): > On Tue, Oct 29, 2019 at 03:54:36PM +0000, Ian Jackson wrote: > > + lambda(by): ("&" if by == idl.PASS_BY_REFERENCE else "")+ > > The syntax for using `lambda' is without "()" for the list of parameters. > python3 complains about it. Oh. Thanks. > With that fix: > Acked-by: Anthony PERARD <anthony.perard@citrix.com> Thanks, fixed and pushed. Ian.
diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py index 124285cd66..c74445f16e 100644 --- a/tools/libxl/gentypes.py +++ b/tools/libxl/gentypes.py @@ -461,6 +461,10 @@ def libxl_C_type_parse_json(ty, w, v, indent = " ", parent = None, discrimina s += " goto out;\n" s += " }\n" s += " for (i=0; (t=libxl__json_array_get(x,i)); i++) {\n" + s += libxl_C_type_do_init(ty.elem_type, + lambda(by): ("&" if by == idl.PASS_BY_REFERENCE else "")+ + ("%s[i]" % v), + need_zero=False, indent=indent+" ") s += libxl_C_type_parse_json(ty.elem_type, "t", v+"[i]", indent + " ", parent) s += " }\n"