Received: from eggs.gnu.org ([208.118.235.92]:33748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcmKc-0007gU-OF for qemu-devel@nongnu.org; Sun, 25 Nov 2012 19:13:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TcmKT-0000Hj-D0 for qemu-devel@nongnu.org; Sun, 25 Nov 2012 19:13:50 -0500 Received: from cantor2.suse.de ([195.135.220.15]:46227 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcmKT-0000Gq-65 for qemu-devel@nongnu.org; Sun, 25 Nov 2012 19:13:41 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 26 Nov 2012 01:12:28 +0100 Message-Id: <1353888766-6951-17-git-send-email-afaerber@suse.de> In-Reply-To: <1353888766-6951-1-git-send-email-afaerber@suse.de> References: <1353888766-6951-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] [RFC 16/34] ne2000-isa: QOM'ify List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , anthony@codemonkey.ws Introduce type constant and cast macro to obsolete DO_UPCAST(). Prepares for ISA realizefn. Signed-off-by: Andreas F=C3=A4rber --- hw/ne2000-isa.c | 12 ++++++++---- 1 Datei ge=C3=A4ndert, 8 Zeilen hinzugef=C3=BCgt(+), 4 Zeilen entfernt(-= ) diff --git a/hw/ne2000-isa.c b/hw/ne2000-isa.c index 69982a9..5aabe7c 100644 --- a/hw/ne2000-isa.c +++ b/hw/ne2000-isa.c @@ -29,8 +29,12 @@ #include "ne2000.h" #include "exec-memory.h" =20 +#define TYPE_ISA_NE2000 "ne2k_isa" +#define ISA_NE2000(obj) OBJECT_CHECK(ISANE2000State, (obj), TYPE_ISA_NE2= 000) + typedef struct ISANE2000State { - ISADevice dev; + ISADevice parent_obj; + uint32_t iobase; uint32_t isairq; NE2000State ne2000; @@ -64,7 +68,7 @@ static const VMStateDescription vmstate_isa_ne2000 =3D = { =20 static int isa_ne2000_initfn(ISADevice *dev) { - ISANE2000State *isa =3D DO_UPCAST(ISANE2000State, dev, dev); + ISANE2000State *isa =3D ISA_NE2000(dev); NE2000State *s =3D &isa->ne2000; =20 ne2000_setup_io(s, 0x20); @@ -97,8 +101,8 @@ static void isa_ne2000_class_initfn(ObjectClass *klass= , void *data) dc->props =3D ne2000_isa_properties; } =20 -static TypeInfo ne2000_isa_info =3D { - .name =3D "ne2k_isa", +static const TypeInfo ne2000_isa_info =3D { + .name =3D TYPE_ISA_NE2000, .parent =3D TYPE_ISA_DEVICE, .instance_size =3D sizeof(ISANE2000State), .class_init =3D isa_ne2000_class_initfn, --=20 1.7.10.4