[Analyzers][CPP]Turn on Warning 4239 (#21588)

* Turn on warning 4239

* changes from comments
fix a 4100 that wasnt showing up before
This commit is contained in:
sosssego 2022-11-15 12:33:31 +00:00 committed by GitHub
parent 59fd84c5ec
commit b482188782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -35,14 +35,14 @@
<PreferredToolArchitecture>x64</PreferredToolArchitecture> <PreferredToolArchitecture>x64</PreferredToolArchitecture>
<VcpkgEnabled>false</VcpkgEnabled> <VcpkgEnabled>false</VcpkgEnabled>
<ExternalIncludePath>$(MSBuildThisFileFullPath)\..\deps\;$(MSBuildThisFileFullPath)\..\packages\;$(ExternalIncludePath)</ExternalIncludePath> <ExternalIncludePath>$(MSBuildThisFileFullPath)\..\deps\;$(MSBuildThisFileFullPath)\..\packages\;$(ExternalIncludePath)</ExternalIncludePath>
<RunCodeAnalysis>true</RunCodeAnalysis> <RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>$(MsbuildThisFileDirectory)\CppRuleSet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>$(MsbuildThisFileDirectory)\CppRuleSet.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ClCompile> <ClCompile>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>26800;28251;4239;4244;4245;4389;4456;4457;4701;6387;4458;4505;4515;4459;4702;6031;6248;26451;28182;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>26800;28251;4244;4245;4389;4456;4457;4701;6387;4458;4505;4515;4459;4702;6031;6248;26451;28182;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableAnalyzeExternal >true</DisableAnalyzeExternal> <DisableAnalyzeExternal >true</DisableAnalyzeExternal>
<ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel> <ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
<ConformanceMode>false</ConformanceMode> <ConformanceMode>false</ConformanceMode>

View File

@ -305,12 +305,11 @@ void AppZoneHistory::AdjustWorkAreaIds(const std::vector<FancyZonesDataTypes::Mo
{ {
bool dirtyFlag = false; bool dirtyFlag = false;
for (auto iter = m_history.begin(); iter != m_history.end(); ++iter) for (auto& [app, data] : m_history)
{ {
auto& [app, data] = *iter; for (auto& dataIter : data)
for (auto& dataIter = data.begin(); dataIter != data.end(); ++dataIter)
{ {
auto& dataMonitorId = dataIter->workAreaId.monitorId; auto& dataMonitorId = dataIter.workAreaId.monitorId;
bool serialNumberNotSet = dataMonitorId.serialNumber.empty() && !dataMonitorId.deviceId.isDefault(); bool serialNumberNotSet = dataMonitorId.serialNumber.empty() && !dataMonitorId.deviceId.isDefault();
bool monitorNumberNotSet = dataMonitorId.deviceId.number == 0; bool monitorNumberNotSet = dataMonitorId.deviceId.number == 0;
if (serialNumberNotSet || monitorNumberNotSet) if (serialNumberNotSet || monitorNumberNotSet)