Andrew Talbot : crypt32: Remove unneeded casts.

Alexandre Julliard julliard at winehq.org
Mon Dec 31 12:32:34 CST 2007


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

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Sun Dec 30 15:29:38 2007 +0000

crypt32: Remove unneeded casts.

---

 dlls/crypt32/cert.c        |    3 +--
 dlls/crypt32/protectdata.c |   15 +++++++--------
 dlls/crypt32/store.c       |    2 +-
 dlls/crypt32/str.c         |    2 +-
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c
index 97f9360..d747574 100644
--- a/dlls/crypt32/cert.c
+++ b/dlls/crypt32/cert.c
@@ -831,8 +831,7 @@ DWORD WINAPI CertGetPublicKeyLength(DWORD dwCertEncodingType,
 
         if (ret)
         {
-            RSAPUBKEY *rsaPubKey = (RSAPUBKEY *)((LPBYTE)buf +
-             sizeof(BLOBHEADER));
+            RSAPUBKEY *rsaPubKey = (RSAPUBKEY *)(buf + sizeof(BLOBHEADER));
 
             len = rsaPubKey->bitlen;
             LocalFree(buf);
diff --git a/dlls/crypt32/protectdata.c b/dlls/crypt32/protectdata.c
index d5ec287..d3e0034 100644
--- a/dlls/crypt32/protectdata.c
+++ b/dlls/crypt32/protectdata.c
@@ -331,7 +331,7 @@ BOOL serialize(const struct protect_data_t *pInfo, DATA_BLOB *pSerial)
     if (ptr - pSerial->pbData != dwStruct)
     {
         ERR("struct size changed!? %u != expected %u\n",
-            ptr - pSerial->pbData, (unsigned int)dwStruct);
+            ptr - pSerial->pbData, dwStruct);
         LocalFree(pSerial->pbData);
         pSerial->pbData=NULL;
         pSerial->cbData=0;
@@ -476,8 +476,7 @@ BOOL unserialize(const DATA_BLOB *pSerial, struct protect_data_t *pInfo)
     {
         /* this is an impossible-to-reach test, but if the padding
          * issue is ever understood, this may become more useful */
-        ERR("loaded corrupt structure! (used %u expected %u)\n",
-                (unsigned int)index, (unsigned int)size);
+        ERR("loaded corrupt structure! (used %u expected %u)\n", index, size);
         status=FALSE;
     }
 
@@ -776,15 +775,15 @@ report(const DATA_BLOB* pDataIn, const DATA_BLOB* pOptionalEntropy,
     TRACE("pPromptStruct: %p\n", pPromptStruct);
     if (pPromptStruct)
     {
-        TRACE("  cbSize: 0x%x\n",(unsigned int)pPromptStruct->cbSize);
-        TRACE("  dwPromptFlags: 0x%x\n",(unsigned int)pPromptStruct->dwPromptFlags);
+        TRACE("  cbSize: 0x%x\n", pPromptStruct->cbSize);
+        TRACE("  dwPromptFlags: 0x%x\n", pPromptStruct->dwPromptFlags);
         TRACE("  hwndApp: %p\n", pPromptStruct->hwndApp);
         TRACE("  szPrompt: %p %s\n",
               pPromptStruct->szPrompt,
               pPromptStruct->szPrompt ? debugstr_w(pPromptStruct->szPrompt)
               : "");
     }
-    TRACE("dwFlags: 0x%04x\n",(unsigned int)dwFlags);
+    TRACE("dwFlags: 0x%04x\n", dwFlags);
     TRACE_DATA_BLOB(pDataIn);
     if (pOptionalEntropy)
     {
@@ -893,7 +892,7 @@ BOOL WINAPI CryptProtectData(DATA_BLOB* pDataIn,
         ERR("CryptEncrypt\n");
         goto free_hash;
     }
-    TRACE("required encrypted storage: %u\n",(unsigned int)dwLength);
+    TRACE("required encrypted storage: %u\n", dwLength);
 
     /* copy plain text into cipher area for CryptEncrypt call */
     protect_data.cipher.cbData=dwLength;
@@ -910,7 +909,7 @@ BOOL WINAPI CryptProtectData(DATA_BLOB* pDataIn,
     if (!CryptEncrypt(hKey, hHash, TRUE, 0, protect_data.cipher.pbData,
                       &dwLength, protect_data.cipher.cbData))
     {
-        ERR("CryptEncrypt %u\n",(unsigned int)GetLastError());
+        ERR("CryptEncrypt %u\n", GetLastError());
         goto free_hash;
     }
     protect_data.cipher.cbData=dwLength;
diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c
index 1158feb..37247a5 100644
--- a/dlls/crypt32/store.c
+++ b/dlls/crypt32/store.c
@@ -521,7 +521,7 @@ static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreA(HCRYPTPROV hCryptProv,
 
 static void WINAPI CRYPT_MsgCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
 {
-    HCRYPTMSG msg = (HCRYPTMSG)hCertStore;
+    HCRYPTMSG msg = hCertStore;
 
     TRACE("(%p, %08x)\n", msg, dwFlags);
     CryptMsgClose(msg);
diff --git a/dlls/crypt32/str.c b/dlls/crypt32/str.c
index 8e19dc8..699779f 100644
--- a/dlls/crypt32/str.c
+++ b/dlls/crypt32/str.c
@@ -622,7 +622,7 @@ static BOOL CRYPT_GetNextValueW(LPCWSTR str, DWORD dwFlags, LPCWSTR separators,
 
             while (*separators)
                 map[*separators++] = 1;
-            while (*str && (*str >= 0xff || !map[*(const unsigned short *)str]))
+            while (*str && (*str >= 0xff || !map[*str]))
                 str++;
             token->end = str;
         }




More information about the wine-cvs mailing list