From c9cc7e33ffaaf9b359d6bccf778e34d1b955a517 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 2 Mar 2006 18:03:32 +0100 Subject: [PATCH] Fixed some compiler warnings on old gcc versions. --- dlls/dxdiagn/container.c | 2 +- dlls/ole32/ole2.c | 2 +- dlls/ole32/oleobj.c | 2 +- dlls/riched20/editor.c | 2 +- dlls/riched20/tests/editor.c | 12 +++--------- dlls/shell32/tests/shlfolder.c | 2 +- include/ddk/wdm.h | 2 +- server/change.c | 2 +- 8 files changed, 10 insertions(+), 16 deletions(-) diff --git a/dlls/dxdiagn/container.c b/dlls/dxdiagn/container.c index aa15d1082e0..1810269018d 100644 --- a/dlls/dxdiagn/container.c +++ b/dlls/dxdiagn/container.c @@ -150,7 +150,7 @@ HRESULT WINAPI IDxDiagContainerImpl_GetChildContainer(PDXDIAGCONTAINER iface, LP hr = IDxDiagContainerImpl_GetChildContainerInternal(pContainer, tmp, &pContainer); if (!SUCCEEDED(hr) || NULL == pContainer) goto on_error; - *cur++; /* go after '.' (just replaced by \0) */ + cur++; /* go after '.' (just replaced by \0) */ tmp = cur; cur = strchrW(tmp, '.'); } diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index beb485e3c76..1c61ff9bbec 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -801,7 +801,7 @@ static HRESULT WINAPI EnumOLEVERB_Next( rgelt->grfAttribs = atolW(pwszAttribs); if (pceltFetched) - *pceltFetched++; + (*pceltFetched)++; This->index++; } return hr; diff --git a/dlls/ole32/oleobj.c b/dlls/ole32/oleobj.c index 78e1ebc0251..68cc8b89131 100644 --- a/dlls/ole32/oleobj.c +++ b/dlls/ole32/oleobj.c @@ -129,7 +129,7 @@ static HRESULT WINAPI EnumOleSTATDATA_Next( rgelt->dwConnection = This->index; if (pceltFetched) - *pceltFetched++; + (*pceltFetched)++; This->index++; } return hr; diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index a07f086bafb..506c7069f54 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2552,7 +2552,7 @@ int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar) int sel_min, sel_max; int car_pos = 0; int text_pos=-1; - int URLmin, URLmax; + int URLmin, URLmax = 0; CHARRANGE url; FINDTEXTA ft; CHARFORMAT2W cur_format; diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 8835f083bf5..95cf70555b5 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -621,15 +621,9 @@ static void test_EM_SCROLL() SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "a");/* one line of text */ expr = 0x00010000; for (i = 0; i < 4; i++) { - int cmd; - switch (i) { - case 0: cmd = SB_PAGEDOWN; break; - case 1: cmd = SB_PAGEUP; break; - case 2: cmd = SB_LINEDOWN; break; - case 3: cmd = SB_LINEUP; break; - } - - r = SendMessage(hwndRichEdit, EM_SCROLL, cmd, 0); + static const int cmd[4] = { SB_PAGEDOWN, SB_PAGEUP, SB_LINEDOWN, SB_LINEUP }; + + r = SendMessage(hwndRichEdit, EM_SCROLL, cmd[i], 0); y_after = SendMessage(hwndRichEdit, EM_GETFIRSTVISIBLELINE, 0, 0); ok(expr == r, "EM_SCROLL improper return value returned (i == %d). " "Got 0x%08x, expected 0x%08x\n", i, r, expr); diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index ce638e0926d..25bac9d099d 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -858,7 +858,7 @@ static void test_SHGetPathFromIDList(void) /* Test if we can get the path from the start menu "program files" PIDL. */ hShell32 = GetModuleHandleA("shell32"); - pSHGetSpecialFolderLocation = (HRESULT(WINAPI*)(HWND,int,LPITEMIDLIST*))GetProcAddress(hShell32, "SHGetSpecialFolderLocation"); + pSHGetSpecialFolderLocation = (void *)GetProcAddress(hShell32, "SHGetSpecialFolderLocation"); hr = pSHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidlPrograms); ok(SUCCEEDED(hr), "SHGetFolderLocation failed: 0x%08lx\n", hr); diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index b10a6f16e7d..7c5160c17e1 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -833,7 +833,7 @@ typedef struct _KUSER_SHARED_DATA { union { volatile KSYSTEM_TIME TickCount; volatile ULONG64 TickCountQuad; - }; + } DUMMYUNIONNAME; } KSHARED_USER_DATA, *PKSHARED_USER_DATA; NTSTATUS WINAPI ObCloseHandle(IN HANDLE handle); diff --git a/server/change.c b/server/change.c index cef1c3e57c6..4349d7e3876 100644 --- a/server/change.c +++ b/server/change.c @@ -942,7 +942,7 @@ static char *get_basename( const char *link ) while (1) { buffer = malloc( n ); - if (!buffer) break; + if (!buffer) return NULL; r = readlink( link, buffer, n ); if (r < 0)