From 92dc74016ad282516e86e0c3f39e6b80384ee350 Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Fri, 24 Nov 2006 14:15:16 +0000 Subject: [PATCH] wined3d: Cast-qual warnings fix. --- dlls/wined3d/pixelshader.c | 9 ++++++--- dlls/wined3d/vertexshader.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index 7b19d63e54b..862d56aaba5 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -938,9 +938,12 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i TRACE("(%p) : Copying the function\n", This); if (NULL != pFunction) { - This->baseShader.function = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->baseShader.functionLength); - if (!This->baseShader.function) return E_OUTOFMEMORY; - memcpy((void *)This->baseShader.function, pFunction, This->baseShader.functionLength); + void *function; + + function = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->baseShader.functionLength); + if (!function) return E_OUTOFMEMORY; + memcpy(function, pFunction, This->baseShader.functionLength); + This->baseShader.function = function; } else { This->baseShader.function = NULL; } diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c index 4dac214c518..f68a2fbd6ad 100644 --- a/dlls/wined3d/vertexshader.c +++ b/dlls/wined3d/vertexshader.c @@ -1214,9 +1214,12 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader /* copy the function ... because it will certainly be released by application */ if (NULL != pFunction) { - This->baseShader.function = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->baseShader.functionLength); - if (!This->baseShader.function) return E_OUTOFMEMORY; - memcpy((void *)This->baseShader.function, pFunction, This->baseShader.functionLength); + void *function; + + function = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->baseShader.functionLength); + if (!function) return E_OUTOFMEMORY; + memcpy(function, pFunction, This->baseShader.functionLength); + This->baseShader.function = function; } else { This->baseShader.function = NULL; }