From b0ea577ae50574e09baa585c9e719810af705575 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 20 Oct 2006 12:16:45 +0200 Subject: [PATCH] Avoid usage of sizeof in traces that causes warnings on MacOSX. --- dlls/dmstyle/style.c | 4 ++-- dlls/imm32/imm.c | 9 +++------ dlls/kernel32/computername.c | 2 +- dlls/ole32/stg_prop.c | 12 ++++++------ dlls/winspool.drv/info.c | 18 +++++++----------- 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index 6bdcd72ac64..0aaaa8c8c43 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -598,7 +598,7 @@ static HRESULT IDirectMusicStyle8Impl_IPersistStream_ParsePartList (LPPERSISTSTR IStream_Read (pStm, &dwSize, sizeof(DWORD), NULL); cnt = (Chunk.dwSize - sizeof(DWORD)); TRACE_(dmfile)(" - dwSize: %u\n", dwSize); - TRACE_(dmfile)(" - cnt: %u (%u / %u)\n", cnt / dwSize, (Chunk.dwSize - sizeof(DWORD)), dwSize); + TRACE_(dmfile)(" - cnt: %u (%u / %u)\n", cnt / dwSize, (DWORD)(Chunk.dwSize - sizeof(DWORD)), dwSize); if (cnt % dwSize != 0) { ERR("Invalid Array Size\n"); return E_FAIL; @@ -614,7 +614,7 @@ static HRESULT IDirectMusicStyle8Impl_IPersistStream_ParsePartList (LPPERSISTSTR IStream_Read (pStm, &dwSize, sizeof(DWORD), NULL); cnt = (Chunk.dwSize - sizeof(DWORD)); TRACE_(dmfile)(" - dwSize: %u\n", dwSize); - TRACE_(dmfile)(" - cnt: %u (%u / %u)\n", cnt / dwSize, (Chunk.dwSize - sizeof(DWORD)), dwSize); + TRACE_(dmfile)(" - cnt: %u (%u / %u)\n", cnt / dwSize, (DWORD)(Chunk.dwSize - sizeof(DWORD)), dwSize); if (cnt % dwSize != 0) { ERR("Invalid Array Size\n"); return E_FAIL; diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index f975b2c1fab..22cd75c7b71 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -520,8 +520,7 @@ LONG WINAPI ImmGetCompositionStringA( } else if (dwIndex == GCS_COMPSTR) { - TRACE("GSC_COMPSTR %p %i\n",data->CompositionString, - data->dwCompStringLength/ sizeof(WCHAR)); + TRACE("GSC_COMPSTR %p %i\n", data->CompositionString, data->dwCompStringLength); buf = HeapAlloc( GetProcessHeap(), 0, data->dwCompStringLength * 3 ); rc = WideCharToMultiByte(CP_ACP, 0,(LPWSTR)data->CompositionString, @@ -533,8 +532,7 @@ LONG WINAPI ImmGetCompositionStringA( } else if (dwIndex == GCS_COMPATTR) { - TRACE("GSC_COMPATTR %p %i\n",data->CompositionString, - data->dwCompStringLength/ sizeof(WCHAR)); + TRACE("GSC_COMPATTR %p %i\n", data->CompositionString, data->dwCompStringLength); rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)data->CompositionString, data->dwCompStringLength/ sizeof(WCHAR), NULL, @@ -549,8 +547,7 @@ LONG WINAPI ImmGetCompositionStringA( } else if (dwIndex == GCS_COMPCLAUSE) { - TRACE("GSC_COMPCLAUSE %p %i\n",data->CompositionString, - data->dwCompStringLength/ sizeof(WCHAR)); + TRACE("GSC_COMPCLAUSE %p %i\n", data->CompositionString, data->dwCompStringLength); rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)data->CompositionString, data->dwCompStringLength/ sizeof(WCHAR), NULL, diff --git a/dlls/kernel32/computername.c b/dlls/kernel32/computername.c index 737da9d6971..4683f1135ac 100644 --- a/dlls/kernel32/computername.c +++ b/dlls/kernel32/computername.c @@ -276,7 +276,7 @@ void COMPUTERNAME_Init (void) } NtClose( hsubkey ); - TRACE(" ComputerName: %s (%u)\n", debugstr_w ( computer_name ), len / sizeof(WCHAR)); + TRACE(" ComputerName: %s (%u)\n", debugstr_w (computer_name), len); RtlInitUnicodeString( &nameW, ActiveComputerNameW ); if ( ( st = NtCreateKey( &hsubkey, KEY_ALL_ACCESS, &attr, 0, NULL, REG_OPTION_VOLATILE, NULL ) ) diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index ec613b1bdb2..039d168e004 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1603,9 +1603,9 @@ static HRESULT PropertyStorage_WriteDictionaryToStream( *sectionOffset += closure.bytesWritten; if (closure.bytesWritten % sizeof(DWORD)) { - TRACE("adding %d bytes of padding\n", sizeof(DWORD) - - closure.bytesWritten % sizeof(DWORD)); - *sectionOffset += sizeof(DWORD) - closure.bytesWritten % sizeof(DWORD); + DWORD padding = sizeof(DWORD) - closure.bytesWritten % sizeof(DWORD); + TRACE("adding %d bytes of padding\n", padding); + *sectionOffset += padding; } end: @@ -1744,9 +1744,9 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, *sectionOffset += bytesWritten; if (bytesWritten % sizeof(DWORD)) { - TRACE("adding %d bytes of padding\n", sizeof(DWORD) - - bytesWritten % sizeof(DWORD)); - *sectionOffset += sizeof(DWORD) - bytesWritten % sizeof(DWORD); + DWORD padding = sizeof(DWORD) - bytesWritten % sizeof(DWORD); + TRACE("adding %d bytes of padding\n", padding); + *sectionOffset += padding; } } diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index f8374fd7c9c..ced64982204 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -954,9 +954,8 @@ static monitor_t * monitor_load(LPWSTR name, LPWSTR dllname) pm->monitorUI = pInitializePrintMonitorUI(); TRACE("%p: MONITORUI from %s,InitializePrintMonitorUI()\n", pm->monitorUI, debugstr_w(driver)); if (pm->monitorUI) { - TRACE( "0x%08x: dwMonitorSize (%d) => %d Functions\n", - pm->monitorUI->dwMonitorUISize, pm->monitorUI->dwMonitorUISize, - (pm->monitorUI->dwMonitorUISize - sizeof(DWORD) ) / sizeof(VOID *)); + TRACE( "0x%08x: dwMonitorSize (%d)\n", + pm->monitorUI->dwMonitorUISize, pm->monitorUI->dwMonitorUISize ); } } @@ -973,9 +972,7 @@ static monitor_t * monitor_load(LPWSTR name, LPWSTR dllname) } if (pm->monitor) { - TRACE( "0x%08x: dwMonitorSize (%d) => %d Functions\n", - pm->dwMonitorSize, pm->dwMonitorSize, - (pm->dwMonitorSize) / sizeof(VOID *) ); + TRACE( "0x%08x: dwMonitorSize (%d)\n", pm->dwMonitorSize, pm->dwMonitorSize ); } @@ -5078,8 +5075,7 @@ DWORD WINAPI EnumPrinterDataExW(HANDLE hPrinter, LPCWSTR pKeyName, lpValueName = HeapAlloc (hHeap, 0, cbMaxValueNameLen * sizeof (WCHAR)); if (lpValueName == NULL) { - ERR ("Failed to allocate %i bytes from process heap\n", - cbMaxValueNameLen * sizeof (WCHAR)); + ERR ("Failed to allocate %i WCHARs from process heap\n", cbMaxValueNameLen); r = RegCloseKey (hkSubKey); if (r != ERROR_SUCCESS) WARN ("RegCloseKey returned %i\n", r); @@ -5122,9 +5118,9 @@ DWORD WINAPI EnumPrinterDataExW(HANDLE hPrinter, LPCWSTR pKeyName, return ret; } - TRACE ("%s [%i]: name needs %i bytes, data needs %i bytes\n", + TRACE ("%s [%i]: name needs %i WCHARs, data needs %i bytes\n", debugstr_w (lpValueName), dwIndex, - (cbValueNameLen + 1) * sizeof (WCHAR), cbValueLen); + cbValueNameLen + 1, cbValueLen); cbBufSize += (cbValueNameLen + 1) * sizeof (WCHAR); cbBufSize += cbValueLen; @@ -5265,7 +5261,7 @@ DWORD WINAPI EnumPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, if (pKeyNameW == NULL) { ERR ("Failed to allocate %i bytes from process heap\n", - (LONG) len * sizeof (WCHAR)); + (LONG)(len * sizeof (WCHAR))); return ERROR_OUTOFMEMORY; } -- 2.11.4.GIT