From 934ed50d49b1f6e9ce81b4ca827a3c4330f4b8c3 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 13 Jan 2009 10:55:14 +0100 Subject: [PATCH] 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 6036f388e49..95dadafe87a 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 ef5ded25991..efd9115045a 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 a4f969ecb90..edf607c9120 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"); }