General code cleanup and style refactor.

This commit is contained in:
2022-11-15 15:58:43 +00:00
parent f59ecffb59
commit 2f9b7fe0a1
1324 changed files with 36815 additions and 37688 deletions

View File

@@ -30,14 +30,14 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.DiscImages;
using System;
using System.IO;
using Aaru.CommonTypes.Interfaces;
using Aaru.Console;
using Aaru.Helpers;
namespace Aaru.DiscImages;
public sealed partial class T98
{
/// <inheritdoc />
@@ -49,19 +49,19 @@ public sealed partial class T98
if(stream.Length % 256 != 0)
return false;
var hdrB = new byte[256];
byte[] hdrB = new byte[256];
stream.EnsureRead(hdrB, 0, hdrB.Length);
for(var i = 4; i < 256; i++)
for(int i = 4; i < 256; i++)
if(hdrB[i] != 0)
return false;
var cylinders = BitConverter.ToInt32(hdrB, 0);
int cylinders = BitConverter.ToInt32(hdrB, 0);
AaruConsole.DebugWriteLine("T98 plugin", "cylinders = {0}", cylinders);
// This format is expanding, so length can be smaller
// Just grow it, I won't risk false positives...
return stream.Length == cylinders * 8 * 33 * 256 + 256;
return stream.Length == (cylinders * 8 * 33 * 256) + 256;
}
}