Migrate to C#12

This commit is contained in:
copecone committed 2026-10-22 11:54:26 +09:00
1 parent 7eaf4f48e6
commit 98d31404cc
24 files changed
+42 -42

No files matched your search

+1 -1
View File
@@ -54,7 +54,7 @@ internal static class AudioClipResolver
}
if (!clip) return store.GetOrAdd(key, () => null);
return store.GetOrAdd(key, () => UnityClipLoader.Load(clip!, store));
return store.GetOrAdd(key, () => UnityClipLoader.Load(clip, store));
}
/// <summary>Opens <paramref name="path"/> with FFmpeg; mono MP3 files are wrapped in <see cref="MP3MonoLayoutReader"/> (game layout).</summary>
+1 -1
View File
@@ -198,7 +198,7 @@ internal sealed class AudioClipStore : IDisposable
// same key meanwhile, its entry wins and this source is discarded.
lock (_sources)
{
if (_disposed || _sources.TryGetValue(key, out var raced))
if (_disposed || _sources.TryGetValue(key, out _))
{
source?.DisposeInternal();
return _disposed ? null : _sources[key];
+1
View File
@@ -196,6 +196,7 @@ internal sealed class DecodeStream : IDisposable
}
/// <summary>Greatest common divisor of two positive integers (Euclid).</summary>
// ReSharper disable once InconsistentNaming
private static int GCD(int a, int b)
{
while (b != 0) (a, b) = (b, a % b);
+1
View File
@@ -81,6 +81,7 @@ internal sealed unsafe class FFmpegPCMReader : IPCMReader
public long Position { get; private set; }
/// <summary>True when the stream is MP3 and is decoded with the game's MP3 timing (see class summary).</summary>
// ReSharper disable once InconsistentNaming
public bool IsMP3 { get; }
/// <summary>Number of demuxer seeks performed (for diagnostics).</summary>
+1 -1
View File
@@ -1,4 +1,3 @@
using System;
using System.IO;
namespace ADOFAIRenderer.Util.Audio.Clip;
@@ -20,6 +19,7 @@ namespace ADOFAIRenderer.Util.Audio.Clip;
/// - Samples per frame: Layer I 384, Layer II 1152, Layer III 1152 (MPEG-1) or 576 (MPEG-2/2.5).
/// - ID3v2 tags before the first frame: "ID3", version (2 bytes), flags (bit 0x10 = 10-byte footer), size (4 bytes, 7 bits each).
/// </summary>
// ReSharper disable once InconsistentNaming
internal static class MP3HeaderFrame
{
/// <summary>Bytes searched for the first frame sync after the ID3v2 tags.</summary>
+1
View File
@@ -13,6 +13,7 @@ namespace ADOFAIRenderer.Util.Audio.Clip;
/// Output: 1 channel at the inner reader's sample rate. Frame 2k is inner frame k, frame 2k + 1 is 0.
/// <see cref="TotalFrames"/> = 2 * inner TotalFrames.
/// </summary>
// ReSharper disable once InconsistentNaming
internal sealed class MP3MonoLayoutReader : IPCMReader
{
private readonly IPCMReader _inner;