d3dx9_36: Fix compiler warnings with flag -Wcast-qual.
authorMikhail Maroukhine <mikolg@yandex.ru>
Sat, 27 Mar 2010 09:55:51 +0000 (15:55 +0600)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 29 Mar 2010 10:12:36 +0000 (12:12 +0200)
dlls/d3dx9_36/mesh.c
dlls/d3dx9_36/shader.c

index 91116b283411790ba310dfc5167c685e8d707e21..f90de85256a6212ad5ee6a69afa8635844260ed4 100644 (file)
@@ -117,7 +117,7 @@ HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *pfirstposition, DWORD n
 
     for(i=0; i<numvertices; i++)
     {
-        vec = *( (D3DXVECTOR3*)((char*)pfirstposition + dwstride * i) );
+        vec = *( (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i) );
 
         if ( vec.x < pmin->x ) pmin->x = vec.x;
         if ( vec.x > pmax->x ) pmax->x = vec.x;
@@ -152,7 +152,7 @@ HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWOR
 
     for(i=0; i<numvertices; i++)
     {
-        D3DXVec3Add(&temp1, &temp, (D3DXVECTOR3*)((char*)pfirstposition + dwstride * i));
+        D3DXVec3Add(&temp1, &temp, (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i));
         temp = temp1;
     }
 
@@ -160,7 +160,7 @@ HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWOR
 
     for(i=0; i<numvertices; i++)
     {
-        d = D3DXVec3Length(D3DXVec3Subtract(&temp, (D3DXVECTOR3*)((char*)pfirstposition + dwstride * i), pcenter));
+        d = D3DXVec3Length(D3DXVec3Subtract(&temp, (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i), pcenter));
         if ( d > *pradius ) *pradius = d;
     }
     return D3D_OK;
index 1b888a7d5b3a288509c7bf779fd6318ca18df1b8..ab570291c5c69ed774a81b0d4d14dc5a2238097a 100644 (file)
@@ -608,7 +608,7 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD* byte_code,
     HRESULT hr;
     LPCVOID data;
     UINT size;
-    D3DXSHADER_CONSTANTTABLE* ctab_header;
+    const D3DXSHADER_CONSTANTTABLE* ctab_header;
 
     FIXME("(%p, %x, %p): semi-stub\n", byte_code, flags, constant_table);
 
@@ -642,7 +642,7 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD* byte_code,
     object->size = size;
     memcpy(object->ctab, data, object->size);
 
-    ctab_header = (D3DXSHADER_CONSTANTTABLE*)data;
+    ctab_header = (const D3DXSHADER_CONSTANTTABLE*)data;
     if (ctab_header->Size != sizeof(D3DXSHADER_CONSTANTTABLE))
         goto error;
     object->desc.Creator = ctab_header->Creator ? (LPCSTR)object->ctab + ctab_header->Creator : NULL;