[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 02/22] eepro100: cast a void * makes no sense

From: Juan Quintela
Subject: [Qemu-devel] Re: [PATCH 02/22] eepro100: cast a void * makes no sense
Date: Mon, 24 Aug 2009 15:04:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Stefan Weil <address@hidden> wrote:
> Juan Quintela schrieb:
>>  static void nic_reset(void *opaque)
>>  {
>> -    EEPRO100State *s = (EEPRO100State *) opaque;
>> +    EEPRO100State *s = opaque;
>>      logout("%p\n", s);
>>      static int first;
>>      if (!first) {


> I wrote these type casts, and I think they make sense.

In C, they made no sense. they are a nop.
In qemu, they are not used almost anywhere.

> In C++ code, they are even mandatory.

This is no C++.

> I think the arguments why C++ requires this kind of
> type casts apply to C code (like in Qemu) as well.

And they are?  I don't see what they buy us.

> If it is possible with no or very litte efforts to write
> code which is C and C++ compatible, I prefer to do so.

If it is possible to have a consistent code base, with little effort,
I prefer to do so.

> So please don't apply this patch.

I think it should be applied (qemu sense), but you do eepro100 work, and
I don't do/plan to do more eepro100 work.

I guess it is your call.

Later, Juan.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]