Christian Costa titan.costa@wanadoo.fr 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.