Enable SA1129 and fix noncompliance (except in Cores)
calling implicit default struct ctor
This commit is contained in:
parent
8c4ceccab9
commit
c1a7556d7f
|
@ -414,7 +414,7 @@
|
||||||
<Rule Id="SA1128" Action="Hidden" />
|
<Rule Id="SA1128" Action="Hidden" />
|
||||||
|
|
||||||
<!-- Do not use default value type constructor -->
|
<!-- Do not use default value type constructor -->
|
||||||
<Rule Id="SA1129" Action="Hidden" />
|
<Rule Id="SA1129" Action="Error" />
|
||||||
|
|
||||||
<!-- Use readable conditions -->
|
<!-- Use readable conditions -->
|
||||||
<Rule Id="SA1131" Action="Hidden" />
|
<Rule Id="SA1131" Action="Hidden" />
|
||||||
|
|
|
@ -269,7 +269,7 @@ namespace BizHawk.BizInvoke
|
||||||
|
|
||||||
var il = method.GetILGenerator();
|
var il = method.GetILGenerator();
|
||||||
|
|
||||||
Label exc = new Label();
|
Label exc = default;
|
||||||
if (monitorField != null) // monitor: enter and then begin try
|
if (monitorField != null) // monitor: enter and then begin try
|
||||||
{
|
{
|
||||||
il.Emit(OpCodes.Ldarg_0);
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
@ -376,7 +376,7 @@ namespace BizHawk.BizInvoke
|
||||||
|
|
||||||
var il = method.GetILGenerator();
|
var il = method.GetILGenerator();
|
||||||
|
|
||||||
Label exc = new Label();
|
Label exc = default;
|
||||||
if (monitorField != null) // monitor: enter and then begin try
|
if (monitorField != null) // monitor: enter and then begin try
|
||||||
{
|
{
|
||||||
il.Emit(OpCodes.Ldarg_0);
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
|
|
@ -165,7 +165,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
var pFlIn = (float*) pMatIn;
|
var pFlIn = (float*) pMatIn;
|
||||||
for (var i = 0; i < 16; i++) pDbTemp[i] = pFlIn[i];
|
for (var i = 0; i < 16; i++) pDbTemp[i] = pFlIn[i];
|
||||||
}
|
}
|
||||||
Matrix4 result = new();
|
Matrix4 result = default;
|
||||||
ref var refResult = ref result;
|
ref var refResult = ref result;
|
||||||
fixed (Matrix4* pMatOut = &refResult)
|
fixed (Matrix4* pMatOut = &refResult)
|
||||||
{
|
{
|
||||||
|
|
|
@ -140,7 +140,7 @@ namespace BizHawk.Bizware.DirectX
|
||||||
|
|
||||||
if (XInputGetStateExProc != null)
|
if (XInputGetStateExProc != null)
|
||||||
{
|
{
|
||||||
_state = new XINPUT_STATE();
|
_state = default;
|
||||||
XInputGetStateExProc(_index0, out _state);
|
XInputGetStateExProc(_index0, out _state);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#if AVI_SUPPORT
|
#if AVI_SUPPORT
|
||||||
|
#pragma warning disable SA1129
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
|
@ -4832,6 +4832,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
LoadRom(args[0]);
|
LoadRom(args[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IQuickBmpFile QuickBmpFile { get; } = new QuickBmpFile();
|
public IQuickBmpFile QuickBmpFile { get; } = EmuHawk.QuickBmpFile.INSTANCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -332,6 +332,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
s.Write(dst, 0, dst.Length);
|
s.Write(dst, 0, dst.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static readonly QuickBmpFile INSTANCE = default;
|
||||||
|
|
||||||
readonly void IQuickBmpFile.Copy(IVideoProvider src, IVideoProvider dst) => Copy(src, dst);
|
readonly void IQuickBmpFile.Copy(IVideoProvider src, IVideoProvider dst) => Copy(src, dst);
|
||||||
|
|
||||||
readonly bool IQuickBmpFile.Load(IVideoProvider v, Stream s) => Load(v, s);
|
readonly bool IQuickBmpFile.Load(IVideoProvider v, Stream s) => Load(v, s);
|
||||||
|
|
|
@ -178,7 +178,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (frame >= 0)
|
if (frame >= 0)
|
||||||
{
|
{
|
||||||
PendingChanges newChange = new PendingChanges();
|
PendingChanges newChange = default;
|
||||||
|
|
||||||
if (frame < Tastudio.CurrentTasMovie.InputLogLength)
|
if (frame < Tastudio.CurrentTasMovie.InputLogLength)
|
||||||
{
|
{
|
||||||
|
@ -215,7 +215,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (frame >= 0)
|
if (frame >= 0)
|
||||||
{
|
{
|
||||||
PendingChanges newChange = new PendingChanges();
|
PendingChanges newChange = default;
|
||||||
|
|
||||||
if (frame < Tastudio.CurrentTasMovie.InputLogLength)
|
if (frame < Tastudio.CurrentTasMovie.InputLogLength)
|
||||||
{
|
{
|
||||||
|
|
|
@ -166,9 +166,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
var rec = _log[index];
|
var rec = _log[index];
|
||||||
|
|
||||||
PulseState pulse = new PulseState();
|
var pulse = track switch
|
||||||
if (track == 0) pulse = rec.Pulse0;
|
{
|
||||||
if (track == 1) pulse = rec.Pulse1;
|
0 => rec.Pulse0,
|
||||||
|
1 => rec.Pulse1,
|
||||||
|
_ => default
|
||||||
|
};
|
||||||
|
|
||||||
// transform quieted notes to dead notes
|
// transform quieted notes to dead notes
|
||||||
// blech its buggy, im tired
|
// blech its buggy, im tired
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<Import Project="../MainSlnCommon.props" />
|
<Import Project="../MainSlnCommon.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<NoWarn>$(NoWarn);CA1806;CA1825;CA2214;SA1100;SA1120;SA1137;SA1205;SA1208;SA1400</NoWarn>
|
<NoWarn>$(NoWarn);CA1806;CA1825;CA2214;SA1100;SA1120;SA1129;SA1137;SA1205;SA1208;SA1400</NoWarn>
|
||||||
<Nullable>disable</Nullable>
|
<Nullable>disable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -120,7 +120,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Parameters set during disc loading which can be referenced by the sector synthesizers
|
/// Parameters set during disc loading which can be referenced by the sector synthesizers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal SectorSynthParams SynthParams = new SectorSynthParams();
|
internal SectorSynthParams SynthParams = default;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Forbid public construction
|
/// Forbid public construction
|
||||||
|
|
|
@ -160,7 +160,7 @@ namespace BizHawk.Emulation.DiscSystem.CUE
|
||||||
|
|
||||||
private void EmitRawTOCEntry(CompiledCueTrack cct)
|
private void EmitRawTOCEntry(CompiledCueTrack cct)
|
||||||
{
|
{
|
||||||
SubchannelQ toc_sq = new SubchannelQ();
|
SubchannelQ toc_sq = default;
|
||||||
//absent some kind of policy for how to set it, this is a safe assumption:
|
//absent some kind of policy for how to set it, this is a safe assumption:
|
||||||
byte toc_ADR = 1;
|
byte toc_ADR = 1;
|
||||||
toc_sq.SetStatus(toc_ADR, (EControlQ)(int)cct.Flags);
|
toc_sq.SetStatus(toc_ADR, (EControlQ)(int)cct.Flags);
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
//NOTE: entries are inserted at the beginning due to observations of CCD indicating they might need to be that way
|
//NOTE: entries are inserted at the beginning due to observations of CCD indicating they might need to be that way
|
||||||
//Since I'm being asked to synthesize them here, I guess I can put them in whatever order I want, can't I?
|
//Since I'm being asked to synthesize them here, I guess I can put them in whatever order I want, can't I?
|
||||||
|
|
||||||
SubchannelQ sq = new SubchannelQ();
|
SubchannelQ sq = default;
|
||||||
|
|
||||||
//ADR (q-Mode) is necessarily 0x01 for a RawTOCEntry
|
//ADR (q-Mode) is necessarily 0x01 for a RawTOCEntry
|
||||||
const int kADR = 1;
|
const int kADR = 1;
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
{
|
{
|
||||||
//var se = new SectorEntry(sz);
|
//var se = new SectorEntry(sz);
|
||||||
//Disc.Sectors.Add(se);
|
//Disc.Sectors.Add(se);
|
||||||
SubchannelQ sq = new SubchannelQ();
|
SubchannelQ sq = default;
|
||||||
|
|
||||||
int track_relative_msf = i;
|
int track_relative_msf = i;
|
||||||
sq.min = BCD2.FromDecimal(new Timestamp(track_relative_msf).MIN);
|
sq.min = BCD2.FromDecimal(new Timestamp(track_relative_msf).MIN);
|
||||||
|
|
|
@ -239,7 +239,7 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
// else if(toc.disc_type == DISC_TYPE_CD_I) control |= 0x4;
|
// else if(toc.disc_type == DISC_TYPE_CD_I) control |= 0x4;
|
||||||
control |= (EControlQ)(((int)ses.LastInformationTrack.Control) & 4);
|
control |= (EControlQ)(((int)ses.LastInformationTrack.Control) & 4);
|
||||||
|
|
||||||
SubchannelQ sq = new SubchannelQ();
|
SubchannelQ sq = default;
|
||||||
sq.SetStatus(ADR, control);
|
sq.SetStatus(ADR, control);
|
||||||
sq.q_tno.BCDValue = 0xAA;
|
sq.q_tno.BCDValue = 0xAA;
|
||||||
sq.q_index.BCDValue = 0x01;
|
sq.q_index.BCDValue = 0x01;
|
||||||
|
|
Loading…
Reference in New Issue