From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Me8Wl-0003A8-RV for qemu-devel@nongnu.org; Thu, 20 Aug 2009 10:22:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Me8Wh-00033U-TB for qemu-devel@nongnu.org; Thu, 20 Aug 2009 10:22:07 -0400 Received: from [199.232.76.173] (port=41722 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Me8Wh-00033A-OE for qemu-devel@nongnu.org; Thu, 20 Aug 2009 10:22:03 -0400 Received: from mail-ew0-f223.google.com ([209.85.219.223]:42083) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Me8Wh-0005tD-69 for qemu-devel@nongnu.org; Thu, 20 Aug 2009 10:22:03 -0400 Received: by ewy23 with SMTP id 23so5478498ewy.8 for ; Thu, 20 Aug 2009 07:22:01 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4A8D5C06.2040802@gnu.org> Date: Thu, 20 Aug 2009 16:21:58 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1250723280-3509-1-git-send-email-lcapitulino@redhat.com> <1250723280-3509-2-git-send-email-lcapitulino@redhat.com> <4A8D0AA6.3010807@gnu.org> <20090820111713.09bcc1c6@doriath> In-Reply-To: <20090820111713.09bcc1c6@doriath> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 01/29] Introduce QObject List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, avi@redhat.com On 08/20/2009 04:17 PM, Luiz Capitulino wrote: > On Thu, 20 Aug 2009 10:34:46 +0200 > Paolo Bonzini wrote: > >> >>> +/* High-level interface for qobject_incref() */ >>> +#define QINCREF(qtype) \ >>> +#define QDECREF(qtype) \ >> >> Why "qtype"? > > Why not? Because it's an object, not a type. :-) +typedef struct QType { + qtype_code code; + void (*destroy)(struct QObject *); +} QType; ... +/* Get the QObject part of a type */ +#define QOBJECT(obj) (&obj->base) + +/* High-level interface for qobject_incref() */ +#define QINCREF(qtype) \ + assert(qtype != NULL); \ + qobject_incref(QOBJECT(qtype)) Paolo