From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtfeD-00081L-Lw for qemu-devel@nongnu.org; Sat, 16 May 2015 13:13:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtfeA-0004Qq-FN for qemu-devel@nongnu.org; Sat, 16 May 2015 13:13:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtfeA-0004Qa-8m for qemu-devel@nongnu.org; Sat, 16 May 2015 13:13:10 -0400 Message-ID: <55577AA3.3060107@redhat.com> Date: Sat, 16 May 2015 11:13:07 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431728700-18055-1-git-send-email-eblake@redhat.com> <1431728700-18055-2-git-send-email-eblake@redhat.com> <5557465F.4030108@suse.de> In-Reply-To: <5557465F.4030108@suse.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ua111FBsUuXcjhi6jJxcupoXLuVmWee3A" Subject: Re: [Qemu-devel] [PATCH 1/2] qobject: Use 'bool' for qbool List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , qemu-devel@nongnu.org Cc: kwolf@redhat.com, berto@igalia.com, mst@redhat.com, armbru@redhat.com, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ua111FBsUuXcjhi6jJxcupoXLuVmWee3A Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/16/2015 07:30 AM, Andreas F=C3=A4rber wrote: > Am 16.05.2015 um 00:24 schrieb Eric Blake: >> We require a C99 compiler, so let's use 'bool' instead of 'int' >> when dealing with boolean values. There are few enough clients >> to fix them all in one pass. >> >> Signed-off-by: Eric Blake >> --- >> /** >> - * qbool_from_int(): Create a new QBool from an int >> + * qbool_from_bool(): Create a new QBool from a bool >> * >> * Return strong reference. >=20 > Can you fix the syntax as follow-up please? >=20 > /** > * qbool_from_bool: > * @value: ... > * > * Desc... > * > * Returns: ... > */ Sure, I can do that over all the qboject files, as a new patch. >> @@ -662,7 +662,7 @@ static void check_native_list(QObject *qobj, >> tmp =3D qlist_peek(qlist); >> g_assert(tmp); >> qvalue =3D qobject_to_qbool(tmp); >> - g_assert_cmpint(qbool_get_int(qvalue), =3D=3D, (i % 3 =3D= =3D 0) ? 1 : 0); >> + g_assert_cmpint(qbool_get_bool(qvalue), =3D=3D, i % 3 =3D= =3D 0); >> qobject_decref(qlist_pop(qlist)); >> } >> break; > [snip] >=20 > I notice that we're inconsistent in using g_assert() vs. > g_assert_cmpint(). Given that GLib has a weird GBoolean, should we add = a > macro qtest_assert_cmpbool() instead as follow-up? We aren't even touching GBoolean (qbool_get_bool now returns 'bool', not GBoolean; and bool promotes just fine to int under C rules), so I don't see the point to making any further changes here. Or are you proposing that the new macro would do something like 'expecting "true" but got "false"' instead of g_assert_cmpint() collapsing things to 0 and 1? >=20 > That said, >=20 > Reviewed-by: Andreas F=C3=A4rber >=20 > Regards, > Andreas >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ua111FBsUuXcjhi6jJxcupoXLuVmWee3A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVV3qjAAoJEKeha0olJ0NqgSoH/Ruf6z0+xj/lmO3X5ofFppim RnTwRRA/9yzSXLF89zk2s5U7FvZ/YJu0Ij1FFVtuBBbmPofyoDxZepPIjWHI7uTz QdyMbAcrxCERDVGtq6/9H4/aqDN3nQYbLYAyPXPb2kSzkk3IzxHsZV3o8DwSZT09 ewbHHe7/6oe33n1sCNz/Pw+oB5oijJL7CdjOnBXcSJ0A82zNE0FI57cpZmVQrJ1P vAQqn2/tJX6uGgxkCdI4hnbCJlIXBG4WL8JJdyjf9PNd6S00EQU/XPWsY2Dc+zO2 owy8sTB7ky0jH5tMyst8cm1hYKG24SEE042Q2CWJV9KiaXEa3gIFw+xz6ZTJPHM= =Up/u -----END PGP SIGNATURE----- --ua111FBsUuXcjhi6jJxcupoXLuVmWee3A--