[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 2/7] qapi: Add qobject_to()
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [PATCH v3 2/7] qapi: Add qobject_to() |
Date: |
Tue, 27 Feb 2018 14:45:39 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Sat 24 Feb 2018 04:40:28 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 v3 0/7] block: Handle null backing link, Max Reitz, 2018/02/24
- [Qemu-devel] [PATCH v3 1/7] compiler: Add QEMU_BUILD_BUG_MSG() macro, Max Reitz, 2018/02/24
- [Qemu-devel] [PATCH v3 2/7] qapi: Add qobject_to(), Max Reitz, 2018/02/24
- [Qemu-devel] [PATCH v3 4/7] qapi: Remove qobject_to_X() functions, Max Reitz, 2018/02/24
- [Qemu-devel] [PATCH v3 6/7] block: Handle null backing link, Max Reitz, 2018/02/24
- [Qemu-devel] [PATCH v3 5/7] qapi: Make more of qobject_to(), Max Reitz, 2018/02/24
- [Qemu-devel] [PATCH v3 7/7] block: Deprecate "backing": "", Max Reitz, 2018/02/24
- [Qemu-devel] [PATCH v3 3/7] qapi: Replace qobject_to_X(o) by qobject_to(o, X), Max Reitz, 2018/02/24