Marc-André Lureau <marcandre.lur...@redhat.com> writes:

> They are not considered constant expressions in C, producing an error
> when compiling a const QLit.

A const QLit?  Do you mean a non-const one?

> Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com>
> ---
>  include/qapi/qmp/qlit.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h
> index a4ad91321b..f1d6eed317 100644
> --- a/include/qapi/qmp/qlit.h
> +++ b/include/qapi/qmp/qlit.h
> @@ -36,13 +36,13 @@ struct QLitDictEntry {
>  };
>  
>  #define QLIT_QNUM(val) \
> -    (QLitObject){.type = QTYPE_QNUM, .value.qnum = (val)}
> +    { .type = QTYPE_QNUM, .value.qnum = (val) }
>  #define QLIT_QSTR(val) \
> -    (QLitObject){.type = QTYPE_QSTRING, .value.qstr = (val)}
> +    { .type = QTYPE_QSTRING, .value.qstr = (val) }
>  #define QLIT_QDICT(val) \
> -    (QLitObject){.type = QTYPE_QDICT, .value.qdict = (val)}
> +    { .type = QTYPE_QDICT, .value.qdict = (val) }
>  #define QLIT_QLIST(val) \
> -    (QLitObject){.type = QTYPE_QLIST, .value.qlist = (val)}
> +    { .type = QTYPE_QLIST, .value.qlist = (val) }
>  
>  int compare_litqobj_to_qobj(QLitObject *lhs, QObject *rhs);

Reply via email to