<br /><blockquote style="padding-left: 5px; margin-left: 5px; border-left: 2px solid #ff0000">&gt; Message du 09/04/10 11:33<br />&gt; De : &quot;Alexandre Julliard&quot; <br />&gt; A : &quot;Christian Costa&quot; <br />&gt; Copie &agrave; : wine-devel@winehq.org<br />&gt; Objet : Re: [PATCH] d3dx9_36: Beginning of constants parsing + tests (based on work from Luis Busquets) (try 3) (resend)<br />&gt; <br />&gt; <br />&gt; Christian Costa  writes:<br />&gt; <br />&gt; &gt; @@ -650,6 +650,29 @@ HRESULT WINAPI D3DXCompileShader(LPCSTR pSrcData,<br />&gt; &gt;      return D3DERR_INVALIDCALL;<br />&gt; &gt;  }<br />&gt; &gt;  <br />&gt; &gt; +typedef struct ctab_constant ctab_constant;<br />&gt; &gt; +<br />&gt; &gt; +struct ctab_constant {<br />&gt; &gt; +    D3DXCONSTANT_DESC desc;<br />&gt; &gt; +    ctab_constant* members;<br />&gt; &gt; +};<br />&gt; &gt; +<br />&gt; &gt; +inline ctab_constant* get_constant(D3DXHANDLE ptr)<br />&gt; &gt; +{<br />&gt; &gt; +    if (!ptr) return NULL;<br />&gt; &gt; +    return (ctab_constant*)~((UINT_PTR)ptr);<br />&gt; &gt; +}<br />&gt; &gt; +<br />&gt; &gt; +inline D3DXHANDLE get_handle(ctab_constant* ptr)<br />&gt; &gt; +{<br />&gt; &gt; +    return (D3DXHANDLE)~((UINT_PTR)ptr);<br />&gt; &gt; +}<br />&gt; &gt; +<br />&gt; &gt; +inline BOOL isstring(D3DXHANDLE ptr)<br />&gt; &gt; +{<br />&gt; &gt; +    return !(((UINT_PTR)ptr) &amp; (1 &lt;&lt; (sizeof(UINT_PTR)*8-1)));<br />&gt; &gt; +}<br />&gt; <br />&gt; This is broken, you can't make assumptions about the high bit of pointer<br />&gt; values. The handle management needs more thought.<br />&gt; <br />&gt; -- <br />&gt; Alexandre Julliard<br />&gt; julliard@winehq.org<br />&gt; <br />&gt; <br /><br />Does a 16-bit index would be suitable ?<br /></blockquote>