From 6a9222fc39050e1f594a924215426c610e154902 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 12 Oct 2006 14:58:25 +0200 Subject: [PATCH] Fixed some printf warnings caused by using sizeof. --- dlls/advapi32/service.c | 4 ++-- dlls/crypt32/tests/encode.c | 6 ++---- dlls/dmime/tempotrack.c | 2 +- dlls/shlwapi/tests/clist.c | 6 ++---- dlls/user/tests/class.c | 4 ++-- tools/winedump/pe.c | 1 - 6 files changed, 9 insertions(+), 14 deletions(-) diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index b1d80dcd9bb..24b209e4aa6 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -422,8 +422,8 @@ static BOOL service_handle_start(HANDLE pipe, service_data *service, DWORD count r = ReadFile(pipe, args, count*sizeof(WCHAR), &read, NULL); if (!r || count!=read/sizeof(WCHAR) || args[count-1]) { - ERR("pipe read failed r = %d count = %d/%d args[n-1]=%s\n", - r, count, read/sizeof(WCHAR), debugstr_wn(args, count)); + ERR("pipe read failed r = %d count = %d read = %d args[n-1]=%s\n", + r, count, read, debugstr_wn(args, count)); goto end; } diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 54d1222f80b..6a1801d6dbe 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -1830,8 +1830,7 @@ static void test_decodeBits(DWORD dwEncoding) CRYPT_BIT_BLOB *blob; ok(bufSize >= sizeof(CRYPT_BIT_BLOB) + bits[i].cbDecoded, - "Got unexpected size %d, expected >= %d\n", bufSize, - sizeof(CRYPT_BIT_BLOB) + bits[i].cbDecoded); + "Got unexpected size %d\n", bufSize); blob = (CRYPT_BIT_BLOB *)buf; ok(blob->cbData == bits[i].cbDecoded, "Got unexpected length %d, expected %d\n", blob->cbData, @@ -4081,8 +4080,7 @@ static void test_decodeCRLToBeSigned(DWORD dwEncoding) { CRL_INFO *info = (CRL_INFO *)buf; - ok(size >= sizeof(CRL_INFO), "Expected size at least %d, got %d\n", - sizeof(CRL_INFO), size); + ok(size >= sizeof(CRL_INFO), "Got size %d\n", size); ok(info->cCRLEntry == 209, "Expected 209 CRL entries, got %d\n", info->cCRLEntry); ok(info->cExtension == 0, "Expected 0 extensions, got %d\n", diff --git a/dlls/dmime/tempotrack.c b/dlls/dmime/tempotrack.c index 698cc882cb3..7a3589b1658 100644 --- a/dlls/dmime/tempotrack.c +++ b/dlls/dmime/tempotrack.c @@ -340,7 +340,7 @@ static HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_Load (LPPERSISTSTREA IStream_Read (pStm, &StreamSize, sizeof(DWORD), NULL); StreamSize -= sizeof(DWORD); StreamCount = 0; - TRACE_(dmfile)(" - sizeof(DMUS_IO_TEMPO_ITEM): %u (chunkSize = %u)\n", StreamSize, Chunk.dwSize - sizeof(DWORD)); + TRACE_(dmfile)(" - sizeof(DMUS_IO_TEMPO_ITEM): %u (chunkSize = %u)\n", StreamSize, Chunk.dwSize); do { IStream_Read (pStm, &item, sizeof(item), NULL); ++nItem; diff --git a/dlls/shlwapi/tests/clist.c b/dlls/shlwapi/tests/clist.c index c1a5f7c7f34..a4a55a10d41 100644 --- a/dlls/shlwapi/tests/clist.c +++ b/dlls/shlwapi/tests/clist.c @@ -312,8 +312,7 @@ static void test_CList(void) else if (inserted) { ok(inserted->ulSize==item->ulSize+sizeof(SHLWAPI_CLIST), - "id %d size wrong (%d!=%d)\n", inserted->ulId, inserted->ulSize, - item->ulSize+sizeof(SHLWAPI_CLIST)); + "id %d wrong size %d\n", inserted->ulId, inserted->ulSize); } if (inserted) { @@ -437,8 +436,7 @@ static void test_CList(void) else if (inserted) { ok(inserted->ulSize==item->ulSize+sizeof(SHLWAPI_CLIST), - "id %d size wrong (%d!=%d)\n", inserted->ulId, inserted->ulSize, - item->ulSize+sizeof(SHLWAPI_CLIST)); + "id %d wrong size %d\n", inserted->ulId, inserted->ulSize); } ok(!inserted || inserted->ulId==item->ulId, "find got wrong item\n"); if (inserted) diff --git a/dlls/user/tests/class.c b/dlls/user/tests/class.c index 109d45da476..385bb7b10c4 100644 --- a/dlls/user/tests/class.c +++ b/dlls/user/tests/class.c @@ -106,9 +106,9 @@ static void ClassTest(HINSTANCE hInstance, BOOL global) { SetLastError(0); ok(!SetClassLongW(hTestWnd,i*sizeof(DWORD),i+1), - "GetClassLongW(%d) initial value nonzero!\n",i*sizeof(DWORD)); + "GetClassLongW(%d) initial value nonzero!\n",i); ok(!GetLastError(), - "SetClassLongW(%d) failed!\n",i*sizeof(DWORD)); + "SetClassLongW(%d) failed!\n",i); } /* test values of valid classwords that we set */ diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index cf1c86450e7..dd7588c3141 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -208,7 +208,6 @@ static inline void print_datadirectory(DWORD n, const IMAGE_DATA_DIRECTORY *dire { unsigned i; printf("Data Directory\n"); - printf("%d\n", n * sizeof(IMAGE_DATA_DIRECTORY)); for (i = 0; i < n && i < 16; i++) {