From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfZ6G-0005M2-5d for qemu-devel@nongnu.org; Mon, 24 Aug 2009 08:56:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfZ6B-0005De-P2 for qemu-devel@nongnu.org; Mon, 24 Aug 2009 08:56:39 -0400 Received: from [199.232.76.173] (port=51383 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfZ6B-0005DR-Jb for qemu-devel@nongnu.org; Mon, 24 Aug 2009 08:56:35 -0400 Received: from moutng.kundenserver.de ([212.227.126.177]:53524) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfZ6A-00018h-TG for qemu-devel@nongnu.org; Mon, 24 Aug 2009 08:56:35 -0400 Message-ID: <4A928DF0.9000106@weilnetz.de> Date: Mon, 24 Aug 2009 14:56:16 +0200 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense References: <51486eb6860d1680c1bce45e310dcd3aae096f43.1251111439.git.quintela@redhat.com> In-Reply-To: <51486eb6860d1680c1bce45e310dcd3aae096f43.1251111439.git.quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org Juan Quintela schrieb: > Signed-off-by: Juan Quintela > --- > hw/eepro100.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/eepro100.c b/hw/eepro100.c > index 0031d36..09083c2 100644 > --- a/hw/eepro100.c > +++ b/hw/eepro100.c > @@ -507,7 +507,7 @@ static void nic_selective_reset(EEPRO100State * s) > > static void nic_reset(void *opaque) > { > - EEPRO100State *s = (EEPRO100State *) opaque; > + EEPRO100State *s = opaque; > logout("%p\n", s); > static int first; > if (!first) { > @@ -1544,7 +1544,7 @@ static ssize_t nic_receive(VLANClientState *vc, const uint8_t * buf, size_t size > > static int nic_load(QEMUFile * f, void *opaque, int version_id) > { > - EEPRO100State *s = (EEPRO100State *) opaque; > + EEPRO100State *s = opaque; > int i; > int ret; > > @@ -1634,7 +1634,7 @@ static int nic_load(QEMUFile * f, void *opaque, int version_id) > > static void nic_save(QEMUFile * f, void *opaque) > { > - EEPRO100State *s = (EEPRO100State *) opaque; > + EEPRO100State *s = opaque; > int i; > > if (s->pci_dev) > I wrote these type casts, and I think they make sense. In C++ code, they are even mandatory. I think the arguments why C++ requires this kind of type casts apply to C code (like in Qemu) as well. If it is possible with no or very litte efforts to write code which is C and C++ compatible, I prefer to do so. So please don't apply this patch. Regards Stefan Weil