From 1c66c611a118c1cfec5ee278ee117c5a6ddb27be Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 13 Jun 2006 14:10:39 +0200 Subject: [PATCH] kernel32: Don't use sizeof in traces to avoid printf format warnings. --- dlls/kernel/format_msg.c | 10 ++++------ dlls/kernel/toolhelp.c | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dlls/kernel/format_msg.c b/dlls/kernel/format_msg.c index 375c5da5713..26ffcec74b6 100644 --- a/dlls/kernel/format_msg.c +++ b/dlls/kernel/format_msg.c @@ -138,6 +138,7 @@ DWORD WINAPI FormatMessageA( va_list* _args ) { LPDWORD args=(LPDWORD)_args; + DWORD ret = 0; #if defined(__i386__) || defined(__sparc__) /* This implementation is completely dependent on the format of the va_list on x86 CPUs */ LPSTR target,t; @@ -331,13 +332,10 @@ DWORD WINAPI FormatMessageA( } HeapFree(GetProcessHeap(),0,target); HeapFree(GetProcessHeap(),0,from); - TRACE("-- returning %d\n", (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? strlen(*(LPSTR*)lpBuffer):strlen(lpBuffer)); - return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? - strlen(*(LPSTR*)lpBuffer): - strlen(lpBuffer); -#else - return 0; + ret = (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? strlen(*(LPSTR*)lpBuffer) : strlen(lpBuffer); #endif /* __i386__ */ + TRACE("-- returning %ld\n", ret); + return ret; } #undef ADD_TO_T diff --git a/dlls/kernel/toolhelp.c b/dlls/kernel/toolhelp.c index 47b63a391ea..2a3cba230fe 100644 --- a/dlls/kernel/toolhelp.c +++ b/dlls/kernel/toolhelp.c @@ -501,7 +501,7 @@ static BOOL module_nextW( HANDLE hSnapShot, LPMODULEENTRY32W lpme, BOOL first ) if (lpme->dwSize < sizeof (MODULEENTRY32W)) { SetLastError( ERROR_INSUFFICIENT_BUFFER ); - WARN("Result buffer too small (req: %d, was: %ld)\n", sizeof(MODULEENTRY32W), lpme->dwSize); + WARN("Result buffer too small (was: %ld)\n", lpme->dwSize); return FALSE; } if ((snap = MapViewOfFile( hSnapShot, FILE_MAP_ALL_ACCESS, 0, 0, 0 ))) @@ -553,7 +553,7 @@ static BOOL module_nextA( HANDLE handle, LPMODULEENTRY32 lpme, BOOL first ) if (lpme->dwSize < sizeof(MODULEENTRY32)) { SetLastError( ERROR_INSUFFICIENT_BUFFER ); - WARN("Result buffer too small (req: %d, was: %ld)\n", sizeof(MODULEENTRY32), lpme->dwSize); + WARN("Result buffer too small (was: %ld)\n", lpme->dwSize); return FALSE; }