From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH] libxl: Introduce LIBXL_DOMAIN_TYPE_INVALID to make gcc happy Date: Wed, 23 May 2012 17:21:21 +0200 Message-ID: <1337786481.27368.96.camel@Solace> References: <4FB63171.3020102@amd.com> <4FB63EB6.10803@amd.com> <1337351445.16815.19.camel@Solace> <1337351979.22316.123.camel@zakaz.uk.xensource.com> <1337352492.16815.22.camel@Solace> <1337352958.22316.126.camel@zakaz.uk.xensource.com> <20412.49592.945171.764646@mariner.uk.xensource.com> <1337771858.27368.72.camel@Solace> <20412.55808.555103.132979@mariner.uk.xensource.com> <1337777350.27368.82.camel@Solace> <20412.62940.872712.975082@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5563905717985977639==" Return-path: In-Reply-To: <20412.62940.872712.975082@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Christoph Egger , Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============5563905717985977639== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-A/CBC/SdnUMT9NDZj/WI" --=-A/CBC/SdnUMT9NDZj/WI Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2012-05-23 at 15:36 +0100, Ian Jackson wrote: > > if isinstance(ty, idl.KeyedUnion): > > if parent is None: > > raise Exception("KeyedUnion type must have a parent") > > s +=3D "switch (%s) {\n" % (parent + ty.keyvar.name) > > for f in ty.fields: > > (nparent,fexpr) =3D ty.member(v, f, parent is None) > > s +=3D "case %s:\n" % f.enumname > > s +=3D libxl_C_type_dispose(f.type, fexpr, indent + " ",= nparent) > > s +=3D " break;\n" > > + s +=3D "default:\n break;\n"; > > s +=3D "}\n" > >=20 > > Would it make sense? >=20 > No, I don't think so. Surely the idl should contain an explicitly > empty structure ? >=20 Well, that would work either, of course. :-) Here's what I did, and it builds cleanly: diff -r 6dc80df50fa8 tools/libxl/libxl_types.idl --- a/tools/libxl/libxl_types.idl Tue May 22 16:30:11 2012 +0200 +++ b/tools/libxl/libxl_types.idl Wed May 23 17:19:52 2012 +0200 @@ -315,6 +316,7 @@ libxl_domain_build_info =3D Struct("domain # Use host's E820 for PCI passthroug= h. ("e820_host", libxl_defbool), ])), + ("invalid", Struct(None, [])), ], keyvar_init_val =3D "-1")), New patch coming in a separate thread. Thanks, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-A/CBC/SdnUMT9NDZj/WI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAk+9AHEACgkQk4XaBE3IOsRw0gCfQBYPrCwz5OlR1LW2TNUJ7/rn XvoAoJVO7sUYW3PpBr30GSRUmLNt5565 =7Hvc -----END PGP SIGNATURE----- --=-A/CBC/SdnUMT9NDZj/WI-- --===============5563905717985977639== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============5563905717985977639==--