Enable "strict" compiler flag and fix noncompliance

couldn't find official docs for this, but I got it from:
https://www.meziantou.net/csharp-compiler-strict-mode.htm
and it definitely does SOMETHING
This commit is contained in:
YoshiRulz 2022-07-13 22:02:58 +10:00
parent 730594e1c5
commit 6077bcf5af
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,7 @@
<ContinuousIntegrationBuild Condition=" '$(GITLAB_CI)' != '' Or '$(APPVEYOR)' != '' ">true</ContinuousIntegrationBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<ErrorReport>prompt</ErrorReport>
<Features>strict</Features>
<IsTargetingNetFramework>$(TargetFramework.StartsWith("net4"))</IsTargetingNetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>

View File

@ -67,7 +67,8 @@ namespace BizHawk.Client.Common
return g;
}
public void ToggleCompositingMode() => _compositingMode = 1 - _compositingMode;
public void ToggleCompositingMode()
=> _compositingMode = (CompositingMode) (1 - (int) _compositingMode); // enum has two members, 0 and 1
public ImageAttributes GetAttributes() => _attributes;