diff --git a/Cpp.Build.props b/Cpp.Build.props index 978c95b2b6..686d6c54b8 100644 --- a/Cpp.Build.props +++ b/Cpp.Build.props @@ -42,7 +42,7 @@ pch.h Level4 - 26800;28251;4189;4239;4244;4245;4389;4456;4457;4701;6387;4458;4505;4515;4459;4702;6031;6248;26451;28182;%(DisableSpecificWarnings) + 26800;28251;4239;4244;4245;4389;4456;4457;4701;6387;4458;4505;4515;4459;4702;6031;6248;26451;28182;%(DisableSpecificWarnings) true TurnOffAllWarnings false diff --git a/src/common/interop/KeyboardHook.cpp b/src/common/interop/KeyboardHook.cpp index e0cbca73c0..f1c09c78a2 100644 --- a/src/common/interop/KeyboardHook.cpp +++ b/src/common/interop/KeyboardHook.cpp @@ -30,8 +30,6 @@ KeyboardHook::~KeyboardHook() void KeyboardHook::Start() { hookProc = gcnew HookProcDelegate(this, &KeyboardHook::HookProc); - Process ^ curProcess = Process::GetCurrentProcess(); - ProcessModule ^ curModule = curProcess->MainModule; #if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED) const bool hookDisabled = IsDebuggerPresent(); #else diff --git a/src/common/interop/two_way_pipe_message_ipc.cpp b/src/common/interop/two_way_pipe_message_ipc.cpp index daeb2f58eb..69215665c7 100644 --- a/src/common/interop/two_way_pipe_message_ipc.cpp +++ b/src/common/interop/two_way_pipe_message_ipc.cpp @@ -425,7 +425,7 @@ void TwoWayPipeMessageIPC::TwoWayPipeMessageIPCImpl::start_named_pipe_server(HAN if (token != NULL) { - int err = change_pipe_security_allow_restricted_token(connect_pipe_handle, token); + change_pipe_security_allow_restricted_token(connect_pipe_handle, token); } current_connect_pipe_handle = connect_pipe_handle; } diff --git a/src/common/notifications/dont_show_again.cpp b/src/common/notifications/dont_show_again.cpp index 64f927f646..945eb8cba2 100644 --- a/src/common/notifications/dont_show_again.cpp +++ b/src/common/notifications/dont_show_again.cpp @@ -20,7 +20,7 @@ namespace notifications } const auto now = timeutil::now(); const size_t buf_size = sizeof(now); - if (RegSetValueExW(key, nullptr, 0, REG_QWORD, reinterpret_cast(&now), sizeof(now)) != ERROR_SUCCESS) + if (RegSetValueExW(key, nullptr, 0, REG_QWORD, reinterpret_cast(&now), buf_size) != ERROR_SUCCESS) { RegCloseKey(key); return false; diff --git a/src/common/notifications/notifications.cpp b/src/common/notifications/notifications.cpp index 7271d2d028..7f03af0633 100644 --- a/src/common/notifications/notifications.cpp +++ b/src/common/notifications/notifications.cpp @@ -405,7 +405,7 @@ void notifications::update_toast_progress_bar(std::wstring_view tag, progress_ba map.Insert(L"progressTitle", params.progress_title); NotificationData data(map); - NotificationUpdateResult res = notifier.Update(data, tag, DEFAULT_TOAST_GROUP); + notifier.Update(data, tag, DEFAULT_TOAST_GROUP); } void notifications::remove_toasts_by_tag(std::wstring_view tag) diff --git a/src/common/updating/updating.cpp b/src/common/updating/updating.cpp index 405bdc2cc9..99d53dcbbc 100644 --- a/src/common/updating/updating.cpp +++ b/src/common/updating/updating.cpp @@ -57,7 +57,7 @@ namespace updating const bool architecture_matched = filename_lower.find(required_architecture) != std::wstring::npos; const bool filename_matched = filename_lower.find(required_filename_pattern) != std::wstring::npos; const bool asset_matched = extension_matched && architecture_matched && filename_matched; - if (extension_matched && architecture_matched && filename_matched) + if (asset_matched) { return std::make_pair(Uri{ asset.GetNamedString(L"browser_download_url") }, std::move(filename_lower)); } diff --git a/src/modules/ShortcutGuide/ShortcutGuide/overlay_window.cpp b/src/modules/ShortcutGuide/ShortcutGuide/overlay_window.cpp index 800a327b7d..c0a3373db6 100644 --- a/src/modules/ShortcutGuide/ShortcutGuide/overlay_window.cpp +++ b/src/modules/ShortcutGuide/ShortcutGuide/overlay_window.cpp @@ -617,7 +617,7 @@ void D2DOverlayWindow::render(ID2D1DeviceContext5* d2d_dc) } d2d_dc->Clear(); - int x_offset = 0, y_offset = 0, dimension = 0; + int x_offset = 0, y_offset = 0; auto current_anim_value = (float)animation.value(Animation::AnimFunctions::LINEAR); SetLayeredWindowAttributes(hwnd, 0, (int)(255 * current_anim_value), LWA_ALPHA); double pos_anim_value = 1 - animation.value(Animation::AnimFunctions::EASE_OUT_EXPO); diff --git a/src/modules/fancyzones/FancyZonesLib/WindowUtils.cpp b/src/modules/fancyzones/FancyZonesLib/WindowUtils.cpp index b131bd7ae0..14036a7816 100644 --- a/src/modules/fancyzones/FancyZonesLib/WindowUtils.cpp +++ b/src/modules/fancyzones/FancyZonesLib/WindowUtils.cpp @@ -254,7 +254,6 @@ bool FancyZonesWindowUtils::IsProcessOfWindowElevated(HWND window) pid) }; wil::unique_handle token; - bool elevated = false; if (OpenProcessToken(hProcess.get(), TOKEN_QUERY, &token)) { diff --git a/src/modules/fancyzones/FancyZonesTests/UnitTests/AppZoneHistoryTests.Spec.cpp b/src/modules/fancyzones/FancyZonesTests/UnitTests/AppZoneHistoryTests.Spec.cpp index 8ef980a5c2..0071514185 100644 --- a/src/modules/fancyzones/FancyZonesTests/UnitTests/AppZoneHistoryTests.Spec.cpp +++ b/src/modules/fancyzones/FancyZonesTests/UnitTests/AppZoneHistoryTests.Spec.cpp @@ -335,9 +335,8 @@ namespace FancyZonesUnitTests .monitorId = { .deviceId = { .id = L"DELA026", .instanceId = L"5&10a58c63&0&UID16777488" } }, .virtualDesktopId = FancyZonesUtils::GuidFromString(L"{39B25DD2-130D-4B5D-8851-4791D66B1539}").value() }; - const auto window = Mocks::WindowCreate(m_hInst); Assert::IsFalse(AppZoneHistory::instance().RemoveAppLastZone(nullptr, workAreaId, zoneSetId)); } }; -} \ No newline at end of file +} diff --git a/src/modules/keyboardmanager/common/KeyboardEventHandlers.cpp b/src/modules/keyboardmanager/common/KeyboardEventHandlers.cpp index a1fe1f9368..262ced5c7e 100644 --- a/src/modules/keyboardmanager/common/KeyboardEventHandlers.cpp +++ b/src/modules/keyboardmanager/common/KeyboardEventHandlers.cpp @@ -18,7 +18,7 @@ namespace KeyboardEventHandlers // Use the suppress flag to ensure these are not intercepted by any remapped keys or shortcuts Helpers::SetKeyEvent(keyEventList, 0, INPUT_KEYBOARD, VK_NUMLOCK, KEYEVENTF_KEYUP, KeyboardManagerConstants::KEYBOARDMANAGER_SUPPRESS_FLAG); Helpers::SetKeyEvent(keyEventList, 1, INPUT_KEYBOARD, VK_NUMLOCK, 0, KeyboardManagerConstants::KEYBOARDMANAGER_SUPPRESS_FLAG); - UINT res = ii.SendVirtualInput((UINT)key_count, keyEventList, sizeof(INPUT)); + ii.SendVirtualInput((UINT)key_count, keyEventList, sizeof(INPUT)); delete[] keyEventList; } } diff --git a/src/modules/powerrename/unittests/PowerRenameManagerTests.cpp b/src/modules/powerrename/unittests/PowerRenameManagerTests.cpp index e700ef4cdf..4bd38d1314 100644 --- a/src/modules/powerrename/unittests/PowerRenameManagerTests.cpp +++ b/src/modules/powerrename/unittests/PowerRenameManagerTests.cpp @@ -20,7 +20,7 @@ HINSTANCE g_hostHInst = HINST_THISCOMPONENT; namespace PowerRenameManagerTests { - TEST_CLASS(SimpleTests) + TEST_CLASS (SimpleTests) { public: struct rename_pairs @@ -78,7 +78,6 @@ namespace PowerRenameManagerTests } // TODO: Setup match and replace parameters - wchar_t newReplaceTerm[MAX_PATH] = { 0 }; CComPtr renRegEx; Assert::IsTrue(mgr->GetRenameRegEx(&renRegEx) == S_OK); renRegEx->PutFlags(flags); @@ -110,30 +109,30 @@ namespace PowerRenameManagerTests mockMgrEvents->Release(); } - TEST_METHOD(CreateTest) + TEST_METHOD (CreateTest) { CComPtr mgr; Assert::IsTrue(CPowerRenameManager::s_CreateInstance(&mgr) == S_OK); } - TEST_METHOD(CreateAndShutdownTest) + TEST_METHOD (CreateAndShutdownTest) { CComPtr mgr; Assert::IsTrue(CPowerRenameManager::s_CreateInstance(&mgr) == S_OK); Assert::IsTrue(mgr->Shutdown() == S_OK); } - TEST_METHOD(AddItemTest) + TEST_METHOD (AddItemTest) { CComPtr mgr; Assert::IsTrue(CPowerRenameManager::s_CreateInstance(&mgr) == S_OK); CComPtr item; - CMockPowerRenameItem::CreateInstance(L"foo", L"foo", 0, false, SYSTEMTIME{0}, &item); + CMockPowerRenameItem::CreateInstance(L"foo", L"foo", 0, false, SYSTEMTIME{ 0 }, &item); mgr->AddItem(item); Assert::IsTrue(mgr->Shutdown() == S_OK); } - TEST_METHOD(VerifyRenameManagerEvents) + TEST_METHOD (VerifyRenameManagerEvents) { CComPtr mgr; Assert::IsTrue(CPowerRenameManager::s_CreateInstance(&mgr) == S_OK); @@ -143,7 +142,7 @@ namespace PowerRenameManagerTests DWORD cookie = 0; Assert::IsTrue(mgr->Advise(mgrEvents, &cookie) == S_OK); CComPtr item; - CMockPowerRenameItem::CreateInstance(L"foo", L"foo", 0, false, SYSTEMTIME{0}, &item); + CMockPowerRenameItem::CreateInstance(L"foo", L"foo", 0, false, SYSTEMTIME{ 0 }, &item); int itemId = 0; Assert::IsTrue(item->GetId(&itemId) == S_OK); mgr->AddItem(item); @@ -158,7 +157,7 @@ namespace PowerRenameManagerTests mockMgrEvents->Release(); } - TEST_METHOD(VerifySingleRename) + TEST_METHOD (VerifySingleRename) { // Create a single item and verify rename works as expected rename_pairs renamePairs[] = { @@ -168,7 +167,7 @@ namespace PowerRenameManagerTests RenameHelper(renamePairs, ARRAYSIZE(renamePairs), L"foo", L"bar", SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }, DEFAULT_FLAGS); } - TEST_METHOD(VerifyMultiRename) + TEST_METHOD (VerifyMultiRename) { // Create a single item and verify rename works as expected rename_pairs renamePairs[] = { @@ -183,7 +182,7 @@ namespace PowerRenameManagerTests RenameHelper(renamePairs, ARRAYSIZE(renamePairs), L"foo", L"bar", SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }, DEFAULT_FLAGS); } - TEST_METHOD(VerifyFilesOnlyRename) + TEST_METHOD (VerifyFilesOnlyRename) { // Verify only files are renamed when folders match too rename_pairs renamePairs[] = { @@ -194,7 +193,7 @@ namespace PowerRenameManagerTests RenameHelper(renamePairs, ARRAYSIZE(renamePairs), L"foo", L"bar", SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }, DEFAULT_FLAGS | ExcludeFolders); } - TEST_METHOD(VerifyFoldersOnlyRename) + TEST_METHOD (VerifyFoldersOnlyRename) { // Verify only folders are renamed when files match too rename_pairs renamePairs[] = { @@ -205,7 +204,7 @@ namespace PowerRenameManagerTests RenameHelper(renamePairs, ARRAYSIZE(renamePairs), L"foo", L"bar", SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }, DEFAULT_FLAGS | ExcludeFiles); } - TEST_METHOD(VerifyFileNameOnlyRename) + TEST_METHOD (VerifyFileNameOnlyRename) { // Verify only file name is renamed, not extension rename_pairs renamePairs[] = { @@ -216,7 +215,7 @@ namespace PowerRenameManagerTests RenameHelper(renamePairs, ARRAYSIZE(renamePairs), L"foo", L"bar", SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }, DEFAULT_FLAGS | NameOnly); } - TEST_METHOD(VerifyFileExtensionOnlyRename) + TEST_METHOD (VerifyFileExtensionOnlyRename) { // Verify only file extension is renamed, not name rename_pairs renamePairs[] = { @@ -227,7 +226,7 @@ namespace PowerRenameManagerTests RenameHelper(renamePairs, ARRAYSIZE(renamePairs), L"foo", L"bar", SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }, DEFAULT_FLAGS | ExtensionOnly); } - TEST_METHOD(VerifySubFoldersRename) + TEST_METHOD (VerifySubFoldersRename) { // Verify subfolders do not get renamed rename_pairs renamePairs[] = { @@ -301,7 +300,6 @@ namespace PowerRenameManagerTests RenameHelper(renamePairs, ARRAYSIZE(renamePairs), L"foo", L"bar", SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }, DEFAULT_FLAGS | Lowercase | ExtensionOnly); } - TEST_METHOD (VerifyFileAttributesNoPadding) { rename_pairs renamePairs[] = { diff --git a/src/runner/main.cpp b/src/runner/main.cpp index 0f255a37ba..76e7089e29 100644 --- a/src/runner/main.cpp +++ b/src/runner/main.cpp @@ -460,7 +460,6 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR l // Apply the general settings but don't save it as the modules() variable has not been loaded yet apply_general_settings(general_settings, false); - int rvalue = 0; const bool elevated = is_process_elevated(); const bool with_dont_elevate_arg = cmdLine.find("--dont-elevate") != std::string::npos; const bool run_elevated_setting = general_settings.GetNamedBoolean(L"run_elevated", false); diff --git a/tools/BugReportTool/BugReportTool/InstallationFolder.cpp b/tools/BugReportTool/BugReportTool/InstallationFolder.cpp index 4fef3b8b40..abecb6f308 100644 --- a/tools/BugReportTool/BugReportTool/InstallationFolder.cpp +++ b/tools/BugReportTool/BugReportTool/InstallationFolder.cpp @@ -62,7 +62,6 @@ optional GetRootPath() wstring GetChecksum(path filePath) { - DWORD dwStatus = 0; BOOL bResult = FALSE; HCRYPTPROV hProv = 0; HCRYPTHASH hHash = 0; diff --git a/tools/BugReportTool/BugReportTool/RegistryUtils.cpp b/tools/BugReportTool/BugReportTool/RegistryUtils.cpp index 6025336e1e..dde4579a90 100644 --- a/tools/BugReportTool/BugReportTool/RegistryUtils.cpp +++ b/tools/BugReportTool/BugReportTool/RegistryUtils.cpp @@ -57,7 +57,7 @@ namespace vector> QueryValues(HKEY key) { DWORD cValues; - DWORD retCode = RegQueryInfoKeyW(key, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, &cValues, nullptr, nullptr, nullptr, nullptr); + RegQueryInfoKeyW(key, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, &cValues, nullptr, nullptr, nullptr, nullptr); TCHAR achValue[255]; DWORD cchValue = 255; LPBYTE value; @@ -282,7 +282,7 @@ void ReportRegistry(const filesystem::path& tmpDir) { DWORD data = 0; DWORD dataSize = sizeof(data); - LONG retCode = RegGetValueW(rootKey, subKey.c_str(), value.c_str(), flags, &type, &data, &dataSize); + result = RegGetValueW(rootKey, subKey.c_str(), value.c_str(), flags, &type, &data, &dataSize); if (result == ERROR_SUCCESS) { registryReport << "\t" << value << " > " << data << "\n";