Enable MEN018 and fix noncompliance (except in Cores)
"Use Digit Separators" in integer literals
This commit is contained in:
parent
74e50c3041
commit
21cdc86e8c
|
@ -386,6 +386,8 @@ dotnet_diagnostic.MEN014.severity = warning
|
|||
dotnet_diagnostic.MEN015.severity = silent
|
||||
# Use object-oriented methods instead of top-level statements
|
||||
dotnet_diagnostic.MEN016.severity = silent
|
||||
# Use Digit Separators
|
||||
dotnet_diagnostic.MEN018.severity = warning
|
||||
|
||||
## Microsoft.CodeAnalysis.BannedApiAnalyzers rules
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project>
|
||||
<Import Project="../Common.props" />
|
||||
<PropertyGroup>
|
||||
<NoWarn>$(NoWarn);SA1200</NoWarn>
|
||||
<NoWarn>$(NoWarn);MEN018;SA1200</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="*.sh" />
|
||||
|
|
|
@ -69,18 +69,18 @@ namespace BizHawk.Client.Common.cheats
|
|||
hexCode |= y;
|
||||
}
|
||||
|
||||
long decoded = (hexCode & 0xFF00000000) >> 32;
|
||||
decoded |= hexCode & 0x00FF000000;
|
||||
decoded |= (hexCode & 0x0000FF0000) << 16;
|
||||
decoded |= (hexCode & 0x00000000700) << 5;
|
||||
decoded |= (hexCode & 0x000000F800) >> 3;
|
||||
decoded |= (hexCode & 0x00000000FF) << 16;
|
||||
long decoded = (hexCode & 0xFF_0000_0000) >> 32;
|
||||
decoded |= hexCode & 0x00_FF00_0000;
|
||||
decoded |= (hexCode & 0x00_00FF_0000) << 16;
|
||||
decoded |= (hexCode & 0x00_0000_0700) << 5;
|
||||
decoded |= (hexCode & 0x00_0000_F800) >> 3;
|
||||
decoded |= (hexCode & 0x00_0000_00FF) << 16;
|
||||
|
||||
return new DecodeResult
|
||||
{
|
||||
Size = WatchSize.Word,
|
||||
Value = (int)(decoded & 0x000000FFFF),
|
||||
Address= (int)((decoded & 0xFFFFFF0000) >> 16)
|
||||
Value = (int) (decoded & 0x00_0000_FFFF),
|
||||
Address = (int) ((decoded & 0xFF_FFFF_0000) >> 16),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -203,11 +203,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public enum StartCode : ulong
|
||||
{
|
||||
Main = 0x4e4d7a561f5f04ad,
|
||||
Stream = 0x4e5311405bf2f9db,
|
||||
Syncpoint = 0x4e4be4adeeca4569,
|
||||
Index = 0x4e58dd672f23e64e,
|
||||
Info = 0x4e49ab68b596ba78
|
||||
// where tf does this incantation come from --yoshi
|
||||
Main = 0x4E4D_7A56_1F5F_04AD,
|
||||
Stream = 0x4E53_1140_5BF2_F9DB,
|
||||
Syncpoint = 0x4E4B_E4AD_EECA_4569,
|
||||
Index = 0x4E58_DD67_2F23_E64E,
|
||||
Info = 0x4E49_AB68_B596_BA78,
|
||||
}
|
||||
|
||||
private MemoryStream _data;
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// </summary>
|
||||
private void FinalizeHeaders()
|
||||
{
|
||||
if (_numBytes + 36 >= 0x100000000)
|
||||
if (_numBytes + 36 >= 0x1_0000_0000)
|
||||
{
|
||||
// passed 4G limit, nothing to be done
|
||||
return;
|
||||
|
|
|
@ -72,17 +72,17 @@ namespace BizHawk.Common.NumberExtensions
|
|||
return 2;
|
||||
}
|
||||
|
||||
if (i < 0x10000)
|
||||
if (i < 0x1_0000)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
if (i < 0x1000000)
|
||||
if (i < 0x100_0000)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
|
||||
if (i < 0x100000000)
|
||||
if (i < 0x1_0000_0000)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<Import Project="../MainSlnCommon.props" />
|
||||
<PropertyGroup>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn>$(NoWarn);BHI1104;CA1806;CA1825;CA2214;MA0060;MA0084;MA0090;MA0140;RS0030;SA1100;SA1120;SA1129;SA1137;SA1205;SA1208;SA1400;SA1514;SA1517</NoWarn>
|
||||
<NoWarn>$(NoWarn);BHI1104;CA1806;CA1825;CA2214;MA0060;MA0084;MA0090;MA0140;MEN018;RS0030;SA1100;SA1120;SA1129;SA1137;SA1205;SA1208;SA1400;SA1514;SA1517</NoWarn>
|
||||
<Nullable>disable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -81,13 +81,11 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
nbits += 7;
|
||||
}
|
||||
|
||||
//end of blocks section
|
||||
if (N == 0xFFFFFFFF)
|
||||
break;
|
||||
// end of blocks section
|
||||
if (N is 0xFFFF_FFFF) break;
|
||||
|
||||
//the 0x80000000 business is confusing, but this is almost positively an error
|
||||
if (N >= 0x100000000)
|
||||
MisformedException();
|
||||
// the 0x8000_0000 business is confusing, but this is almost positively an error
|
||||
if (N >= 0x1_0000_0000) MisformedException();
|
||||
|
||||
var todo = (uint)N + 1;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" PrivateAssets="all" />
|
||||
<Analyzer Include="$(MSBuildProjectDirectory)/../../References/BizHawk.SrcGen.ReflectionCache.dll" />
|
||||
<AdditionalFiles Include="$(MSBuildThisFileDirectory)/BannedSymbols.BannedApiAnalyzers.txt" />
|
||||
<AdditionalFiles Include="$(MSBuildThisFileDirectory)/Menees.Analyzers.Settings.xml" />
|
||||
<Using Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<Menees.Analyzers.Settings>
|
||||
<DigitSeparators> <!-- for MEN018 -->
|
||||
<Binary GroupSize="4" MinSize="9" />
|
||||
<!--<Decimal GroupSize="3" MinSize="8" />--> <!-- applies to float literals too :( -->
|
||||
<Decimal GroupSize="3" MinSize="100" />
|
||||
<Hexadecimal GroupSize="4" MinSize="9" />
|
||||
</DigitSeparators>
|
||||
</Menees.Analyzers.Settings>
|
Loading…
Reference in New Issue