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

Christian Costa titan.costa at wanadoo.fr
Fri Apr 9 06:21:45 CDT 2010


> Message du 09/04/10 11:33
> De : "Alexandre Julliard" 
> A : "Christian Costa" 
> Copie à : wine-devel at winehq.org
> Objet : Re: [PATCH] d3dx9_36: Beginning of constants parsing + tests (based on work from Luis Busquets) (try 3) (resend)
> 
> 
> Christian Costa writes:
> 
> > @@ -650,6 +650,29 @@ HRESULT WINAPI D3DXCompileShader(LPCSTR pSrcData,
> > return D3DERR_INVALIDCALL;
> > }
> > 
> > +typedef struct ctab_constant ctab_constant;
> > +
> > +struct ctab_constant {
> > + D3DXCONSTANT_DESC desc;
> > + ctab_constant* members;
> > +};
> > +
> > +inline ctab_constant* get_constant(D3DXHANDLE ptr)
> > +{
> > + if (!ptr) return NULL;
> > + return (ctab_constant*)~((UINT_PTR)ptr);
> > +}
> > +
> > +inline D3DXHANDLE get_handle(ctab_constant* ptr)
> > +{
> > + return (D3DXHANDLE)~((UINT_PTR)ptr);
> > +}
> > +
> > +inline BOOL isstring(D3DXHANDLE ptr)
> > +{
> > + return !(((UINT_PTR)ptr) & (1 << (sizeof(UINT_PTR)*8-1)));
> > +}
> 
> This is broken, you can't make assumptions about the high bit of pointer
> values. The handle management needs more thought.
> 
> -- 
> Alexandre Julliard
> julliard at winehq.org
> 
> 

Does a 16-bit index would be suitable ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20100409/ae1c2408/attachment.htm>


More information about the wine-devel mailing list