[PATCH 4/5] d3dx9: Avoid CONST.

Henri Verbeet hverbeet at codeweavers.com
Fri Sep 20 03:41:46 CDT 2013


---
 dlls/d3dx9_36/effect.c  |    2 +-
 dlls/d3dx9_36/line.c    |   17 ++++++------
 dlls/d3dx9_36/mesh.c    |   66 ++++++++++++++++++++---------------------------
 dlls/d3dx9_36/skin.c    |   15 ++++++-----
 dlls/d3dx9_36/sprite.c  |   20 +++++++-------
 dlls/d3dx9_36/surface.c |    6 ++---
 6 files changed, 59 insertions(+), 67 deletions(-)

diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index 4a3f3b0..0087aa3 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -788,7 +788,7 @@ static void get_vector(struct d3dx_parameter *param, D3DXVECTOR4 *vector)
     }
 }
 
-static void set_vector(struct d3dx_parameter *param, CONST D3DXVECTOR4 *vector)
+static void set_vector(struct d3dx_parameter *param, const D3DXVECTOR4 *vector)
 {
     UINT i;
 
diff --git a/dlls/d3dx9_36/line.c b/dlls/d3dx9_36/line.c
index 4b2e514..200b6e6 100644
--- a/dlls/d3dx9_36/line.c
+++ b/dlls/d3dx9_36/line.c
@@ -155,21 +155,20 @@ failed:
     return D3DXERR_INVALIDDATA;
 }
 
-static HRESULT WINAPI ID3DXLineImpl_Draw(ID3DXLine* iface, CONST D3DXVECTOR2* vertexlist, DWORD vertexlistcount, D3DCOLOR color)
+static HRESULT WINAPI ID3DXLineImpl_Draw(ID3DXLine *iface, const D3DXVECTOR2 *vertex_list,
+        DWORD vertex_list_count, D3DCOLOR color)
 {
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(%p, %u, %#x): stub\n", This, vertexlist, vertexlistcount, color);
+    FIXME("iface %p, vertex_list %p, vertex_list_count %u, color 0x%08x stub!\n",
+            iface, vertex_list, vertex_list_count, color);
 
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI ID3DXLineImpl_DrawTransform(ID3DXLine* iface, CONST D3DXVECTOR3* vertexlist, DWORD vertexlistcount,
-                                                  CONST D3DXMATRIX* transform, D3DCOLOR color)
+static HRESULT WINAPI ID3DXLineImpl_DrawTransform(ID3DXLine *iface, const D3DXVECTOR3 *vertex_list,
+        DWORD vertex_list_count, const D3DXMATRIX *transform, D3DCOLOR color)
 {
-    ID3DXLineImpl *This = impl_from_ID3DXLine(iface);
-
-    FIXME("(%p)->(%p, %u, %p, %#x): stub\n", This, vertexlist, vertexlistcount, transform, color);
+    FIXME("iface %p, vertex_list %p, vertex_list_count %u, transform %p, color 0x%08x stub!\n",
+            iface, vertex_list, vertex_list_count, transform, color);
 
     return E_NOTIMPL;
 }
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
index 34274d8..844d026 100644
--- a/dlls/d3dx9_36/mesh.c
+++ b/dlls/d3dx9_36/mesh.c
@@ -344,7 +344,7 @@ static INT simple_round(FLOAT value)
     return res;
 }
 
-static void convert_float4(BYTE *dst, CONST D3DXVECTOR4 *src, D3DDECLTYPE type_dst)
+static void convert_float4(BYTE *dst, const D3DXVECTOR4 *src, D3DDECLTYPE type_dst)
 {
     BOOL fixme_once = FALSE;
 
@@ -658,7 +658,7 @@ cleanup:
     return hr;
 }
 
-static BOOL declaration_equals(CONST D3DVERTEXELEMENT9 *declaration1, CONST D3DVERTEXELEMENT9 *declaration2)
+static BOOL declaration_equals(const D3DVERTEXELEMENT9 *declaration1, const D3DVERTEXELEMENT9 *declaration2)
 {
     UINT size1 = 0, size2 = 0;
 
@@ -875,7 +875,8 @@ struct edge_face_map
  * is at most one edge to face mapping, i.e. an edge can only belong to one
  * face.
  */
-static HRESULT init_edge_face_map(struct edge_face_map *edge_face_map, CONST DWORD *index_buffer, CONST DWORD *point_reps, CONST DWORD num_faces)
+static HRESULT init_edge_face_map(struct edge_face_map *edge_face_map, const DWORD *index_buffer,
+        const DWORD *point_reps, DWORD num_faces)
 {
     DWORD face, edge;
     DWORD i;
@@ -915,7 +916,7 @@ static HRESULT init_edge_face_map(struct edge_face_map *edge_face_map, CONST DWO
     return D3D_OK;
 }
 
-static DWORD find_adjacent_face(struct edge_face_map *edge_face_map, DWORD vertex1, DWORD vertex2, CONST DWORD num_faces)
+static DWORD find_adjacent_face(struct edge_face_map *edge_face_map, DWORD vertex1, DWORD vertex2, DWORD num_faces)
 {
     struct edge_face *edge_face_ptr;
 
@@ -945,9 +946,9 @@ static DWORD *generate_identity_point_reps(DWORD num_vertices)
         return id_point_reps;
 }
 
-static HRESULT WINAPI ID3DXMeshImpl_ConvertPointRepsToAdjacency(ID3DXMesh *iface, CONST DWORD *point_reps, DWORD *adjacency)
+static HRESULT WINAPI ID3DXMeshImpl_ConvertPointRepsToAdjacency(ID3DXMesh *iface,
+        const DWORD *point_reps, DWORD *adjacency)
 {
-    ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface);
     HRESULT hr;
     DWORD num_faces = iface->lpVtbl->GetNumFaces(iface);
     DWORD num_vertices = iface->lpVtbl->GetNumVertices(iface);
@@ -958,10 +959,10 @@ static HRESULT WINAPI ID3DXMeshImpl_ConvertPointRepsToAdjacency(ID3DXMesh *iface
     DWORD face;
     DWORD edge;
     struct edge_face_map edge_face_map = {0};
-    CONST DWORD *point_reps_ptr = NULL;
+    const DWORD *point_reps_ptr = NULL;
     DWORD *id_point_reps = NULL;
 
-    TRACE("(%p)->(%p,%p)\n", This, point_reps, adjacency);
+    TRACE("iface %p, point_reps %p, adjacency %p.\n", iface, point_reps, adjacency);
 
     if (!adjacency) return D3DERR_INVALIDCALL;
 
@@ -1046,9 +1047,8 @@ cleanup:
  * vertex 5 is replaced by vertex 3 then index 5 would contain 3. If no vertex
  * replaces it, then it contains the same number as the index itself, e.g.
  * index 5 would contain 5. */
-static HRESULT propagate_face_vertices(CONST DWORD *adjacency, DWORD *point_reps,
-                                    CONST DWORD *indices, DWORD *new_indices,
-                                    CONST DWORD face, CONST DWORD numfaces)
+static HRESULT propagate_face_vertices(const DWORD *adjacency, DWORD *point_reps,
+        const DWORD *indices, DWORD *new_indices, DWORD face, DWORD numfaces)
 {
     const unsigned int VERTS_PER_FACE = 3;
     DWORD edge, opp_edge;
@@ -1096,7 +1096,8 @@ static HRESULT propagate_face_vertices(CONST DWORD *adjacency, DWORD *point_reps
     return D3D_OK;
 }
 
-static HRESULT WINAPI ID3DXMeshImpl_ConvertAdjacencyToPointReps(ID3DXMesh *iface, CONST DWORD *adjacency, DWORD *point_reps)
+static HRESULT WINAPI ID3DXMeshImpl_ConvertAdjacencyToPointReps(ID3DXMesh *iface,
+        const DWORD *adjacency, DWORD *point_reps)
 {
     HRESULT hr;
     DWORD face;
@@ -1108,7 +1109,7 @@ static HRESULT WINAPI ID3DXMeshImpl_ConvertAdjacencyToPointReps(ID3DXMesh *iface
 
     ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface);
 
-    TRACE("(%p)->(%p,%p)\n", This, adjacency, point_reps);
+    TRACE("iface %p, adjacency %p, point_reps %p.\n", iface, adjacency, point_reps);
 
     if (!adjacency)
     {
@@ -1826,12 +1827,13 @@ cleanup:
     return hr;
 }
 
-static HRESULT WINAPI ID3DXMeshImpl_SetAttributeTable(ID3DXMesh *iface, CONST D3DXATTRIBUTERANGE *attrib_table, DWORD attrib_table_size)
+static HRESULT WINAPI ID3DXMeshImpl_SetAttributeTable(ID3DXMesh *iface,
+        const D3DXATTRIBUTERANGE *attrib_table, DWORD attrib_table_size)
 {
     ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface);
     D3DXATTRIBUTERANGE *new_table = NULL;
 
-    TRACE("(%p)->(%p,%u)\n", This, attrib_table, attrib_table_size);
+    TRACE("iface %p, attrib_table %p, attrib_table_size %u.\n", iface, attrib_table, attrib_table_size);
 
     if (attrib_table_size) {
         size_t size = attrib_table_size * sizeof(*attrib_table);
@@ -1887,10 +1889,6 @@ static const struct ID3DXMeshVtbl D3DXMesh_Vtbl =
     ID3DXMeshImpl_SetAttributeTable
 };
 
-/*************************************************************************
- * D3DXBoxBoundProbe
- */
-BOOL WINAPI D3DXBoxBoundProbe(CONST D3DXVECTOR3 *pmin, CONST D3DXVECTOR3 *pmax, CONST D3DXVECTOR3 *prayposition, CONST D3DXVECTOR3 *praydirection)
 
 /* Algorithm taken from the article: An Efficient and Robust Ray-Box Intersection Algorithm
 Amy Williams             University of Utah
@@ -1906,9 +1904,9 @@ This algorithm is free of patents or of copyrights, as confirmed by Peter Shirle
 
 Algorithm: Consider the box as the intersection of three slabs. Clip the ray
 against each slab, if there's anything left of the ray after we're
-done we've got an intersection of the ray with the box.
-*/
-
+done we've got an intersection of the ray with the box. */
+BOOL WINAPI D3DXBoxBoundProbe(const D3DXVECTOR3 *pmin, const D3DXVECTOR3 *pmax,
+        const D3DXVECTOR3 *prayposition, const D3DXVECTOR3 *praydirection)
 {
     FLOAT div, tmin, tmax, tymin, tymax, tzmin, tzmax;
 
@@ -1960,10 +1958,8 @@ done we've got an intersection of the ray with the box.
     return TRUE;
 }
 
-/*************************************************************************
- * D3DXComputeBoundingBox
- */
-HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pmin, D3DXVECTOR3 *pmax)
+HRESULT WINAPI D3DXComputeBoundingBox(const D3DXVECTOR3 *pfirstposition,
+        DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pmin, D3DXVECTOR3 *pmax)
 {
     D3DXVECTOR3 vec;
     unsigned int i;
@@ -1990,10 +1986,8 @@ HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *pfirstposition, DWORD n
     return D3D_OK;
 }
 
-/*************************************************************************
- * D3DXComputeBoundingSphere
- */
-HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pcenter, FLOAT *pradius)
+HRESULT WINAPI D3DXComputeBoundingSphere(const D3DXVECTOR3 *pfirstposition,
+        DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pcenter, float *pradius)
 {
     D3DXVECTOR3 temp;
     FLOAT d;
@@ -2367,10 +2361,8 @@ UINT WINAPI D3DXGetDeclLength(const D3DVERTEXELEMENT9 *decl)
     return element - decl;
 }
 
-/*************************************************************************
- * D3DXIntersectTri
- */
-BOOL WINAPI D3DXIntersectTri(CONST D3DXVECTOR3 *p0, CONST D3DXVECTOR3 *p1, CONST D3DXVECTOR3 *p2, CONST D3DXVECTOR3 *praypos, CONST D3DXVECTOR3 *praydir, FLOAT *pu, FLOAT *pv, FLOAT *pdist)
+BOOL WINAPI D3DXIntersectTri(const D3DXVECTOR3 *p0, const D3DXVECTOR3 *p1, const D3DXVECTOR3 *p2,
+        const D3DXVECTOR3 *praypos, const D3DXVECTOR3 *praydir, float *pu, float *pv, float *pdist)
 {
     D3DXMATRIX m;
     D3DXVECTOR4 vec;
@@ -2412,10 +2404,8 @@ BOOL WINAPI D3DXIntersectTri(CONST D3DXVECTOR3 *p0, CONST D3DXVECTOR3 *p1, CONST
     return FALSE;
 }
 
-/*************************************************************************
- * D3DXSphereBoundProbe
- */
-BOOL WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *pcenter, FLOAT radius, CONST D3DXVECTOR3 *prayposition, CONST D3DXVECTOR3 *praydirection)
+BOOL WINAPI D3DXSphereBoundProbe(const D3DXVECTOR3 *pcenter, float radius,
+        const D3DXVECTOR3 *prayposition, const D3DXVECTOR3 *praydirection)
 {
     D3DXVECTOR3 difference;
     FLOAT a, b, c, d;
diff --git a/dlls/d3dx9_36/skin.c b/dlls/d3dx9_36/skin.c
index dec8823..2c333f6 100644
--- a/dlls/d3dx9_36/skin.c
+++ b/dlls/d3dx9_36/skin.c
@@ -96,14 +96,16 @@ static ULONG WINAPI ID3DXSkinInfoImpl_Release(ID3DXSkinInfo *iface)
     return ref;
 }
 
-static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneInfluence(ID3DXSkinInfo *iface, DWORD bone_num, DWORD num_influences, CONST DWORD *vertices, CONST FLOAT *weights)
+static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneInfluence(ID3DXSkinInfo *iface,
+        DWORD bone_num, DWORD num_influences, const DWORD *vertices, const float *weights)
 {
     ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface);
     struct bone *bone;
     DWORD *new_vertices = NULL;
     FLOAT *new_weights = NULL;
 
-    TRACE("(%p, %u, %u, %p, %p)\n", This, bone_num, num_influences, vertices, weights);
+    TRACE("iface %p, bone_num %u, num_influences %u, vertices %p, weights %p.\n",
+            iface, bone_num, num_influences, vertices, weights);
 
     if (bone_num >= This->num_bones || !vertices || !weights)
         return D3DERR_INVALIDCALL;
@@ -272,11 +274,12 @@ static const char * WINAPI ID3DXSkinInfoImpl_GetBoneName(ID3DXSkinInfo *iface, D
     return This->bones[bone_idx].name;
 }
 
-static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneOffsetMatrix(ID3DXSkinInfo *iface, DWORD bone_num, CONST D3DXMATRIX *bone_transform)
+static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneOffsetMatrix(ID3DXSkinInfo *iface,
+        DWORD bone_num, const D3DXMATRIX *bone_transform)
 {
     ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface);
 
-    TRACE("(%p, %u, %p)\n", This, bone_num, bone_transform);
+    TRACE("iface %p, bone_num %u, bone_transform %p.\n", iface, bone_num, bone_transform);
 
     if (bone_num >= This->num_bones || !bone_transform)
         return D3DERR_INVALIDCALL;
@@ -329,13 +332,13 @@ static HRESULT WINAPI ID3DXSkinInfoImpl_SetFVF(ID3DXSkinInfo *iface, DWORD fvf)
     return iface->lpVtbl->SetDeclaration(iface, declaration);
 }
 
-static HRESULT WINAPI ID3DXSkinInfoImpl_SetDeclaration(ID3DXSkinInfo *iface, CONST D3DVERTEXELEMENT9 *declaration)
+static HRESULT WINAPI ID3DXSkinInfoImpl_SetDeclaration(ID3DXSkinInfo *iface, const D3DVERTEXELEMENT9 *declaration)
 {
     ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface);
     HRESULT hr;
     int count;
 
-    TRACE("(%p, %p)\n", This, declaration);
+    TRACE("iface %p, declaration %p.\n", iface, declaration);
 
     if (!declaration)
         return D3DERR_INVALIDCALL;
diff --git a/dlls/d3dx9_36/sprite.c b/dlls/d3dx9_36/sprite.c
index 1f7defb..030a082 100644
--- a/dlls/d3dx9_36/sprite.c
+++ b/dlls/d3dx9_36/sprite.c
@@ -144,11 +144,11 @@ static HRESULT WINAPI ID3DXSpriteImpl_GetTransform(ID3DXSprite *iface, D3DXMATRI
     return D3D_OK;
 }
 
-static HRESULT WINAPI ID3DXSpriteImpl_SetTransform(ID3DXSprite *iface, CONST D3DXMATRIX *transform)
+static HRESULT WINAPI ID3DXSpriteImpl_SetTransform(ID3DXSprite *iface, const D3DXMATRIX *transform)
 {
     ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface);
 
-    TRACE("(%p)->(%p)\n", This, transform);
+    TRACE("iface %p, transform %p.\n", iface, transform);
 
     if(transform==NULL) return D3DERR_INVALIDCALL;
     This->transform=*transform;
@@ -156,19 +156,19 @@ static HRESULT WINAPI ID3DXSpriteImpl_SetTransform(ID3DXSprite *iface, CONST D3D
     return D3D_OK;
 }
 
-static HRESULT WINAPI ID3DXSpriteImpl_SetWorldViewRH(ID3DXSprite *iface, CONST D3DXMATRIX *world,
-        CONST D3DXMATRIX *view)
+static HRESULT WINAPI ID3DXSpriteImpl_SetWorldViewRH(ID3DXSprite *iface,
+        const D3DXMATRIX *world, const D3DXMATRIX *view)
 {
-    ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface);
-    FIXME("(%p)->(%p, %p): stub\n", This, world, view);
+    FIXME("iface %p, world %p, view %p stub!\n", iface, world, view);
+
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI ID3DXSpriteImpl_SetWorldViewLH(ID3DXSprite *iface, CONST D3DXMATRIX *world,
-        CONST D3DXMATRIX *view)
+static HRESULT WINAPI ID3DXSpriteImpl_SetWorldViewLH(ID3DXSprite *iface,
+        const D3DXMATRIX *world, const D3DXMATRIX *view)
 {
-    ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface);
-    FIXME("(%p)->(%p, %p): stub\n", This, world, view);
+    FIXME("iface %p, world %p, view %p stub!\n", iface, world, view);
+
     return E_NOTIMPL;
 }
 
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index e1c2811..fbfff0f 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -1334,7 +1334,7 @@ static void init_argb_conversion_info(const struct pixel_format_desc *srcformat,
     }
 }
 
-static DWORD dword_from_bytes(CONST BYTE *src, UINT bytes_per_pixel)
+static DWORD dword_from_bytes(const BYTE *src, UINT bytes_per_pixel)
 {
     DWORD ret = 0;
     static BOOL fixme_once;
@@ -1367,7 +1367,7 @@ static void dword_to_bytes(BYTE *dst, DWORD dword, UINT bytes_per_pixel)
  * Extracts the relevant components from the source color and
  * drops the less significant bits if they aren't used by the destination format.
  */
-static void get_relevant_argb_components(CONST struct argb_conversion_info *info, CONST DWORD col, DWORD *out)
+static void get_relevant_argb_components(const struct argb_conversion_info *info, DWORD col, DWORD *out)
 {
     UINT i = 0;
     for(;i < 4;i++)
@@ -1381,7 +1381,7 @@ static void get_relevant_argb_components(CONST struct argb_conversion_info *info
  * Recombines the output of get_relevant_argb_components and converts
  * it to the destination format.
  */
-static DWORD make_argb_color(CONST struct argb_conversion_info *info, CONST DWORD *in)
+static DWORD make_argb_color(const struct argb_conversion_info *info, const DWORD *in)
 {
     UINT i;
     DWORD val = 0;
-- 
1.7.10.4




More information about the wine-patches mailing list