[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/6] qapi: Add qobject_to()
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/6] qapi: Add qobject_to() |
Date: |
Wed, 31 Jan 2018 17:02:52 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Sat 20 Jan 2018 04:44:07 PM CET, Max Reitz wrote:
> This is a dynamic casting macro that, given a QObject type, returns an
> object as that type or NULL if the object is of a different type (or
> NULL itself).
>
> The macro uses lower-case letters because:
> 1. There does not seem to be a hard rule on whether qemu macros have to
> be upper-cased,
> 2. The current situation in qapi/qmp is inconsistent (compare e.g.
> QINCREF() vs. qdict_put()),
> 3. qobject_to() will evaluate its @obj parameter only once, thus it is
> generally not important to the caller whether it is a macro or not,
> 4. I prefer it aesthetically.
>
> Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Berto
- [Qemu-devel] [PATCH v2 0/6] block: Handle null backing link, Max Reitz, 2018/01/20
- [Qemu-devel] [PATCH v2 1/6] qapi: Add qobject_to(), Max Reitz, 2018/01/20
- [Qemu-devel] [PATCH v2 3/6] qapi: Remove qobject_to_X() functions, Max Reitz, 2018/01/20
- [Qemu-devel] [PATCH v2 4/6] qapi: Make more of qobject_to(), Max Reitz, 2018/01/20
- [Qemu-devel] [PATCH v2 6/6] block: Deprecate "backing": "", Max Reitz, 2018/01/20
- [Qemu-devel] [PATCH v2 5/6] block: Handle null backing link, Max Reitz, 2018/01/20
- [Qemu-devel] [PATCH v2 2/6] qapi: Replace qobject_to_X(o) by qobject_to(o, X), Max Reitz, 2018/01/20