[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense
From: |
Stefan Weil |
Subject: |
Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense |
Date: |
Mon, 24 Aug 2009 14:56:16 +0200 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20090707) |
Juan Quintela schrieb:
> Signed-off-by: Juan Quintela <address@hidden>
> ---
> 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
- [Qemu-devel] [PATCH 00/22] Indirection Cleanup, Juan Quintela, 2009/08/24
- [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense, Juan Quintela, 2009/08/24
- Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense,
Stefan Weil <=
- Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense, Markus Armbruster, 2009/08/24
- [Qemu-devel] Coding style, C++ compatible code (was Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense), Stefan Weil, 2009/08/26
- Re: [Qemu-devel] Coding style, C++ compatible code (was Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense), Gerd Hoffmann, 2009/08/26
- Re: [Qemu-devel] Coding style, C++ compatible code (was Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense), Jamie Lokier, 2009/08/26
- Re: [Qemu-devel] Coding style, C++ compatible code (was Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense), malc, 2009/08/26
- Re: [Qemu-devel] Coding style, C++ compatible code (was Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense), Jamie Lokier, 2009/08/26
- Re: [Qemu-devel] Coding style, C++ compatible code (was Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense), malc, 2009/08/26
- Re: [Qemu-devel] Coding style, C++ compatible code (was Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense), Jamie Lokier, 2009/08/26