From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 04 of 11] libxl: expand the libxl_{cpu, node}map API a bit Date: Thu, 31 May 2012 18:01:17 +0200 Message-ID: <1338480077.15014.71.camel@Solace> References: <2cc22366943347deab77.1338466269@Solace> <4FC79365.406@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0203714814488984634==" Return-path: In-Reply-To: <4FC79365.406@eu.citrix.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: George Dunlap Cc: Andre Przywara , Ian Campbell , Stefano Stabellini , Juergen Gross , Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============0203714814488984634== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-QtdiOw5xOF+yCNRwGcQy" --=-QtdiOw5xOF+yCNRwGcQy Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2012-05-31 at 16:51 +0100, George Dunlap wrote: > > +int libxl_map_is_full(struct libxl_map *map) > > +{ > > + int i; > > + > > + for (i =3D 0; i< map->size; i++) > > + if (map->map[i] !=3D (uint8_t)-1) > > + return -1; > > + return 0; > > +} > Why are you returning -1 and 0 for false and true, rather than 0 and 1? = =20 > None of the other libxl "_is_" functions (e.g., libxl_is_stubom()) do tha= t. >=20 Oh, well, it seemed natural to me as well for true to be 1, but that would have meant giving 0 a different meaning than 'everything is ok', and I didn't find relevant examples of it being done... Thanks for pointing this out, I'll change it. Thanks and Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-QtdiOw5xOF+yCNRwGcQy 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/Hlc0ACgkQk4XaBE3IOsQCfQCghEEixY7OeO38GPJPV5P5gS6X 5iwAnidJiUaVx+DK6OPNkGl0MA6ar4PY =w1DL -----END PGP SIGNATURE----- --=-QtdiOw5xOF+yCNRwGcQy-- --===============0203714814488984634== 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 --===============0203714814488984634==--