wined3d: Remove some superfluous pointer casts.

This commit is contained in:
Henri Verbeet 2009-01-20 10:00:20 +01:00 committed by Alexandre Julliard
parent de58df0e8d
commit 5d875906c1
3 changed files with 21 additions and 21 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;
}