Received: from eggs.gnu.org ([2001:4830:134:3::10]:39436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyCED-0007bo-Oa for qemu-devel@nongnu.org; Fri, 07 Sep 2018 04:34:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fyCEA-0000cs-CE for qemu-devel@nongnu.org; Fri, 07 Sep 2018 04:34:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40564 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fyCEA-0000bL-6I for qemu-devel@nongnu.org; Fri, 07 Sep 2018 04:34:54 -0400 References: <20180907075948.26917-1-marcandre.lureau@redhat.com> <20180907075948.26917-3-marcandre.lureau@redhat.com> From: Thomas Huth Message-ID: <929c4e4d-82e2-4b2f-ed20-8408121fc09a@redhat.com> Date: Fri, 7 Sep 2018 10:34:50 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 02/12] cutils: add qemu_pstrcmp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: Eduardo Habkost , Markus Armbruster , QEMU , Paolo Bonzini , Igor Mammedov , =?UTF-8?Q?Andreas_F=c3=a4rber?= , "Dr. David Alan Gilbert" On 2018-09-07 10:29, Marc-Andr=C3=A9 Lureau wrote: > Hi >=20 > On Fri, Sep 7, 2018 at 12:26 PM Thomas Huth wrote: >> >> On 2018-09-07 09:59, Marc-Andr=C3=A9 Lureau wrote: >>> A char** variant of strcmp(). >>> >>> Signed-off-by: Marc-Andr=C3=A9 Lureau >>> --- >>> include/qemu/cutils.h | 12 ++++++++++++ >>> util/cutils.c | 5 +++++ >>> 2 files changed, 17 insertions(+) >>> >>> diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h >>> index 47aaa3b0b9..0941639f36 100644 >>> --- a/include/qemu/cutils.h >>> +++ b/include/qemu/cutils.h >>> @@ -169,4 +169,16 @@ bool test_buffer_is_zero_next_accel(void); >>> int uleb128_encode_small(uint8_t *out, uint32_t n); >>> int uleb128_decode_small(const uint8_t *in, uint32_t *n); >>> >>> +/** >>> + * qemu_pstrcmp: >>> + * @str1: a pointer to a C string >>> + * @str2: a pointer to a C string >>> + * >>> + * Compares *str1 and *str2 with g_strcmp0(). >>> + * >>> + * Returns: an integer less than, equal to, or greater than zero, if >>> + * *str1 is <, =3D=3D or > than *str2 . >>> + */ >> >> Maybe add a comment that str1 or str2 can also be NULL? >=20 > *str1 or *str2 (not str1 or str2). ok Ah, right, that's what I meant. Maybe clarify both conditions in the comment ;-) Thomas