From c3ffd17e439e986d5d340a6c820411276e44e6fe Mon Sep 17 00:00:00 2001 From: sosssego Date: Wed, 23 Nov 2022 16:18:17 +0000 Subject: [PATCH] [Analyzers][CPP]Turn on warning 4389 (#22082) --- Cpp.Build.props | 2 +- .../fancyzones/FancyZonesLib/FancyZonesData/CustomLayouts.cpp | 4 ++-- src/modules/fancyzones/FancyZonesLib/JsonHelpers.cpp | 4 ++-- src/modules/fancyzones/FancyZonesLib/WorkArea.cpp | 2 +- src/modules/keyboardmanager/common/Shortcut.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cpp.Build.props b/Cpp.Build.props index cc965a7f9d..4d604f506b 100644 --- a/Cpp.Build.props +++ b/Cpp.Build.props @@ -42,7 +42,7 @@ pch.h Level4 - 26800;28251;4389;6387;4458;4505;4515;4459;4702;6031;6248;26451;28182;%(DisableSpecificWarnings) + 26800;28251;6387;4458;4505;4515;4459;4702;6031;6248;26451;28182;%(DisableSpecificWarnings) true TurnOffAllWarnings false diff --git a/src/modules/fancyzones/FancyZonesLib/FancyZonesData/CustomLayouts.cpp b/src/modules/fancyzones/FancyZonesLib/FancyZonesData/CustomLayouts.cpp index 4900171332..a64e2f4991 100644 --- a/src/modules/fancyzones/FancyZonesLib/FancyZonesData/CustomLayouts.cpp +++ b/src/modules/fancyzones/FancyZonesLib/FancyZonesData/CustomLayouts.cpp @@ -70,7 +70,7 @@ namespace JsonUtils json::JsonArray columnsPercentage = infoJson.GetNamedArray(NonLocalizable::CustomLayoutsIds::ColumnsPercentageID); json::JsonArray cellChildMap = infoJson.GetNamedArray(NonLocalizable::CustomLayoutsIds::CellChildMapID); - if (rowsPercentage.Size() != info.m_rows || columnsPercentage.Size() != info.m_columns || cellChildMap.Size() != info.m_rows) + if (static_cast(rowsPercentage.Size()) != info.m_rows || static_cast(columnsPercentage.Size()) != info.m_columns || static_cast(cellChildMap.Size()) != info.m_rows) { return std::nullopt; } @@ -80,7 +80,7 @@ namespace JsonUtils for (const auto& cellsRow : cellChildMap) { const auto cellsArray = cellsRow.GetArray(); - if (cellsArray.Size() != info.m_columns) + if (static_cast(cellsArray.Size()) != info.m_columns) { return std::nullopt; } diff --git a/src/modules/fancyzones/FancyZonesLib/JsonHelpers.cpp b/src/modules/fancyzones/FancyZonesLib/JsonHelpers.cpp index c2e5807919..c557bcf1a3 100644 --- a/src/modules/fancyzones/FancyZonesLib/JsonHelpers.cpp +++ b/src/modules/fancyzones/FancyZonesLib/JsonHelpers.cpp @@ -383,7 +383,7 @@ namespace JSONHelpers json::JsonArray columnsPercentage = infoJson.GetNamedArray(NonLocalizable::ColumnsPercentageStr); json::JsonArray cellChildMap = infoJson.GetNamedArray(NonLocalizable::CellChildMapStr); - if (rowsPercentage.Size() != info.m_rows || columnsPercentage.Size() != info.m_columns || cellChildMap.Size() != info.m_rows) + if (static_cast(rowsPercentage.Size()) != info.m_rows || static_cast(columnsPercentage.Size()) != info.m_columns || static_cast(cellChildMap.Size()) != info.m_rows) { return std::nullopt; } @@ -393,7 +393,7 @@ namespace JSONHelpers for (const auto& cellsRow : cellChildMap) { const auto cellsArray = cellsRow.GetArray(); - if (cellsArray.Size() != info.m_columns) + if (static_cast(cellsArray.Size()) != info.m_columns) { return std::nullopt; } diff --git a/src/modules/fancyzones/FancyZonesLib/WorkArea.cpp b/src/modules/fancyzones/FancyZonesLib/WorkArea.cpp index 3f51a1dfad..72e21fdaf3 100644 --- a/src/modules/fancyzones/FancyZonesLib/WorkArea.cpp +++ b/src/modules/fancyzones/FancyZonesLib/WorkArea.cpp @@ -243,7 +243,7 @@ bool WorkArea::MoveWindowIntoZoneByDirectionAndIndex(HWND window, DWORD vkCode, ZoneIndex oldId = zoneIndexes[0]; // We reached the edge - if ((vkCode == VK_LEFT && oldId == 0) || (vkCode == VK_RIGHT && oldId == numZones - 1)) + if ((vkCode == VK_LEFT && oldId == 0) || (vkCode == VK_RIGHT && oldId == static_cast(numZones) - 1)) { if (!cycle) { diff --git a/src/modules/keyboardmanager/common/Shortcut.cpp b/src/modules/keyboardmanager/common/Shortcut.cpp index b4f8bdf484..c06cdb531a 100644 --- a/src/modules/keyboardmanager/common/Shortcut.cpp +++ b/src/modules/keyboardmanager/common/Shortcut.cpp @@ -783,7 +783,7 @@ bool Shortcut::IsKeyboardStateClearExceptShortcut(KeyboardManagerInput::InputInt } } // If any other key is pressed check if it is the action key - else if (keyVal != actionKey) + else if (keyVal != static_cast(actionKey)) { return false; }