Avoid usage of sizeof in traces that causes warnings on MacOSX.

This commit is contained in:
Alexandre Julliard 2006-10-20 12:16:45 +02:00
parent 344ce9e69b
commit b0ea577ae5
5 changed files with 19 additions and 26 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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 ) )

View File

@ -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;
}
}

View File

@ -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;
}