Received: from eggs.gnu.org ([2001:4830:134:3::10]:43302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqfiL-0007Po-QF for qemu-devel@nongnu.org; Tue, 27 Feb 2018 08:54:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqfiK-0005Ly-TT for qemu-devel@nongnu.org; Tue, 27 Feb 2018 08:54:41 -0500 From: Alberto Garcia In-Reply-To: <20180224154033.29559-3-mreitz@redhat.com> References: <20180224154033.29559-1-mreitz@redhat.com> <20180224154033.29559-3-mreitz@redhat.com> Date: Tue, 27 Feb 2018 14:45:39 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v3 2/7] 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 , Michael Roth 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 Reviewed-by: Alberto Garcia Berto