All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-devel@nongnu.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH v3 10/19] qlit: Support all types of QNums
Date: Tue, 24 Nov 2020 10:55:22 +0100	[thread overview]
Message-ID: <87y2irnkol.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20201123194818.2773508-11-ehabkost@redhat.com> (Eduardo Habkost's message of "Mon, 23 Nov 2020 14:48:09 -0500")

Eduardo Habkost <ehabkost@redhat.com> writes:

> Add two new macros to support other types of QNums:
> QLIT_QNUM_UINT, and QLIT_QNUM_DOUBLE, and include them
> in the qlit_equal_qobject_test() test case.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes v2 -> v3:
> * QLIT_QNUM macro doesn't exist anymore
> * Addition of the QNumValue field to QLitObject is
>   now in a separate patch ("qlit: Use QNumValue to represent QNums")
> * check-qjson test case changes dropped.
>   Instead, I'm only extending the qlit_equal_qobject_test() test
>   case.
>
> Changes v1 -> v2:
> * Coding style fix at qlit_equal_qobject()
> ---
>  include/qapi/qmp/qlit.h | 4 ++++
>  tests/check-qlit.c      | 5 +++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h
> index a240cdd299..a2881b7f42 100644
> --- a/include/qapi/qmp/qlit.h
> +++ b/include/qapi/qmp/qlit.h
> @@ -42,6 +42,10 @@ struct QLitDictEntry {
>      { .type = QTYPE_QBOOL, .value.qbool = (val) }
>  #define QLIT_QNUM_INT(val) \
>      { .type = QTYPE_QNUM, .value.qnum = QNUM_VAL_INT(val) }
> +#define QLIT_QNUM_UINT(val) \
> +    { .type = QTYPE_QNUM, .value.qnum = QNUM_VAL_UINT(val) }
> +#define QLIT_QNUM_DOUBLE(val) \
> +    { .type = QTYPE_QNUM, .value.qnum = QNUM_VAL_DOUBLE(val) }
>  #define QLIT_QSTR(val) \
>      { .type = QTYPE_QSTRING, .value.qstr = (val) }
>  #define QLIT_QDICT(val) \
> diff --git a/tests/check-qlit.c b/tests/check-qlit.c
> index 5a9260b93f..31e90f8965 100644
> --- a/tests/check-qlit.c
> +++ b/tests/check-qlit.c
> @@ -58,6 +58,11 @@ static void qlit_equal_qobject_test(void)
>          QLIT_QNUM_INT(1),
>          QLIT_QNUM_INT(INT64_MIN),
>          QLIT_QNUM_INT(INT64_MAX),
> +        QLIT_QNUM_UINT(UINT64_MAX),
> +        /* Larger than UINT64_MAX: */
> +        QLIT_QNUM_DOUBLE(18446744073709552e3),
> +        /* Smaller than INT64_MIN: */
> +        QLIT_QNUM_DOUBLE(-92233720368547758e2),

Why "larger than UINT64_MAX" and "smaller than INT64_MIN"?

>          QLIT_QSTR(""),
>          QLIT_QSTR("foo"),
>          qlit,



  reply	other threads:[~2020-11-24  9:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 19:47 [PATCH v3 00/19] qom: Use qlit to represent property defaults Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 01/19] qnum: Make qnum_get_double() get const pointer Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 02/19] qnum: Make num_x/num_y variables at qnum_is_equal() const Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 03/19] qnum: QNumValue type for QNum value literals Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 04/19] qnum: qnum_value_is_equal() function Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 05/19] qlit: Use qnum_value_is_equal() when comparing QNums Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 06/19] qlit: Rename QLIT_QNUM to QLIT_QNUM_INT Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 07/19] qlit: Use QNumValue to represent QNums Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 08/19] qlit: Move qlit_equal_qobject() reference values to array Eduardo Habkost
2020-11-24  9:51   ` Markus Armbruster
2020-11-24 14:47     ` Eduardo Habkost
2020-11-24 15:17       ` Markus Armbruster
2020-11-23 19:48 ` [PATCH v3 09/19] qlit: Add more test literals to qlit_equal_qobject() test case Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 10/19] qlit: Support all types of QNums Eduardo Habkost
2020-11-24  9:55   ` Markus Armbruster [this message]
2020-11-24 10:56     ` Paolo Bonzini
2020-11-24 12:22       ` Markus Armbruster
2020-11-24 15:03         ` Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 11/19] qom: field_prop_set_default_value() helper Eduardo Habkost
2020-11-24  9:58   ` Markus Armbruster
2020-11-24 14:44     ` Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 12/19] qom: Replace defval value in Property with QLitObject Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 13/19] qom: Fix documentation of UUID property type Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 14/19] qom: Don't ignore defval on UUID property Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 15/19] qom: Make object_property_set_default() public Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 16/19] qom: Make PropertyInfo.set_default_value optional Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 17/19] qom: Delete field_prop_set_default_value_*int() Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 18/19] qom: Delete set_default_uuid() Eduardo Habkost
2020-11-23 19:48 ` [PATCH v3 19/19] qom: Delete set_default_value_bool() Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2irnkol.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.