Commit b0ea577a authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 344ce9e6
...@@ -598,7 +598,7 @@ static HRESULT IDirectMusicStyle8Impl_IPersistStream_ParsePartList (LPPERSISTSTR ...@@ -598,7 +598,7 @@ static HRESULT IDirectMusicStyle8Impl_IPersistStream_ParsePartList (LPPERSISTSTR
IStream_Read (pStm, &dwSize, sizeof(DWORD), NULL); IStream_Read (pStm, &dwSize, sizeof(DWORD), NULL);
cnt = (Chunk.dwSize - sizeof(DWORD)); cnt = (Chunk.dwSize - sizeof(DWORD));
TRACE_(dmfile)(" - dwSize: %u\n", dwSize); 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) { if (cnt % dwSize != 0) {
ERR("Invalid Array Size\n"); ERR("Invalid Array Size\n");
return E_FAIL; return E_FAIL;
...@@ -614,7 +614,7 @@ static HRESULT IDirectMusicStyle8Impl_IPersistStream_ParsePartList (LPPERSISTSTR ...@@ -614,7 +614,7 @@ static HRESULT IDirectMusicStyle8Impl_IPersistStream_ParsePartList (LPPERSISTSTR
IStream_Read (pStm, &dwSize, sizeof(DWORD), NULL); IStream_Read (pStm, &dwSize, sizeof(DWORD), NULL);
cnt = (Chunk.dwSize - sizeof(DWORD)); cnt = (Chunk.dwSize - sizeof(DWORD));
TRACE_(dmfile)(" - dwSize: %u\n", dwSize); 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) { if (cnt % dwSize != 0) {
ERR("Invalid Array Size\n"); ERR("Invalid Array Size\n");
return E_FAIL; return E_FAIL;
......
...@@ -520,8 +520,7 @@ LONG WINAPI ImmGetCompositionStringA( ...@@ -520,8 +520,7 @@ LONG WINAPI ImmGetCompositionStringA(
} }
else if (dwIndex == GCS_COMPSTR) else if (dwIndex == GCS_COMPSTR)
{ {
TRACE("GSC_COMPSTR %p %i\n",data->CompositionString, TRACE("GSC_COMPSTR %p %i\n", data->CompositionString, data->dwCompStringLength);
data->dwCompStringLength/ sizeof(WCHAR));
buf = HeapAlloc( GetProcessHeap(), 0, data->dwCompStringLength * 3 ); buf = HeapAlloc( GetProcessHeap(), 0, data->dwCompStringLength * 3 );
rc = WideCharToMultiByte(CP_ACP, 0,(LPWSTR)data->CompositionString, rc = WideCharToMultiByte(CP_ACP, 0,(LPWSTR)data->CompositionString,
...@@ -533,8 +532,7 @@ LONG WINAPI ImmGetCompositionStringA( ...@@ -533,8 +532,7 @@ LONG WINAPI ImmGetCompositionStringA(
} }
else if (dwIndex == GCS_COMPATTR) else if (dwIndex == GCS_COMPATTR)
{ {
TRACE("GSC_COMPATTR %p %i\n",data->CompositionString, TRACE("GSC_COMPATTR %p %i\n", data->CompositionString, data->dwCompStringLength);
data->dwCompStringLength/ sizeof(WCHAR));
rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)data->CompositionString, rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)data->CompositionString,
data->dwCompStringLength/ sizeof(WCHAR), NULL, data->dwCompStringLength/ sizeof(WCHAR), NULL,
...@@ -549,8 +547,7 @@ LONG WINAPI ImmGetCompositionStringA( ...@@ -549,8 +547,7 @@ LONG WINAPI ImmGetCompositionStringA(
} }
else if (dwIndex == GCS_COMPCLAUSE) else if (dwIndex == GCS_COMPCLAUSE)
{ {
TRACE("GSC_COMPCLAUSE %p %i\n",data->CompositionString, TRACE("GSC_COMPCLAUSE %p %i\n", data->CompositionString, data->dwCompStringLength);
data->dwCompStringLength/ sizeof(WCHAR));
rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)data->CompositionString, rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)data->CompositionString,
data->dwCompStringLength/ sizeof(WCHAR), NULL, data->dwCompStringLength/ sizeof(WCHAR), NULL,
......
...@@ -276,7 +276,7 @@ void COMPUTERNAME_Init (void) ...@@ -276,7 +276,7 @@ void COMPUTERNAME_Init (void)
} }
NtClose( hsubkey ); 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 ); RtlInitUnicodeString( &nameW, ActiveComputerNameW );
if ( ( st = NtCreateKey( &hsubkey, KEY_ALL_ACCESS, &attr, 0, NULL, REG_OPTION_VOLATILE, NULL ) ) if ( ( st = NtCreateKey( &hsubkey, KEY_ALL_ACCESS, &attr, 0, NULL, REG_OPTION_VOLATILE, NULL ) )
......
...@@ -1603,9 +1603,9 @@ static HRESULT PropertyStorage_WriteDictionaryToStream( ...@@ -1603,9 +1603,9 @@ static HRESULT PropertyStorage_WriteDictionaryToStream(
*sectionOffset += closure.bytesWritten; *sectionOffset += closure.bytesWritten;
if (closure.bytesWritten % sizeof(DWORD)) if (closure.bytesWritten % sizeof(DWORD))
{ {
TRACE("adding %d bytes of padding\n", sizeof(DWORD) - DWORD padding = sizeof(DWORD) - closure.bytesWritten % sizeof(DWORD);
closure.bytesWritten % sizeof(DWORD)); TRACE("adding %d bytes of padding\n", padding);
*sectionOffset += sizeof(DWORD) - closure.bytesWritten % sizeof(DWORD); *sectionOffset += padding;
} }
end: end:
...@@ -1744,9 +1744,9 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, ...@@ -1744,9 +1744,9 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
*sectionOffset += bytesWritten; *sectionOffset += bytesWritten;
if (bytesWritten % sizeof(DWORD)) if (bytesWritten % sizeof(DWORD))
{ {
TRACE("adding %d bytes of padding\n", sizeof(DWORD) - DWORD padding = sizeof(DWORD) - bytesWritten % sizeof(DWORD);
bytesWritten % sizeof(DWORD)); TRACE("adding %d bytes of padding\n", padding);
*sectionOffset += sizeof(DWORD) - bytesWritten % sizeof(DWORD); *sectionOffset += padding;
} }
} }
......
...@@ -954,9 +954,8 @@ static monitor_t * monitor_load(LPWSTR name, LPWSTR dllname) ...@@ -954,9 +954,8 @@ static monitor_t * monitor_load(LPWSTR name, LPWSTR dllname)
pm->monitorUI = pInitializePrintMonitorUI(); pm->monitorUI = pInitializePrintMonitorUI();
TRACE("%p: MONITORUI from %s,InitializePrintMonitorUI()\n", pm->monitorUI, debugstr_w(driver)); TRACE("%p: MONITORUI from %s,InitializePrintMonitorUI()\n", pm->monitorUI, debugstr_w(driver));
if (pm->monitorUI) { if (pm->monitorUI) {
TRACE( "0x%08x: dwMonitorSize (%d) => %d Functions\n", TRACE( "0x%08x: dwMonitorSize (%d)\n",
pm->monitorUI->dwMonitorUISize, pm->monitorUI->dwMonitorUISize, pm->monitorUI->dwMonitorUISize, pm->monitorUI->dwMonitorUISize );
(pm->monitorUI->dwMonitorUISize - sizeof(DWORD) ) / sizeof(VOID *));
} }
} }
...@@ -973,9 +972,7 @@ static monitor_t * monitor_load(LPWSTR name, LPWSTR dllname) ...@@ -973,9 +972,7 @@ static monitor_t * monitor_load(LPWSTR name, LPWSTR dllname)
} }
if (pm->monitor) { if (pm->monitor) {
TRACE( "0x%08x: dwMonitorSize (%d) => %d Functions\n", TRACE( "0x%08x: dwMonitorSize (%d)\n", pm->dwMonitorSize, pm->dwMonitorSize );
pm->dwMonitorSize, pm->dwMonitorSize,
(pm->dwMonitorSize) / sizeof(VOID *) );
} }
...@@ -5078,8 +5075,7 @@ DWORD WINAPI EnumPrinterDataExW(HANDLE hPrinter, LPCWSTR pKeyName, ...@@ -5078,8 +5075,7 @@ DWORD WINAPI EnumPrinterDataExW(HANDLE hPrinter, LPCWSTR pKeyName,
lpValueName = HeapAlloc (hHeap, 0, cbMaxValueNameLen * sizeof (WCHAR)); lpValueName = HeapAlloc (hHeap, 0, cbMaxValueNameLen * sizeof (WCHAR));
if (lpValueName == NULL) if (lpValueName == NULL)
{ {
ERR ("Failed to allocate %i bytes from process heap\n", ERR ("Failed to allocate %i WCHARs from process heap\n", cbMaxValueNameLen);
cbMaxValueNameLen * sizeof (WCHAR));
r = RegCloseKey (hkSubKey); r = RegCloseKey (hkSubKey);
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
WARN ("RegCloseKey returned %i\n", r); WARN ("RegCloseKey returned %i\n", r);
...@@ -5122,9 +5118,9 @@ DWORD WINAPI EnumPrinterDataExW(HANDLE hPrinter, LPCWSTR pKeyName, ...@@ -5122,9 +5118,9 @@ DWORD WINAPI EnumPrinterDataExW(HANDLE hPrinter, LPCWSTR pKeyName,
return ret; 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, debugstr_w (lpValueName), dwIndex,
(cbValueNameLen + 1) * sizeof (WCHAR), cbValueLen); cbValueNameLen + 1, cbValueLen);
cbBufSize += (cbValueNameLen + 1) * sizeof (WCHAR); cbBufSize += (cbValueNameLen + 1) * sizeof (WCHAR);
cbBufSize += cbValueLen; cbBufSize += cbValueLen;
...@@ -5265,7 +5261,7 @@ DWORD WINAPI EnumPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, ...@@ -5265,7 +5261,7 @@ DWORD WINAPI EnumPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName,
if (pKeyNameW == NULL) if (pKeyNameW == NULL)
{ {
ERR ("Failed to allocate %i bytes from process heap\n", ERR ("Failed to allocate %i bytes from process heap\n",
(LONG) len * sizeof (WCHAR)); (LONG)(len * sizeof (WCHAR)));
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment