Michael Stefaniuc : version: Remove superfluous pointer casts.

Alexandre Julliard julliard at winehq.org
Tue Jan 13 10:56:31 CST 2009


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Tue Jan 13 10:55:14 2009 +0100

version: Remove superfluous pointer casts.

---

 dlls/version/info.c       |   10 +++++-----
 dlls/version/resource.c   |    2 +-
 dlls/version/tests/info.c |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/version/info.c b/dlls/version/info.c
index 6036f38..95dadaf 100644
--- a/dlls/version/info.c
+++ b/dlls/version/info.c
@@ -547,7 +547,7 @@ BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle,
                                     DWORD datasize, LPVOID data )
 {
     DWORD len;
-    VS_VERSION_INFO_STRUCT32* vvis = (VS_VERSION_INFO_STRUCT32*)data;
+    VS_VERSION_INFO_STRUCT32* vvis = data;
 
     TRACE("(%s,%d,size=%d,data=%p)\n",
                 debugstr_w(filename), handle, datasize, data );
@@ -769,7 +769,7 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
 {
     static const char rootA[] = "\\";
     static const char varfileinfoA[] = "\\VarFileInfo\\Translation";
-    const VS_VERSION_INFO_STRUCT16 *info = (const VS_VERSION_INFO_STRUCT16 *)pBlock;
+    const VS_VERSION_INFO_STRUCT16 *info = pBlock;
 
     TRACE("(%p,%s,%p,%p)\n",
                 pBlock, debugstr_a(lpSubBlock), lplpBuffer, puLen );
@@ -806,7 +806,7 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
             LPSTR lpBufferA = (LPSTR)pBlock + info->wLength + 4;
             DWORD pos = (LPCSTR)*lplpBuffer - (LPCSTR)pBlock;
 
-            len = WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)*lplpBuffer, -1,
+            len = WideCharToMultiByte(CP_ACP, 0, *lplpBuffer, -1,
                                       lpBufferA + pos, info->wLength - pos, NULL, NULL);
             *lplpBuffer = lpBufferA + pos;
             *puLen = len;
@@ -828,7 +828,7 @@ BOOL WINAPI VerQueryValueW( LPCVOID pBlock, LPCWSTR lpSubBlock,
     static const WCHAR varfileinfoW[] = { '\\','V','a','r','F','i','l','e','I','n','f','o',
                                           '\\','T','r','a','n','s','l','a','t','i','o','n', 0 };
 
-    const VS_VERSION_INFO_STRUCT32 *info = (const VS_VERSION_INFO_STRUCT32 *)pBlock;
+    const VS_VERSION_INFO_STRUCT32 *info = pBlock;
 
     TRACE("(%p,%s,%p,%p)\n",
                 pBlock, debugstr_w(lpSubBlock), lplpBuffer, puLen );
@@ -866,7 +866,7 @@ BOOL WINAPI VerQueryValueW( LPCVOID pBlock, LPCWSTR lpSubBlock,
             DWORD pos = (LPCSTR)*lplpBuffer - (LPCSTR)pBlock;
             DWORD max = (info->wLength - sizeof(VS_FIXEDFILEINFO)) * 4 - info->wLength;
 
-            len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*lplpBuffer, -1,
+            len = MultiByteToWideChar(CP_ACP, 0, *lplpBuffer, -1,
                                       lpBufferW + pos, max/sizeof(WCHAR) - pos );
             *lplpBuffer = lpBufferW + pos;
             *puLen = len;
diff --git a/dlls/version/resource.c b/dlls/version/resource.c
index ef5ded2..efd9115 100644
--- a/dlls/version/resource.c
+++ b/dlls/version/resource.c
@@ -343,7 +343,7 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
     /* Find resource */
     resDir = resSection + (resDataDir->VirtualAddress - sections[i].VirtualAddress);
 
-    resPtr = (const IMAGE_RESOURCE_DIRECTORY*)resDir;
+    resPtr = resDir;
     resPtr = find_entry_by_name( resPtr, typeid, resDir );
     if ( !resPtr )
     {
diff --git a/dlls/version/tests/info.c b/dlls/version/tests/info.c
index a4f969e..edf607c 100644
--- a/dlls/version/tests/info.c
+++ b/dlls/version/tests/info.c
@@ -383,7 +383,7 @@ static void test_32bit_win(void)
 
     if (is_unicode_enabled)
     { 
-        VS_VERSION_INFO_STRUCT32 *vvis = (VS_VERSION_INFO_STRUCT32 *)pVersionInfoW;
+        VS_VERSION_INFO_STRUCT32 *vvis = pVersionInfoW;
         ok ( retvalW == ((vvis->wLength * 2) + 4) || retvalW == (vvis->wLength * 1.5),
              "Structure is not of the correct size\n");
     }




More information about the wine-cvs mailing list