Alexandre Julliard :
Avoid usage of sizeof in traces that causes warnings on MacOSX.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Oct 20 08:00:26 CDT 2006
Module: wine
Branch: master
Commit: b0ea577ae50574e09baa585c9e719810af705575
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b0ea577ae50574e09baa585c9e719810af705575
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Oct 20 12:16:45 2006 +0200
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 6bdcd72..0aaaa8c 100644
--- a/dlls/dmstyle/style.c
+++ b/dlls/dmstyle/style.c
@@ -598,7 +598,7 @@ static HRESULT IDirectMusicStyle8Impl_IP
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_IP
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 f975b2c..22cd75c 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 737da9d..4683f11 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 ec613b1..039d168 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -1603,9 +1603,9 @@ static HRESULT PropertyStorage_WriteDict
*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_WriteProp
*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 f8374fd..ced6498 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -954,9 +954,8 @@ static monitor_t * monitor_load(LPWSTR n
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 n
}
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 h
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 h
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 h
if (pKeyNameW == NULL)
{
ERR ("Failed to allocate %i bytes from process heap\n",
- (LONG) len * sizeof (WCHAR));
+ (LONG)(len * sizeof (WCHAR)));
return ERROR_OUTOFMEMORY;
}
More information about the wine-cvs
mailing list