[PATCH 2/6] d3dx9_36: Beginning of constants parsing + tests (based on work from Luis Busquets) (try 2)

Christian Costa titan.costa at wanadoo.fr
Mon Apr 5 15:25:33 CDT 2010


Henri Verbeet a écrit :
> On 5 April 2010 20:28, Christian Costa <titan.costa at wanadoo.fr> wrote:
>   
>> +inline ctab_constant* get_constant(D3DXHANDLE ptr)
>> +{
>> +    if (!ptr) return NULL;
>> +    return (ctab_constant*)~(UINT)ptr;
>> +}
>> +
>> +inline D3DXHANDLE get_handle(ctab_constant* ptr)
>> +{
>> +    return (D3DXHANDLE)~((UINT)ptr);
>> +}
>>     
> How is that different? You'd have to cast to UINT_PTR to fit a 64-bit
> pointer in there, although of course that only works if D3DXHANDLE is
> also a 64-bit value on 64-bit Windows (didn't check).
>
>
>
>
>   
D3DXHANDLE maps to LPCSTR type so go for UINT_PTR.





More information about the wine-devel mailing list