advapi32: Remove unneeded casts (1 of 2)

Andrew Talbot Andrew.Talbot at talbotville.com
Sun Jun 3 14:15:10 CDT 2007


I am relying, here, on the fact that HLOCAL and the few other handles that
are not affected by whether STRICT is defined are all pointers to void.
Please give feedback if rejecting this patch.

Thanks,

-- Andy.
---
Changelog:
    advapi32: Remove unneeded casts.

diff -urN a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c
--- a/dlls/advapi32/crypt.c	2007-05-06 14:21:48.000000000 +0100
+++ b/dlls/advapi32/crypt.c	2007-06-03 16:02:04.000000000 +0100
@@ -52,8 +52,8 @@
 
 static HWND crypt_hWindow;
 
-#define CRYPT_Alloc(size) ((LPVOID)LocalAlloc(LMEM_ZEROINIT, size))
-#define CRYPT_Free(buffer) (LocalFree((HLOCAL)buffer))
+#define CRYPT_Alloc(size)   LocalAlloc(LMEM_ZEROINIT, size)
+#define CRYPT_Free(buffer)  LocalFree(buffer)
 
 static inline PWSTR CRYPT_GetProvKeyName(PCWSTR pProvName)
 {
diff -urN a/dlls/advapi32/security.c b/dlls/advapi32/security.c
--- a/dlls/advapi32/security.c	2007-05-06 14:21:48.000000000 +0100
+++ b/dlls/advapi32/security.c	2007-06-03 15:25:00.000000000 +0100
@@ -3487,7 +3487,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (ParseStringSidToSid(StringSid, NULL, &cBytes))
     {
-        PSID pSid = *Sid = (PSID) LocalAlloc(0, cBytes);
+        PSID pSid = *Sid = LocalAlloc(0, cBytes);
 
         bret = ParseStringSidToSid(StringSid, pSid, &cBytes);
         if (!bret)



More information about the wine-patches mailing list