From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRrAM-0004wB-Np for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:24:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRrAH-0004vp-V6 for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:24:14 -0400 Received: from [199.232.76.173] (port=41646 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRrAH-0004vm-Rj for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:24:09 -0400 Received: from mail-fx0-f211.google.com ([209.85.220.211]:33554) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MRrAH-0008VP-4E for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:24:09 -0400 Received: by fxm7 with SMTP id 7so763642fxm.34 for ; Fri, 17 Jul 2009 10:24:08 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1247841685-18495-3-git-send-email-aliguori@us.ibm.com> References: <1247841685-18495-1-git-send-email-aliguori@us.ibm.com> <1247841685-18495-3-git-send-email-aliguori@us.ibm.com> From: Blue Swirl Date: Fri, 17 Jul 2009 20:23:48 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH 2/2] Introduce macro for defining qdev properties Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Gerd Hoffman , qemu-devel@nongnu.org, Paul Brook On Fri, Jul 17, 2009 at 5:41 PM, Anthony Liguori wrote= : > This patch introduces macros for defining qdev properties. =C2=A0The defa= ult macro > is clever enough to infer the type of the structure field and to automati= cally > generate a name for the property. =C2=A0Additional macros are provided th= at allow > infered values to be overridden along with a set of macros to define prop= erties > with default values. Maybe for sake of non-GCC compatibility we should use less clever but compatible macros, like QDEV_PROP_NAME_DEFVAL_I32 QDEV_PROP_NAME_DEFVAL_I64 QDEV_PROP_NAME_DEFVAL_PTR QDEV_PROP_NAME_DEFVAL_CHRDEV etc? For example, Sparse does not know about __builtin_choose_expr() and will probably complain.