Skip to content

Commit a94fd90

Browse files
committed
Fix Stream.Read warning properly, suppress only legitimate warnings
- CA2022: Fixed by using ReadExactly instead of Read - CA1416: Suppressed - this is a Windows-only WPF app - Nullable disabled - legacy 18-year-old codebase
1 parent bff8c10 commit a94fd90

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Audio.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private static byte[] GetWavResource(string wav)
6464
using (Stream strm = Assembly.GetExecutingAssembly().GetManifestResourceStream(strName))
6565
{
6666
var arrWav = new Byte[strm.Length];
67-
strm.Read(arrWav, 0, (int)strm.Length);
67+
strm.ReadExactly(arrWav, 0, (int)strm.Length);
6868
cachedWavs.Add(wav, arrWav);
6969
return arrWav;
7070
}

BabySmash.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
<!-- Suppress expected warnings -->
3737
<!-- WFO0003: Using Windows Forms in WPF app - intentional for Screen API -->
3838
<!-- IL3000: Assembly.Location in single-file - we handle this -->
39-
<NoWarn>$(NoWarn);WFO0003;IL3000</NoWarn>
39+
<!-- CA1416: Platform compatibility - this is a Windows-only WPF app -->
40+
<NoWarn>$(NoWarn);WFO0003;IL3000;CA1416</NoWarn>
41+
42+
<!-- Nullable - disable for legacy code migration -->
43+
<Nullable>disable</Nullable>
4044
</PropertyGroup>
4145

4246
<!-- Exclude old TFS build templates -->

0 commit comments

Comments
 (0)