[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 02/12] cutils: add qemu_pstrcmp
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH v2 02/12] cutils: add qemu_pstrcmp |
Date: |
Fri, 7 Sep 2018 10:25:45 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 2018-09-07 09:59, Marc-André Lureau wrote:
> A char** variant of strcmp().
>
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
> 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 <, == or > than *str2 .
> + */
Maybe add a comment that str1 or str2 can also be NULL?
Reviewed-by: Thomas Huth <address@hidden>
- [Qemu-devel] [PATCH v2 00/12] Various qemu command line options help improvements, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 03/12] qemu-option: add help fallback to print the list of options, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 04/12] qemu-option: improve qemu_opts_print_help() output, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 05/12] qom/object: fix iterating properties over a class, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 07/12] tests/qom-proplist: check duplicate "bv" property registration failed, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 06/12] qom/object: register 'type' property as class property, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 08/12] tests/qom-proplist: check properties are not listed multiple times, Marc-André Lureau, 2018/09/07
- [Qemu-devel] [PATCH v2 09/12] tests/qom-proplist: check class properties iterator, Marc-André Lureau, 2018/09/07