[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/14] qlit: rename compare_litqobj_to_qobj
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 05/14] qlit: rename compare_litqobj_to_qobj |
Date: |
Fri, 25 Aug 2017 08:44:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Markus Armbruster <address@hidden> writes:
> Marc-André Lureau <address@hidden> writes:
>
>> Use qlit_ prefix.
>
> Let's spell it out:
>
> qlit: rename compare_litqobj_to_qobj() to qlit_equal_qobject()
>
> By the way, not only is your name shorter, it's also more precise:
> "compare" suggests -1, 0, +1 for less than, equal and greater than,
> equal suggests non-zero for equal, zero for unequal.
>
>> Signed-off-by: Marc-André Lureau <address@hidden>
>> ---
>> include/qapi/qmp/qlit.h | 2 +-
>> qobject/qlit.c | 6 +++---
>> tests/check-qjson.c | 14 +++++++-------
>> 3 files changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h
>> index 1e9696988a..e299e8fab0 100644
>> --- a/include/qapi/qmp/qlit.h
>> +++ b/include/qapi/qmp/qlit.h
>> @@ -44,6 +44,6 @@ struct QLitDictEntry {
>> #define QLIT_QLIST(val) \
>> { .type = QTYPE_QLIST, .value.qlist = (val) }
>>
>> -int compare_litqobj_to_qobj(QLitObject *lhs, QObject *rhs);
>> +int qlit_equal_qobject(QLitObject *lhs, QObject *rhs);
>>
>> #endif /* QLIT_H_ */
>
> Let's use this opportunity to change the return value to bool.
Maybe I should peek at the next patch once in a while. Nevermind!
> With those changes:
Scratch "those changes", just touch up the commit message a bit:
qlit: rename compare_litqobj_to_qobj() to qlit_equal_qobject()
compare_litqobj_to_qobj() lacks a qlit_ prefix. Moreover, "compare"
suggests -1, 0, +1 for less than, equal and greater than. The
function actually returns non-zero for equal, zero for unequal.
Rename to qlit_equal_qobject().
Its return type will be cleaned up in the next patch.
Can do on commit.
> Reviewed-by: Markus Armbruster <address@hidden>
- [Qemu-devel] [PATCH 01/14] qdict: add qdict_put_null() helper, (continued)
- [Qemu-devel] [PATCH 01/14] qdict: add qdict_put_null() helper, Marc-André Lureau, 2017/08/24
- [Qemu-devel] [PATCH 02/14] qlit: move qlit from check-qjson to qobject/, Marc-André Lureau, 2017/08/24
- [Qemu-devel] [PATCH 03/14] qlit: use QLit prefix consistently, Marc-André Lureau, 2017/08/24
- [Qemu-devel] [PATCH 04/14] qlit: remove needless type cast, Marc-André Lureau, 2017/08/24
- [Qemu-devel] [PATCH 05/14] qlit: rename compare_litqobj_to_qobj, Marc-André Lureau, 2017/08/24
- [Qemu-devel] [PATCH 06/14] qlit: make qlit_equal_qobject return a bool, Marc-André Lureau, 2017/08/24
- [Qemu-devel] [PATCH 08/14] qlit: add QLIT_QNULL and QLIT_BOOL, Marc-André Lureau, 2017/08/24
- [Qemu-devel] [PATCH 07/14] qlit: make qlit_equal_qobject() take const arguments, Marc-André Lureau, 2017/08/24
- [Qemu-devel] [PATCH 09/14] qlit: replace assert(qnum_get_try_int), Marc-André Lureau, 2017/08/24
- [Qemu-devel] [PATCH 11/14] qlit: improve QLit dict vs qdict comparison, Marc-André Lureau, 2017/08/24
- [Qemu-devel] [PATCH 10/14] tests: add qlit tests, Marc-André Lureau, 2017/08/24