From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J2ii5-0006p8-8x for qemu-devel@nongnu.org; Thu, 13 Dec 2007 02:42:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J2ii1-0006ie-Ee for qemu-devel@nongnu.org; Thu, 13 Dec 2007 02:42:20 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2ii1-0006i0-1z for qemu-devel@nongnu.org; Thu, 13 Dec 2007 02:42:17 -0500 Received: from smtp7-g19.free.fr ([212.27.42.64]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J2ii0-0001dR-G2 for qemu-devel@nongnu.org; Thu, 13 Dec 2007 02:42:16 -0500 Received: from smtp7-g19.free.fr (localhost [127.0.0.1]) by smtp7-g19.free.fr (Postfix) with ESMTP id 5413F322803 for ; Thu, 13 Dec 2007 08:42:03 +0100 (CET) Received: from HPU (rob92-4-82-225-201-66.fbx.proxad.net [82.225.201.66]) by smtp7-g19.free.fr (Postfix) with ESMTP id DAE8E322836 for ; Thu, 13 Dec 2007 08:42:02 +0100 (CET) From: =?iso-8859-1?Q?Herv=E9_Poussineau?= Date: Thu, 13 Dec 2007 08:42:07 +0100 Message-ID: <000101c83d5b$aa1091b0$0f01a8c0@HPU> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0002_01C83D64.0BD4F9B0" Subject: [Qemu-devel] [PATCH] Fix compilation with Cygwin Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. ------=_NextPart_000_0002_01C83D64.0BD4F9B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Cygwin compiler doesn't seem to like variables/structure members which = are named "interface". This patch renames them to "type". Herv=E9 ------=_NextPart_000_0002_01C83D64.0BD4F9B0 Content-Type: application/octet-stream; name="cygwin_fix.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="cygwin_fix.diff" Index: sysemu.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/qemu/qemu/sysemu.h,v retrieving revision 1.2 diff -u -r1.2 sysemu.h --- sysemu.h 2 Dec 2007 04:51:08 -0000 1.2 +++ sysemu.h 13 Dec 2007 07:28:36 -0000 @@ -122,7 +122,7 @@ =20 typedef struct DriveInfo { BlockDriverState *bdrv; - BlockInterfaceType interface; + BlockInterfaceType type; int bus; int unit; } DriveInfo; @@ -134,8 +134,8 @@ int nb_drives; DriveInfo drives_table[MAX_DRIVES+1]; =20 -extern int drive_get_index(BlockInterfaceType interface, int bus, int = unit); -extern int drive_get_max_bus(BlockInterfaceType interface); +extern int drive_get_index(BlockInterfaceType type, int bus, int unit); +extern int drive_get_max_bus(BlockInterfaceType type); =20 /* serial ports */ =20 Index: vl.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/qemu/qemu/vl.c,v retrieving revision 1.379 diff -u -r1.379 vl.c --- vl.c 11 Dec 2007 23:23:51 -0000 1.379 +++ vl.c 13 Dec 2007 07:31:37 -0000 @@ -4811,14 +4811,14 @@ return nb_drives_opt++; } =20 -int drive_get_index(BlockInterfaceType interface, int bus, int unit) +int drive_get_index(BlockInterfaceType type, int bus, int unit) { int index; =20 /* seek interface, bus and unit */ =20 for (index =3D 0; index < nb_drives; index++) - if (drives_table[index].interface =3D=3D interface && + if (drives_table[index].type =3D=3D type && drives_table[index].bus =3D=3D bus && drives_table[index].unit =3D=3D unit) return index; @@ -4826,14 +4826,14 @@ return -1; } =20 -int drive_get_max_bus(BlockInterfaceType interface) +int drive_get_max_bus(BlockInterfaceType type) { int max_bus; int index; =20 max_bus =3D -1; for (index =3D 0; index < nb_drives; index++) { - if(drives_table[index].interface =3D=3D interface && + if(drives_table[index].type =3D=3D type && drives_table[index].bus > max_bus) max_bus =3D drives_table[index].bus; } @@ -4846,7 +4846,7 @@ char file[1024]; char devname[128]; const char *mediastr =3D ""; - BlockInterfaceType interface; + BlockInterfaceType type; enum { MEDIA_DISK, MEDIA_CDROM } media; int bus_id, unit_id; int cyls, heads, secs, translation; @@ -4875,11 +4875,11 @@ !strcmp(machine->name, "SS-600MP") || !strcmp(machine->name, "versatilepb") || !strcmp(machine->name, "versatileab")) { - interface =3D IF_SCSI; + type =3D IF_SCSI; max_devs =3D MAX_SCSI_DEVS; strcpy(devname, "scsi"); } else { - interface =3D IF_IDE; + type =3D IF_IDE; max_devs =3D MAX_IDE_DEVS; strcpy(devname, "ide"); } @@ -4906,22 +4906,22 @@ if (get_param_value(buf, sizeof(buf), "if", str)) { strncpy(devname, buf, sizeof(devname)); if (!strcmp(buf, "ide")) { - interface =3D IF_IDE; + type =3D IF_IDE; max_devs =3D MAX_IDE_DEVS; } else if (!strcmp(buf, "scsi")) { - interface =3D IF_SCSI; + type =3D IF_SCSI; max_devs =3D MAX_SCSI_DEVS; } else if (!strcmp(buf, "floppy")) { - interface =3D IF_FLOPPY; + type =3D IF_FLOPPY; max_devs =3D 0; } else if (!strcmp(buf, "pflash")) { - interface =3D IF_PFLASH; + type =3D IF_PFLASH; max_devs =3D 0; } else if (!strcmp(buf, "mtd")) { - interface =3D IF_MTD; + type =3D IF_MTD; max_devs =3D 0; } else if (!strcmp(buf, "sd")) { - interface =3D IF_SD; + type =3D IF_SD; max_devs =3D 0; } else { fprintf(stderr, "qemu: '%s' unsupported bus type '%s'\n", = str, buf); @@ -5036,7 +5036,7 @@ =20 if (unit_id =3D=3D -1) { unit_id =3D 0; - while (drive_get_index(interface, bus_id, unit_id) !=3D -1) { + while (drive_get_index(type, bus_id, unit_id) !=3D -1) { unit_id++; if (max_devs && unit_id >=3D max_devs) { unit_id -=3D max_devs; @@ -5057,23 +5057,23 @@ * ignore multiple definitions */ =20 - if (drive_get_index(interface, bus_id, unit_id) !=3D -1) + if (drive_get_index(type, bus_id, unit_id) !=3D -1) return 0; =20 /* init */ =20 - if (interface =3D=3D IF_IDE || interface =3D=3D IF_SCSI) + if (type =3D=3D IF_IDE || type =3D=3D IF_SCSI) mediastr =3D (media =3D=3D MEDIA_CDROM) ? "-cd" : "-hd"; snprintf(buf, sizeof(buf), max_devs ? "%1$s%4$i%2$s%3$i" : = "%s%s%i", devname, mediastr, unit_id, bus_id); bdrv =3D bdrv_new(buf); drives_table[nb_drives].bdrv =3D bdrv; - drives_table[nb_drives].interface =3D interface; + drives_table[nb_drives].type =3D type; drives_table[nb_drives].bus =3D bus_id; drives_table[nb_drives].unit =3D unit_id; nb_drives++; =20 - switch(interface) { + switch(type) { case IF_IDE: case IF_SCSI: switch(media) { ------=_NextPart_000_0002_01C83D64.0BD4F9B0--