Henri Verbeet : wined3d: Remove some superfluous pointer casts.

Alexandre Julliard julliard at winehq.org
Tue Jan 20 08:27:42 CST 2009


Module: wine
Branch: master
Commit: 5d875906c1f164fed2538f8f18105ce6aa8136ed
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5d875906c1f164fed2538f8f18105ce6aa8136ed

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Jan 20 10:00:20 2009 +0100

wined3d: Remove some superfluous pointer casts.

---

 dlls/wined3d/drawprim.c    |   28 ++++++++++++++--------------
 dlls/wined3d/glsl_shader.c |    8 ++++----
 dlls/wined3d/utils.c       |    6 +++---
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index b78078f..929565f 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -324,8 +324,8 @@ static void drawStridedSlow(IWineD3DDevice *iface, const WineDirect3DVertexStrid
             idxData = ((IWineD3DIndexBufferImpl *) This->stateBlock->pIndexData)->resource.allocatedMemory;
         }
 
-        if (idxSize == 2) pIdxBufS = (const WORD *) idxData;
-        else pIdxBufL = (const DWORD *) idxData;
+        if (idxSize == 2) pIdxBufS = idxData;
+        else pIdxBufL = idxData;
     } else if (idxData) {
         ERR("non-NULL idxData with 0 idxSize, this should never happen\n");
         return;
@@ -519,16 +519,16 @@ static void drawStridedSlow(IWineD3DDevice *iface, const WineDirect3DVertexStrid
 static inline void send_attribute(IWineD3DDeviceImpl *This, const DWORD type, const UINT index, const void *ptr) {
     switch(type) {
         case WINED3DDECLTYPE_FLOAT1:
-            GL_EXTCALL(glVertexAttrib1fvARB(index, (const float *)ptr));
+            GL_EXTCALL(glVertexAttrib1fvARB(index, ptr));
             break;
         case WINED3DDECLTYPE_FLOAT2:
-            GL_EXTCALL(glVertexAttrib2fvARB(index, (const float *)ptr));
+            GL_EXTCALL(glVertexAttrib2fvARB(index, ptr));
             break;
         case WINED3DDECLTYPE_FLOAT3:
-            GL_EXTCALL(glVertexAttrib3fvARB(index, (const float *)ptr));
+            GL_EXTCALL(glVertexAttrib3fvARB(index, ptr));
             break;
         case WINED3DDECLTYPE_FLOAT4:
-            GL_EXTCALL(glVertexAttrib4fvARB(index, (const float *)ptr));
+            GL_EXTCALL(glVertexAttrib4fvARB(index, ptr));
             break;
 
         case WINED3DDECLTYPE_UBYTE4:
@@ -540,10 +540,10 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, const DWORD type, co
             break;
 
         case WINED3DDECLTYPE_SHORT2:
-            GL_EXTCALL(glVertexAttrib4svARB(index, (const GLshort *)ptr));
+            GL_EXTCALL(glVertexAttrib4svARB(index, ptr));
             break;
         case WINED3DDECLTYPE_SHORT4:
-            GL_EXTCALL(glVertexAttrib4svARB(index, (const GLshort *)ptr));
+            GL_EXTCALL(glVertexAttrib4svARB(index, ptr));
             break;
 
         case WINED3DDECLTYPE_SHORT2N:
@@ -559,10 +559,10 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, const DWORD type, co
             break;
         }
         case WINED3DDECLTYPE_SHORT4N:
-            GL_EXTCALL(glVertexAttrib4NsvARB(index, (const GLshort *)ptr));
+            GL_EXTCALL(glVertexAttrib4NsvARB(index, ptr));
             break;
         case WINED3DDECLTYPE_USHORT4N:
-            GL_EXTCALL(glVertexAttrib4NusvARB(index, (const GLushort *)ptr));
+            GL_EXTCALL(glVertexAttrib4NusvARB(index, ptr));
             break;
 
         case WINED3DDECLTYPE_UDEC3:
@@ -579,7 +579,7 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, const DWORD type, co
              * byte float according to the IEEE standard
              */
             if (GL_SUPPORT(NV_HALF_FLOAT)) {
-                GL_EXTCALL(glVertexAttrib2hvNV(index, (const GLhalfNV *)ptr));
+                GL_EXTCALL(glVertexAttrib2hvNV(index, ptr));
             } else {
                 float x = float_16_to_32(((const unsigned short *)ptr) + 0);
                 float y = float_16_to_32(((const unsigned short *)ptr) + 1);
@@ -588,7 +588,7 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, const DWORD type, co
             break;
         case WINED3DDECLTYPE_FLOAT16_4:
             if (GL_SUPPORT(NV_HALF_FLOAT)) {
-                GL_EXTCALL(glVertexAttrib4hvNV(index, (const GLhalfNV *)ptr));
+                GL_EXTCALL(glVertexAttrib4hvNV(index, ptr));
             } else {
                 float x = float_16_to_32(((const unsigned short *)ptr) + 0);
                 float y = float_16_to_32(((const unsigned short *)ptr) + 1);
@@ -626,8 +626,8 @@ static void drawStridedSlowVs(IWineD3DDevice *iface, const WineDirect3DVertexStr
             idxData = ((IWineD3DIndexBufferImpl *) stateblock->pIndexData)->resource.allocatedMemory;
         }
 
-        if (idxSize == 2) pIdxBufS = (const WORD *) idxData;
-        else pIdxBufL = (const DWORD *) idxData;
+        if (idxSize == 2) pIdxBufS = idxData;
+        else pIdxBufL = idxData;
     } else if (idxData) {
         ERR("non-NULL idxData with 0 idxSize, this should never happen\n");
         return;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 8dfb416..d1e1bae 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -471,7 +471,7 @@ static void shader_glsl_load_constantsB(IWineD3DBaseShaderImpl *This, const Wine
 
 static void reset_program_constant_version(void *value, void *context)
 {
-    struct glsl_shader_prog_link *entry = (struct glsl_shader_prog_link *)value;
+    struct glsl_shader_prog_link *entry = value;
     entry->constant_version = 0;
 }
 
@@ -3665,7 +3665,7 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
 
 static unsigned int glsl_program_key_hash(const void *key)
 {
-    const glsl_program_key_t *k = (const glsl_program_key_t *)key;
+    const glsl_program_key_t *k = key;
 
     unsigned int hash = k->vshader | ((DWORD_PTR) k->pshader) << 16;
     hash += ~(hash << 15);
@@ -3680,8 +3680,8 @@ static unsigned int glsl_program_key_hash(const void *key)
 
 static BOOL glsl_program_key_compare(const void *keya, const void *keyb)
 {
-    const glsl_program_key_t *ka = (const glsl_program_key_t *)keya;
-    const glsl_program_key_t *kb = (const glsl_program_key_t *)keyb;
+    const glsl_program_key_t *ka = keya;
+    const glsl_program_key_t *kb = keyb;
 
     return ka->vshader == kb->vshader && ka->pshader == kb->pshader &&
            (memcmp(&ka->ps_args, &kb->ps_args, sizeof(kb->ps_args)) == 0);
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index cc09584..3036ef2 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -2241,7 +2241,7 @@ void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
 
 unsigned int ffp_frag_program_key_hash(const void *key)
 {
-    const struct ffp_frag_settings *k = (const struct ffp_frag_settings *)key;
+    const struct ffp_frag_settings *k = key;
     unsigned int hash = 0, i;
     const DWORD *blob;
 
@@ -2268,8 +2268,8 @@ unsigned int ffp_frag_program_key_hash(const void *key)
 
 BOOL ffp_frag_program_key_compare(const void *keya, const void *keyb)
 {
-    const struct ffp_frag_settings *ka = (const struct ffp_frag_settings *)keya;
-    const struct ffp_frag_settings *kb = (const struct ffp_frag_settings *)keyb;
+    const struct ffp_frag_settings *ka = keya;
+    const struct ffp_frag_settings *kb = keyb;
 
     return memcmp(ka, kb, sizeof(*ka)) == 0;
 }




More information about the wine-cvs mailing list