d3dx9_36: Fix compiler warnings with flag -Wcast-qual.

This commit is contained in:
Mikhail Maroukhine 2010-03-27 15:55:51 +06:00 committed by Alexandre Julliard
parent 3d62b870a1
commit adf09ce66e
2 changed files with 5 additions and 5 deletions

View File

@ -117,7 +117,7 @@ HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *pfirstposition, DWORD n
for(i=0; i<numvertices; i++) 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 < pmin->x ) pmin->x = vec.x;
if ( vec.x > pmax->x ) pmax->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++) 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; temp = temp1;
} }
@ -160,7 +160,7 @@ HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWOR
for(i=0; i<numvertices; i++) 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; if ( d > *pradius ) *pradius = d;
} }
return D3D_OK; return D3D_OK;

View File

@ -608,7 +608,7 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD* byte_code,
HRESULT hr; HRESULT hr;
LPCVOID data; LPCVOID data;
UINT size; UINT size;
D3DXSHADER_CONSTANTTABLE* ctab_header; const D3DXSHADER_CONSTANTTABLE* ctab_header;
FIXME("(%p, %x, %p): semi-stub\n", byte_code, flags, constant_table); 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; object->size = size;
memcpy(object->ctab, data, object->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)) if (ctab_header->Size != sizeof(D3DXSHADER_CONSTANTTABLE))
goto error; goto error;
object->desc.Creator = ctab_header->Creator ? (LPCSTR)object->ctab + ctab_header->Creator : NULL; object->desc.Creator = ctab_header->Creator ? (LPCSTR)object->ctab + ctab_header->Creator : NULL;