[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: [D3D9] Remove const qualifier on state_test data.
From: Ivan Gyurdiev <ivg231 () gmail ! com>
Date: 2006-09-30 2:42:02
Message-ID: 451DD97A.1090800 () gmail ! com
[Download RAW message or body]
Michael Stefaniuc wrote:
> Ivan Gyurdiev wrote:
>
>> Type: Cleanup
>>
>> Why:
>> The const qualifier is unnecessarily restrictive.
>> I intend to allocate and free such data on the heap in a future patch.
>> Instead, const should be primarily used on function parameters.
>>
> Question: do you realy have to use void pointers?
Yes.
> Void pointers are
> compatible with every pointer type and thus will disable the type
> checking of the compiler.
This is intentional - it's a form of polymorphism.
The data stored can be of many different types.
Each test knows what type of data it is using.
> Also you do not need to to cast a rvalue to
> void * if the type of the lvalue is void *.
>
Yes, you do...the type of the lvalue is void*, while the type of the
rvalue is const void*. Not casting produces a warning (correctly).
Casting replaces the compile-time guarantee that the value will be kept
constant by runtime contract [ because both const and non-const rvalue
will be used in the future ].
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic