Received: from eggs.gnu.org ([2001:4830:134:3::10]:41991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eguqr-0007Eb-5R for qemu-devel@nongnu.org; Wed, 31 Jan 2018 11:03:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eguql-0005yC-Kd for qemu-devel@nongnu.org; Wed, 31 Jan 2018 11:03:09 -0500 From: Alberto Garcia In-Reply-To: <20180120154412.9990-2-mreitz@redhat.com> References: <20180120154412.9990-1-mreitz@redhat.com> <20180120154412.9990-2-mreitz@redhat.com> Date: Wed, 31 Jan 2018 17:02:52 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 1/6] qapi: Add qobject_to() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Markus Armbruster , Eric Blake , Kevin Wolf 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 Reviewed-by: Alberto Garcia Berto