diff --git a/CppRuleSet.ruleset b/CppRuleSet.ruleset index 211530994e..f9c7d7bef7 100644 --- a/CppRuleSet.ruleset +++ b/CppRuleSet.ruleset @@ -68,7 +68,7 @@ - + diff --git a/installer/PowerToysSetupCustomActions/CustomAction.cpp b/installer/PowerToysSetupCustomActions/CustomAction.cpp index faa67c0931..fdec216592 100644 --- a/installer/PowerToysSetupCustomActions/CustomAction.cpp +++ b/installer/PowerToysSetupCustomActions/CustomAction.cpp @@ -456,7 +456,7 @@ LExit: { PMSIHANDLE hRecord = MsiCreateRecord(0); MsiRecordSetString(hRecord, 0, TEXT("Failed to create a scheduled task to start PowerToys at user login. You can re-try to create the scheduled task using the PowerToys settings.")); - MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord); + MsiProcessMessage(hInstall, static_cast(INSTALLMESSAGE_WARNING + MB_OK), hRecord); } er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; @@ -573,7 +573,7 @@ LExit: { PMSIHANDLE hRecord = MsiCreateRecord(0); MsiRecordSetString(hRecord, 0, TEXT("Failed to remove the PowerToys folder from the scheduled task. These can be removed manually later.")); - MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord); + MsiProcessMessage(hInstall, static_cast(INSTALLMESSAGE_WARNING + MB_OK), hRecord); } er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; @@ -846,7 +846,7 @@ LExit: { PMSIHANDLE hRecord = MsiCreateRecord(0); MsiRecordSetString(hRecord, 0, TEXT("Failed to add certificate to store")); - MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord); + MsiProcessMessage(hInstall, static_cast(INSTALLMESSAGE_WARNING + MB_OK), hRecord); } er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; @@ -878,7 +878,7 @@ LExit: { PMSIHANDLE hRecord = MsiCreateRecord(0); MsiRecordSetString(hRecord, 0, TEXT("Failed to install virtual camera driver")); - MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord); + MsiProcessMessage(hInstall, static_cast(INSTALLMESSAGE_WARNING + MB_OK), hRecord); } er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; @@ -919,7 +919,7 @@ LExit: { PMSIHANDLE hRecord = MsiCreateRecord(0); MsiRecordSetString(hRecord, 0, TEXT("Failed to uninstall virtual camera driver")); - MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING + MB_OK), hRecord); + MsiProcessMessage(hInstall, static_cast(INSTALLMESSAGE_WARNING + MB_OK), hRecord); } er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; diff --git a/src/common/UnitTests-CommonLib/Settings.Tests.cpp b/src/common/UnitTests-CommonLib/Settings.Tests.cpp index a0c386bde6..13a138997c 100644 --- a/src/common/UnitTests-CommonLib/Settings.Tests.cpp +++ b/src/common/UnitTests-CommonLib/Settings.Tests.cpp @@ -660,19 +660,19 @@ namespace UnitTestsCommonLib TEST_METHOD (GetCodeFromJson) { HotkeyObject object = HotkeyObject::from_json(m_defaultHotkeyJson); - Assert::AreEqual(UINT(123), object.get_code()); + Assert::AreEqual(123U, object.get_code()); } TEST_METHOD (GetCodeFromJsonString) { HotkeyObject object = HotkeyObject::from_json_string(m_defaultHotkeyJson.Stringify()); - Assert::AreEqual(UINT(123), object.get_code()); + Assert::AreEqual(123U, object.get_code()); } TEST_METHOD (GetCodeFromSettings) { HotkeyObject object = HotkeyObject::from_settings(true, true, true, true, 123); - Assert::AreEqual(UINT(123), object.get_code()); + Assert::AreEqual(123U, object.get_code()); } TEST_METHOD (GetWinPressedFromJson) diff --git a/src/modules/fancyzones/FancyZonesLib/Layout.cpp b/src/modules/fancyzones/FancyZonesLib/Layout.cpp index 67853b4489..7fcc33c0b0 100644 --- a/src/modules/fancyzones/FancyZonesLib/Layout.cpp +++ b/src/modules/fancyzones/FancyZonesLib/Layout.cpp @@ -69,7 +69,7 @@ namespace ZoneSelectionAlgorithms zoneIndex = (static_cast(pt.x) - overlap.left) * capturedZones.size() / width; } - zoneIndex = std::clamp(zoneIndex, ZoneIndex(0), static_cast(capturedZones.size()) - 1); + zoneIndex = std::clamp(zoneIndex, static_cast(0), static_cast(capturedZones.size()) - 1); return { capturedZones[zoneIndex] }; }