kernel32: Cast-qual warnings fix (2 of 2)

Andrew Talbot Andrew.Talbot at talbotville.com
Tue Oct 31 16:11:08 CST 2006


Changelog:
    kernel32: Cast-qual warning fix.

diff -urN a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c
--- a/dlls/kernel32/profile.c	2006-10-31 21:58:02.000000000 +0000
+++ b/dlls/kernel32/profile.c	2006-10-31 21:58:26.000000000 +0000
@@ -1074,6 +1074,7 @@
 {
     int		ret;
     LPCWSTR	pDefVal = NULL;
+    LPWSTR	defval_tmp = NULL;
 
     TRACE("%s,%s,%s,%p,%u,%s\n", debugstr_w(section), debugstr_w(entry),
           debugstr_w(def_val), buffer, len, debugstr_w(filename));
@@ -1092,12 +1093,11 @@
 	if (*p == ' ') /* ouch, contained trailing ' ' */
 	{
 	    int len = (int)(p - def_val);
-            LPWSTR p;
 
-	    p = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
-	    memcpy(p, def_val, len * sizeof(WCHAR));
-	    p[len] = '\0';
-            pDefVal = p;
+	    defval_tmp = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
+	    memcpy(defval_tmp, def_val, len * sizeof(WCHAR));
+	    defval_tmp[len] = '\0';
+	    pDefVal = defval_tmp;
 	}
     }
     if (!pDefVal)
@@ -1121,7 +1121,7 @@
     RtlLeaveCriticalSection( &PROFILE_CritSect );
 
     if (pDefVal != def_val) /* allocated */
-	HeapFree(GetProcessHeap(), 0, (void*)pDefVal);
+	HeapFree(GetProcessHeap(), 0, defval_tmp);
 
     TRACE("returning %s, %d\n", debugstr_w(buffer), ret);
 



More information about the wine-patches mailing list