Andrew Talbot : wined3d: Cast-qual warnings fix.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 27 07:09:44 CST 2006


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

Author: Andrew Talbot <Andrew.Talbot at talbotville.com>
Date:   Fri Nov 24 14:15:16 2006 +0000

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 7b19d63..862d56a 100644
--- a/dlls/wined3d/pixelshader.c
+++ b/dlls/wined3d/pixelshader.c
@@ -938,9 +938,12 @@ static HRESULT WINAPI IWineD3DPixelShade
 
     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 4dac214..f68a2fb 100644
--- a/dlls/wined3d/vertexshader.c
+++ b/dlls/wined3d/vertexshader.c
@@ -1214,9 +1214,12 @@ static HRESULT WINAPI IWineD3DVertexShad
 
     /* 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;
     }




More information about the wine-cvs mailing list