qemu-devel
[Top][All Lists]
Advanced

[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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]