From ef04e2e1e8e7eeca0a3105687c20a8e75402aae8 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Sun, 12 Mar 2023 17:43:12 +0000 Subject: [PATCH] Fix CA2019 --- .editorconfig | 3 +++ OpenRA.Mods.Common/AudioLoaders/OggLoader.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 8063d21863..b551b3a105 100644 --- a/.editorconfig +++ b/.editorconfig @@ -801,6 +801,9 @@ dotnet_diagnostic.CA2016.severity = warning # The 'count' argument to Buffer.BlockCopy should specify the number of bytes to copy. dotnet_diagnostic.CA2018.severity = warning +# ThreadStatic fields should not use inline initialization. +dotnet_diagnostic.CA2019.severity = warning + ### Security Rules ### https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/security-warnings diff --git a/OpenRA.Mods.Common/AudioLoaders/OggLoader.cs b/OpenRA.Mods.Common/AudioLoaders/OggLoader.cs index 33b3d00089..ec60bfbaee 100644 --- a/OpenRA.Mods.Common/AudioLoaders/OggLoader.cs +++ b/OpenRA.Mods.Common/AudioLoaders/OggLoader.cs @@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.AudioLoaders // This buffer can be static because it can only be used by 1 instance per thread. [ThreadStatic] - static float[] conversionBuffer = null; + static float[] conversionBuffer; public OggStream(OggFormat format) {