[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 6/8] qlit: qlit_type() function
From: |
Eduardo Habkost |
Subject: |
Re: [PATCH v2 6/8] qlit: qlit_type() function |
Date: |
Thu, 19 Nov 2020 12:56:33 -0500 |
On Thu, Nov 19, 2020 at 11:41:05AM +0100, Markus Armbruster wrote:
> Eduardo Habkost <ehabkost@redhat.com> writes:
>
> > Useful function where we need to check for the qlit type before
> > converting it to an actual QObject.
> >
> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> > ---
> > include/qapi/qmp/qlit.h | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h
> > index f9e356d31e..acddb80831 100644
> > --- a/include/qapi/qmp/qlit.h
> > +++ b/include/qapi/qmp/qlit.h
> > @@ -59,4 +59,9 @@ bool qlit_equal_qobject(const QLitObject *lhs, const
> > QObject *rhs);
> >
> > QObject *qobject_from_qlit(const QLitObject *qlit);
> >
> > +static inline QType qlit_type(const QLitObject *qlit)
> > +{
> > + return qlit->type;
> > +}
> > +
> > #endif /* QLIT_H */
>
> Hiding qlit->type behind a function makes sense only when the structure
> of QLitObject is an implementation secret. It don't think it is.
I thought all QLitObject fields were considered private. If they
are not, I can happily get rid of that function.
--
Eduardo
- Re: [PATCH v2 4/8] qnum: qnum_value_is_equal() function, (continued)
[PATCH v2 7/8] qom: Make object_property_set_default() public, Eduardo Habkost, 2020/11/16
[PATCH v2 8/8] qom: Use qlit to represent property defaults, Eduardo Habkost, 2020/11/16
[PATCH v2 6/8] qlit: qlit_type() function, Eduardo Habkost, 2020/11/16
[PATCH v2 5/8] qlit: Support all types of QNums, Eduardo Habkost, 2020/11/16
Re: [PATCH v2 0/8] qom: Use qlit to represent property defaults, Markus Armbruster, 2020/11/19