From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkwFR-0000xY-9m for qemu-devel@nongnu.org; Fri, 07 Jun 2013 08:58:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkwFP-00084Q-LS for qemu-devel@nongnu.org; Fri, 07 Jun 2013 08:58:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53770 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkwFP-000843-FO for qemu-devel@nongnu.org; Fri, 07 Jun 2013 08:58:27 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 7 Jun 2013 14:58:09 +0200 Message-Id: <1370609900-21998-2-git-send-email-afaerber@suse.de> In-Reply-To: <1370609900-21998-1-git-send-email-afaerber@suse.de> References: <1370609900-21998-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 01/12] gus: QOM'ify some more List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Vassili Karpov (malc)" , =?UTF-8?q?Andreas=20F=C3=A4rber?= , anthony@codemonkey.ws Add type constant and cast macro. Signed-off-by: Andreas F=C3=A4rber --- hw/audio/gus.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/audio/gus.c b/hw/audio/gus.c index a91921c..e0aea26 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -46,6 +46,9 @@ #define IO_WRITE_PROTO(name) \ static void name (void *opaque, uint32_t nport, uint32_t val) =20 +#define TYPE_GUS "gus" +#define GUS(obj) OBJECT_CHECK (GUSState, (obj), TYPE_GUS) + typedef struct GUSState { ISADevice dev; GUSEmuState emu; @@ -250,7 +253,7 @@ static const MemoryRegionPortio gus_portio_list2[] =3D= { =20 static int gus_initfn (ISADevice *dev) { - GUSState *s =3D DO_UPCAST (GUSState, dev, dev); + GUSState *s =3D GUS (dev); struct audsettings as; =20 AUD_register_card ("gus", &s->card); @@ -295,7 +298,7 @@ static int gus_initfn (ISADevice *dev) =20 static int GUS_init (ISABus *bus) { - isa_create_simple (bus, "gus"); + isa_create_simple (bus, TYPE_GUS); return 0; } =20 @@ -318,7 +321,7 @@ static void gus_class_initfn (ObjectClass *klass, voi= d *data) } =20 static const TypeInfo gus_info =3D { - .name =3D "gus", + .name =3D TYPE_GUS, .parent =3D TYPE_ISA_DEVICE, .instance_size =3D sizeof (GUSState), .class_init =3D gus_class_initfn, --=20 1.8.1.4