From 9bda7700ff7698f262f3da2154ec86b435b45b76 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 31 May 2014 16:58:03 +0000 Subject: [PATCH] [SETUP16/EXPLORER/LIBTIFF/DESK/ADVAPI32/MCIWAVE/SAMSRV/SHELL32/WINMM/LIBMPG123] Fix / silence warnings svn path=/trunk/; revision=63518 --- reactos/base/applications/setup16/main.c | 28 ++++++++++--------- reactos/base/shell/explorer/shell/shellfs.cpp | 2 +- .../shell/explorer/taskbar/quicklaunch.cpp | 4 +-- reactos/dll/3rdparty/libtiff/CMakeLists.txt | 1 + reactos/dll/cpl/desk/screensaver.c | 2 ++ reactos/dll/win32/advapi32/misc/shutdown.c | 6 ++-- reactos/dll/win32/mciwave/mciwave.c | 6 ++-- reactos/dll/win32/samsrv/samrpc.c | 4 +++ reactos/dll/win32/shell32/desktop.cpp | 5 ++-- reactos/dll/win32/shell32/shlexec.cpp | 12 ++++---- reactos/dll/win32/winmm/CMakeLists.txt | 4 +++ reactos/lib/3rdparty/libmpg123/CMakeLists.txt | 4 +++ 12 files changed, 50 insertions(+), 28 deletions(-) diff --git a/reactos/base/applications/setup16/main.c b/reactos/base/applications/setup16/main.c index 8c0ffe29052..fa3581970e3 100644 --- a/reactos/base/applications/setup16/main.c +++ b/reactos/base/applications/setup16/main.c @@ -13,6 +13,8 @@ static UINT WINAPI ExtCabCallback(PVOID Context, UINT Notification, UINT_PTR Par FILE_IN_CABINET_INFO_W *pInfo; FILEPATHS_W *pFilePaths; + DBG_UNREFERENCED_LOCAL_VARIABLE(pFilePaths); + switch(Notification) { case SPFILENOTIFY_FILEINCABINET: @@ -31,7 +33,7 @@ BOOL DeleteDirectory(LPWSTR lpszDir) { SHFILEOPSTRUCT fileop; DWORD len = wcslen(lpszDir); - WCHAR *pszFrom = HeapAlloc(GetProcessHeap(), 0, (len + 2) * sizeof(WCHAR)); + WCHAR *pszFrom = HeapAlloc(GetProcessHeap(), 0, (len + 2) * sizeof(WCHAR)); int ret; wcscpy(pszFrom, lpszDir); @@ -80,26 +82,26 @@ int APIENTRY wWinMain(HINSTANCE hInstance, STARTUPINFO startupInfo; UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(nCmdShow); - + GetCurrentDirectory(MAX_PATH, szSetupPath); wcscat(szSetupPath, L"\\"); wcscpy(szFileName, szSetupPath); wcscat(szFileName, L"setup.lst"); - + if (GetFileAttributes(szFileName) == INVALID_FILE_ATTRIBUTES) { MessageBoxW(0, L"Cannot find Setup.lst file", L"Error", MB_OK | MB_ICONERROR); return 1; } - + /* read information from setup.lst */ GetPrivateProfileStringW(NT_PARAMS, L"CabinetFile", NULL, szCabFileName, MAX_PATH, szFileName); GetPrivateProfileStringW(NT_PARAMS, L"TmpDirName", NULL, szTempDirName, 50, szFileName); GetPrivateProfileStringW(NT_PARAMS, L"CmdLine", NULL, szCmdLine, MAX_PATH, szFileName); - + wcscpy(szCabFilePath, szSetupPath); wcscat(szCabFilePath, szCabFileName); - + /* ceate temp directory */ GetSystemDrive(szDrive); wcscpy(szTempPath, szDrive); @@ -107,16 +109,16 @@ int APIENTRY wWinMain(HINSTANCE hInstance, wcscpy(szFullTempPath, szTempPath); wcscat(szFullTempPath, szTempDirName); wcscat(szFullTempPath, L"\\"); - + if (SHCreateDirectoryEx(0, szFullTempPath, NULL) != ERROR_SUCCESS) { MessageBoxW(0, L"Could not create Temp Directory.", L"Error", MB_OK | MB_ICONERROR); return 1; - } + } dwAttrib = GetFileAttributes(szTempPath); SetFileAttributes(szTempPath, dwAttrib | FILE_ATTRIBUTE_HIDDEN); - + /* extract files */ if (!SetupIterateCabinetW(szCabFilePath, 0, ExtCabCallback, szFullTempPath)) { @@ -124,12 +126,12 @@ int APIENTRY wWinMain(HINSTANCE hInstance, DeleteDirectory(szTempPath); return 1; } - + /* prepare command line */ wsprintf(szTempCmdLine, szCmdLine, szFullTempPath, lpCmdLine); wcscpy(szCmdLine, szFullTempPath); wcscat(szCmdLine, szTempCmdLine); - + /* execute the 32-Bit installer */ ZeroMemory(&processInfo, sizeof(processInfo)); ZeroMemory(&startupInfo, sizeof(startupInfo)); @@ -148,10 +150,10 @@ int APIENTRY wWinMain(HINSTANCE hInstance, DeleteDirectory(szTempPath); return 1; } - + /* cleanup */ DeleteDirectory(szTempPath); - + return 0; } diff --git a/reactos/base/shell/explorer/shell/shellfs.cpp b/reactos/base/shell/explorer/shell/shellfs.cpp index d1115a2e27d..1243a0d0055 100644 --- a/reactos/base/shell/explorer/shell/shellfs.cpp +++ b/reactos/base/shell/explorer/shell/shellfs.cpp @@ -40,7 +40,7 @@ bool ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN IDataObject* pDataObj; STGMEDIUM medium = {0, {0}, 0}; - FORMATETC fmt = {g_Globals._cfStrFName, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; + FORMATETC fmt = {(USHORT)g_Globals._cfStrFName, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; HRESULT hr = _folder->GetUIObjectOf(0, 1, &pidl, IID_IDataObject, 0, (LPVOID*)&pDataObj); diff --git a/reactos/base/shell/explorer/taskbar/quicklaunch.cpp b/reactos/base/shell/explorer/taskbar/quicklaunch.cpp index 015dbd5d43a..fb9984d7890 100644 --- a/reactos/base/shell/explorer/taskbar/quicklaunch.cpp +++ b/reactos/base/shell/explorer/taskbar/quicklaunch.cpp @@ -184,7 +184,7 @@ void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, _entries[id] = qle; - TBBUTTON btn = {0, 0, flags, BTNS_BUTTON|BTNS_NOPREFIX, {0, 0}, 0, 0}; + TBBUTTON btn = {0, 0, (BYTE)flags, BTNS_BUTTON|BTNS_NOPREFIX, {0, 0}, 0, 0}; btn.idCommand = id; btn.iBitmap = bmp_idx; @@ -195,7 +195,7 @@ void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, void QuickLaunchBar::UpdateDesktopButtons(int desktop_idx) { for(int i=0; inUseCount++; - wmw->wInput = wmw->wOutput = WAVE_MAPPER; + wmw->wInput = wmw->wOutput = (WORD)WAVE_MAPPER; wmw->fInput = FALSE; wmw->hWave = 0; wmw->dwStatus = MCI_MODE_NOT_READY; @@ -1371,13 +1371,13 @@ static DWORD WAVE_mciSet(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_WAVE_SET_PARMS TRACE("MCI_WAVE_SET_ANYINPUT\n"); if (wmw->wInput != (WORD)lpParms->wInput) WAVE_mciStop(wDevID, MCI_WAIT, NULL); - wmw->wInput = WAVE_MAPPER; + wmw->wInput = (WORD)WAVE_MAPPER; } if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) { TRACE("MCI_WAVE_SET_ANYOUTPUT\n"); if (wmw->wOutput != (WORD)lpParms->wOutput) WAVE_mciStop(wDevID, MCI_WAIT, NULL); - wmw->wOutput = WAVE_MAPPER; + wmw->wOutput = (WORD)WAVE_MAPPER; } /* Set wave format parameters is refused after Open or Record.*/ if (dwFlags & MCI_WAVE_SET_FORMATTAG) { diff --git a/reactos/dll/win32/samsrv/samrpc.c b/reactos/dll/win32/samsrv/samrpc.c index 9bf30752883..6c0335bc930 100644 --- a/reactos/dll/win32/samsrv/samrpc.c +++ b/reactos/dll/win32/samsrv/samrpc.c @@ -8062,6 +8062,10 @@ SamrChangePasswordUser(IN SAMPR_HANDLE UserHandle, LARGE_INTEGER SystemTime; NTSTATUS Status; + DBG_UNREFERENCED_LOCAL_VARIABLE(StoredLmPresent); + DBG_UNREFERENCED_LOCAL_VARIABLE(StoredNtPresent); + DBG_UNREFERENCED_LOCAL_VARIABLE(StoredLmEmpty); + TRACE("(%p %u %p %p %u %p %p %u %p %u %p)\n", UserHandle, LmPresent, OldLmEncryptedWithNewLm, NewLmEncryptedWithOldLm, NtPresent, OldNtEncryptedWithNewNt, NewNtEncryptedWithOldNt, NtCrossEncryptionPresent, diff --git a/reactos/dll/win32/shell32/desktop.cpp b/reactos/dll/win32/shell32/desktop.cpp index cc0b8d8808d..a4afb60f03f 100644 --- a/reactos/dll/win32/shell32/desktop.cpp +++ b/reactos/dll/win32/shell32/desktop.cpp @@ -261,8 +261,8 @@ HRESULT STDMETHODCALLTYPE CDesktopBrowser::TranslateAcceleratorSB(LPMSG lpmsg, W HRESULT STDMETHODCALLTYPE CDesktopBrowser::BrowseObject(LPCITEMIDLIST pidl, UINT wFlags) { - /* - * We should use IShellWindows interface here in order to attempt to + /* + * We should use IShellWindows interface here in order to attempt to * find an open shell window that shows the requested pidl and activate it */ @@ -422,6 +422,7 @@ LRESULT CALLBACK CDesktopBrowser::ProgmanWindowProc(IN HWND hwnd, IN UINT uMsg, rcDesktop.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN); /* FIXME: Update work area */ + DBG_UNREFERENCED_LOCAL_VARIABLE(rcDesktop); } break; diff --git a/reactos/dll/win32/shell32/shlexec.cpp b/reactos/dll/win32/shell32/shlexec.cpp index 76929844d6a..41bae156ee3 100644 --- a/reactos/dll/win32/shell32/shlexec.cpp +++ b/reactos/dll/win32/shell32/shlexec.cpp @@ -460,7 +460,7 @@ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, startup.wShowWindow = psei->nShow; dwCreationFlags = CREATE_UNICODE_ENVIRONMENT; if (!(psei->fMask & SEE_MASK_NO_CONSOLE)) - dwCreationFlags |= CREATE_NEW_CONSOLE; + dwCreationFlags |= CREATE_NEW_CONSOLE; startup.lpTitle = (LPWSTR)(psei->fMask & (SEE_MASK_HASLINKNAME | SEE_MASK_HASTITLE) ? psei->lpClass : NULL); if (psei->fMask & SEE_MASK_HASLINKNAME) @@ -733,7 +733,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, lpFile = xlpFile; /* The file was found in one of the directories in the system-wide search path */ } - + attribs = GetFileAttributesW(lpFile); if (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY)) { @@ -994,7 +994,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec assert(ptr); *ptr = 0; } - + static const WCHAR wTopic[] = L"\\topic"; if (strlenW(wTopic) + 1 > endkeyLen) { @@ -1491,7 +1491,7 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN DWORD resultLen; BOOL done; UINT_PTR rslt; - + /* FIXME: remove following block when SHELL_quote_and_execute supports hkeyClass parameter */ if (cmask != SEE_MASK_CLASSNAME) { @@ -1522,7 +1522,7 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN ERR("Argify buffer not large enough... truncating\n"); return execfunc(wcmd, NULL, FALSE, psei, psei_out); } - + strcpyW(classname, psei->lpClass); rslt = SHELL_FindExecutableByVerb(psei->lpVerb, NULL, classname, execCmd, sizeof(execCmd)); @@ -1835,6 +1835,7 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) Info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_EXEC; //if (SHOpenWithDialog(sei_tmp.hwnd, &Info) != S_OK) + DBG_UNREFERENCED_LOCAL_VARIABLE(Info); do_error_dialog(retval, sei_tmp.hwnd, wszApplicationName); } HeapFree(GetProcessHeap(), 0, wszApplicationName); @@ -2070,6 +2071,7 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) Info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_EXEC; //if (SHOpenWithDialog(sei_tmp.hwnd, &Info) != S_OK) + DBG_UNREFERENCED_LOCAL_VARIABLE(Info); do_error_dialog(retval, sei_tmp.hwnd, wszApplicationName); } diff --git a/reactos/dll/win32/winmm/CMakeLists.txt b/reactos/dll/win32/winmm/CMakeLists.txt index 507427c6829..6123003f1ca 100644 --- a/reactos/dll/win32/winmm/CMakeLists.txt +++ b/reactos/dll/win32/winmm/CMakeLists.txt @@ -28,3 +28,7 @@ add_importlibs(winmm advapi32 user32 msvcrt kernel32 ntdll) add_pch(winmm winemm.h SOURCE) add_subdirectory(midimap) add_cd_file(TARGET winmm DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + add_target_compile_flags(winmm "-Wno-unused-but-set-variable") +endif() diff --git a/reactos/lib/3rdparty/libmpg123/CMakeLists.txt b/reactos/lib/3rdparty/libmpg123/CMakeLists.txt index 9a9b11a90fe..3731927f62e 100644 --- a/reactos/lib/3rdparty/libmpg123/CMakeLists.txt +++ b/reactos/lib/3rdparty/libmpg123/CMakeLists.txt @@ -44,3 +44,7 @@ list(APPEND SOURCE add_library(libmpg123 ${SOURCE}) add_dependencies(libmpg123 psdk) add_pch(libmpg123 precomp.h SOURCE) + +if(NOT MSVC) + add_target_compile_flags(libmpg123 "-Wno-unused-but-set-variable") +endif() -- 2.17.1