[Refactor] Fix some code warnings.

This commit is contained in:
2024-05-01 23:52:03 +01:00
parent facfb0a972
commit feb9ea589f
37 changed files with 235 additions and 256 deletions

View File

@@ -71,7 +71,7 @@ static class Neon
while(blocks != 0) while(blocks != 0)
{ {
uint n = Adler32Context.NMAX / blockSize; /* The NMAX constraint. */ uint n = Adler32Context.NMax / blockSize; /* The NMAX constraint. */
if(n > blocks) n = blocks; if(n > blocks) n = blocks;
@@ -196,8 +196,8 @@ static class Neon
/* /*
* Reduce. * Reduce.
*/ */
s1 %= Adler32Context.ADLER_MODULE; s1 %= Adler32Context.AdlerModule;
s2 %= Adler32Context.ADLER_MODULE; s2 %= Adler32Context.AdlerModule;
} }
/* /*
@@ -228,9 +228,9 @@ static class Neon
while(len-- != 0) s2 += s1 += buf[bufPos++]; while(len-- != 0) s2 += s1 += buf[bufPos++];
if(s1 >= Adler32Context.ADLER_MODULE) s1 -= Adler32Context.ADLER_MODULE; if(s1 >= Adler32Context.AdlerModule) s1 -= Adler32Context.AdlerModule;
s2 %= Adler32Context.ADLER_MODULE; s2 %= Adler32Context.AdlerModule;
} }
/* /*

View File

@@ -68,7 +68,7 @@ static class Ssse3
while(blocks != 0) while(blocks != 0)
{ {
uint n = Adler32Context.NMAX / blockSize; /* The NMAX constraint. */ uint n = Adler32Context.NMax / blockSize; /* The NMAX constraint. */
if(n > blocks) n = blocks; if(n > blocks) n = blocks;
@@ -142,8 +142,8 @@ static class Ssse3
/* /*
* Reduce. * Reduce.
*/ */
s1 %= Adler32Context.ADLER_MODULE; s1 %= Adler32Context.AdlerModule;
s2 %= Adler32Context.ADLER_MODULE; s2 %= Adler32Context.AdlerModule;
} }
/* /*
@@ -174,9 +174,9 @@ static class Ssse3
while(len-- != 0) s2 += s1 += buf[bufPos++]; while(len-- != 0) s2 += s1 += buf[bufPos++];
if(s1 >= Adler32Context.ADLER_MODULE) s1 -= Adler32Context.ADLER_MODULE; if(s1 >= Adler32Context.AdlerModule) s1 -= Adler32Context.AdlerModule;
s2 %= Adler32Context.ADLER_MODULE; s2 %= Adler32Context.AdlerModule;
} }
/* /*

View File

@@ -54,8 +54,8 @@ namespace Aaru.Checksums;
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] [SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
public sealed partial class Adler32Context : IChecksum public sealed partial class Adler32Context : IChecksum
{ {
internal const ushort ADLER_MODULE = 65521; internal const ushort AdlerModule = 65521;
internal const uint NMAX = 5552; internal const uint NMax = 5552;
readonly IntPtr _nativeContext; readonly IntPtr _nativeContext;
readonly bool _useNative; readonly bool _useNative;
ushort _sum1, _sum2; ushort _sum1, _sum2;
@@ -177,11 +177,11 @@ public sealed partial class Adler32Context : IChecksum
{ {
sum1 += data[dataOff]; sum1 += data[dataOff];
if(sum1 >= ADLER_MODULE) sum1 -= ADLER_MODULE; if(sum1 >= AdlerModule) sum1 -= AdlerModule;
sum2 += sum1; sum2 += sum1;
if(sum2 >= ADLER_MODULE) sum2 -= ADLER_MODULE; if(sum2 >= AdlerModule) sum2 -= AdlerModule;
preSum1 = (ushort)(sum1 & 0xFFFF); preSum1 = (ushort)(sum1 & 0xFFFF);
preSum2 = (ushort)(sum2 & 0xFFFF); preSum2 = (ushort)(sum2 & 0xFFFF);
@@ -197,9 +197,9 @@ public sealed partial class Adler32Context : IChecksum
sum2 += sum1; sum2 += sum1;
} }
if(sum1 >= ADLER_MODULE) sum1 -= ADLER_MODULE; if(sum1 >= AdlerModule) sum1 -= AdlerModule;
sum2 %= ADLER_MODULE; /* only added so many ADLER_MODULE's */ sum2 %= AdlerModule; /* only added so many ADLER_MODULE's */
preSum1 = (ushort)(sum1 & 0xFFFF); preSum1 = (ushort)(sum1 & 0xFFFF);
preSum2 = (ushort)(sum2 & 0xFFFF); preSum2 = (ushort)(sum2 & 0xFFFF);
@@ -208,10 +208,10 @@ public sealed partial class Adler32Context : IChecksum
} }
/* do length NMAX blocks -- requires just one modulo operation */ /* do length NMAX blocks -- requires just one modulo operation */
while(len >= NMAX) while(len >= NMax)
{ {
len -= NMAX; len -= NMax;
uint n = NMAX / 16; uint n = NMax / 16;
do do
{ {
@@ -252,8 +252,8 @@ public sealed partial class Adler32Context : IChecksum
dataOff += 16; dataOff += 16;
} while(--n != 0); } while(--n != 0);
sum1 %= ADLER_MODULE; sum1 %= AdlerModule;
sum2 %= ADLER_MODULE; sum2 %= AdlerModule;
} }
/* do remaining bytes (less than NMAX, still just one modulo) */ /* do remaining bytes (less than NMAX, still just one modulo) */
@@ -305,8 +305,8 @@ public sealed partial class Adler32Context : IChecksum
sum2 += sum1; sum2 += sum1;
} }
sum1 %= ADLER_MODULE; sum1 %= AdlerModule;
sum2 %= ADLER_MODULE; sum2 %= AdlerModule;
} }
preSum1 = (ushort)(sum1 & 0xFFFF); preSum1 = (ushort)(sum1 & 0xFFFF);

View File

@@ -41,9 +41,9 @@ namespace Aaru.Checksums;
public sealed class CRC16CcittContext : Crc16Context public sealed class CRC16CcittContext : Crc16Context
{ {
/// <summary>CCITT CRC16 polynomial</summary> /// <summary>CCITT CRC16 polynomial</summary>
public const ushort CRC16_CCITT_POLY = 0x8408; public const ushort CRC16CcittPoly = 0x8408;
/// <summary>CCITT CRC16 seed</summary> /// <summary>CCITT CRC16 seed</summary>
public const ushort CRC16_CCITT_SEED = 0x0000; public const ushort CRC16CcittSeed = 0x0000;
static readonly ushort[][] _ccittCrc16Table = static readonly ushort[][] _ccittCrc16Table =
[ [
[ [
@@ -226,11 +226,11 @@ public sealed class CRC16CcittContext : Crc16Context
/// <summary>Initializes an instance of the CRC16 with CCITT polynomial and seed.</summary> /// <summary>Initializes an instance of the CRC16 with CCITT polynomial and seed.</summary>
/// <inheritdoc /> /// <inheritdoc />
public CRC16CcittContext() : base(CRC16_CCITT_POLY, CRC16_CCITT_SEED, _ccittCrc16Table, true) {} public CRC16CcittContext() : base(CRC16CcittPoly, CRC16CcittSeed, _ccittCrc16Table, true) {}
public string Name => Localization.CRC16_CCITT_Name; public new string Name => Localization.CRC16_CCITT_Name;
public Guid Id => new("4C3BD0D5-24BD-4D45-BC19-A90A5AA5CC9D"); public new Guid Id => new("4C3BD0D5-24BD-4D45-BC19-A90A5AA5CC9D");
public string Author => Authors.NataliaPortillo; public new string Author => Authors.NataliaPortillo;
/// <summary>Gets the hash of a file</summary> /// <summary>Gets the hash of a file</summary>
/// <param name="filename">File path.</param> /// <param name="filename">File path.</param>
@@ -245,14 +245,14 @@ public sealed class CRC16CcittContext : Crc16Context
/// <param name="filename">File path.</param> /// <param name="filename">File path.</param>
/// <param name="hash">Byte array of the hash value.</param> /// <param name="hash">Byte array of the hash value.</param>
public static string File(string filename, out byte[] hash) => public static string File(string filename, out byte[] hash) =>
File(filename, out hash, CRC16_CCITT_POLY, CRC16_CCITT_SEED, _ccittCrc16Table, true); File(filename, out hash, CRC16CcittPoly, CRC16CcittSeed, _ccittCrc16Table, true);
/// <summary>Gets the hash of the specified data buffer.</summary> /// <summary>Gets the hash of the specified data buffer.</summary>
/// <param name="data">Data buffer.</param> /// <param name="data">Data buffer.</param>
/// <param name="len">Length of the data buffer to hash.</param> /// <param name="len">Length of the data buffer to hash.</param>
/// <param name="hash">Byte array of the hash value.</param> /// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, uint len, out byte[] hash) => public static string Data(byte[] data, uint len, out byte[] hash) =>
Data(data, len, out hash, CRC16_CCITT_POLY, CRC16_CCITT_SEED, _ccittCrc16Table, true); Data(data, len, out hash, CRC16CcittPoly, CRC16CcittSeed, _ccittCrc16Table, true);
/// <summary>Gets the hash of the specified data buffer.</summary> /// <summary>Gets the hash of the specified data buffer.</summary>
/// <param name="data">Data buffer.</param> /// <param name="data">Data buffer.</param>
@@ -262,5 +262,5 @@ public sealed class CRC16CcittContext : Crc16Context
/// <summary>Calculates the CCITT CRC16 of the specified buffer with the specified parameters</summary> /// <summary>Calculates the CCITT CRC16 of the specified buffer with the specified parameters</summary>
/// <param name="buffer">Buffer</param> /// <param name="buffer">Buffer</param>
public static ushort Calculate(byte[] buffer) => public static ushort Calculate(byte[] buffer) =>
Calculate(buffer, CRC16_CCITT_POLY, CRC16_CCITT_SEED, _ccittCrc16Table, true); Calculate(buffer, CRC16CcittPoly, CRC16CcittSeed, _ccittCrc16Table, true);
} }

View File

@@ -61,11 +61,11 @@ public partial class Crc16Context : IChecksum
_useNative = Native.IsSupported; _useNative = Native.IsSupported;
_useCcitt = polynomial == CRC16CcittContext.CRC16_CCITT_POLY && _useCcitt = polynomial == CRC16CcittContext.CRC16CcittPoly &&
seed == CRC16CcittContext.CRC16_CCITT_SEED && seed == CRC16CcittContext.CRC16CcittSeed &&
inverse; inverse;
_useIbm = polynomial == CRC16IbmContext.CRC16_IBM_POLY && seed == CRC16IbmContext.CRC16_IBM_SEED && !inverse; _useIbm = polynomial == CRC16IbmContext.CRC16IbmPoly && seed == CRC16IbmContext.CRC16IbmSeed && !inverse;
if(_useCcitt && _useNative) if(_useCcitt && _useNative)
{ {
@@ -369,13 +369,11 @@ public partial class Crc16Context : IChecksum
{ {
bool useNative = Native.IsSupported; bool useNative = Native.IsSupported;
bool useCcitt = polynomial == CRC16CcittContext.CRC16_CCITT_POLY && bool useCcitt = polynomial == CRC16CcittContext.CRC16CcittPoly &&
seed == CRC16CcittContext.CRC16_CCITT_SEED && seed == CRC16CcittContext.CRC16CcittSeed &&
inverse; inverse;
bool useIbm = polynomial == CRC16IbmContext.CRC16_IBM_POLY && bool useIbm = polynomial == CRC16IbmContext.CRC16IbmPoly && seed == CRC16IbmContext.CRC16IbmSeed && !inverse;
seed == CRC16IbmContext.CRC16_IBM_SEED &&
!inverse;
IntPtr nativeContext = IntPtr.Zero; IntPtr nativeContext = IntPtr.Zero;
@@ -474,13 +472,11 @@ public partial class Crc16Context : IChecksum
{ {
bool useNative = Native.IsSupported; bool useNative = Native.IsSupported;
bool useCcitt = polynomial == CRC16CcittContext.CRC16_CCITT_POLY && bool useCcitt = polynomial == CRC16CcittContext.CRC16CcittPoly &&
seed == CRC16CcittContext.CRC16_CCITT_SEED && seed == CRC16CcittContext.CRC16CcittSeed &&
inverse; inverse;
bool useIbm = polynomial == CRC16IbmContext.CRC16_IBM_POLY && bool useIbm = polynomial == CRC16IbmContext.CRC16IbmPoly && seed == CRC16IbmContext.CRC16IbmSeed && !inverse;
seed == CRC16IbmContext.CRC16_IBM_SEED &&
!inverse;
IntPtr nativeContext = IntPtr.Zero; IntPtr nativeContext = IntPtr.Zero;
@@ -565,13 +561,11 @@ public partial class Crc16Context : IChecksum
{ {
bool useNative = Native.IsSupported; bool useNative = Native.IsSupported;
bool useCcitt = polynomial == CRC16CcittContext.CRC16_CCITT_POLY && bool useCcitt = polynomial == CRC16CcittContext.CRC16CcittPoly &&
seed == CRC16CcittContext.CRC16_CCITT_SEED && seed == CRC16CcittContext.CRC16CcittSeed &&
inverse; inverse;
bool useIbm = polynomial == CRC16IbmContext.CRC16_IBM_POLY && bool useIbm = polynomial == CRC16IbmContext.CRC16IbmPoly && seed == CRC16IbmContext.CRC16IbmSeed && !inverse;
seed == CRC16IbmContext.CRC16_IBM_SEED &&
!inverse;
IntPtr nativeContext = IntPtr.Zero; IntPtr nativeContext = IntPtr.Zero;

View File

@@ -42,8 +42,8 @@ namespace Aaru.Checksums;
[SuppressMessage("ReSharper", "MemberCanBeInternal")] [SuppressMessage("ReSharper", "MemberCanBeInternal")]
public sealed class CRC16IbmContext : Crc16Context public sealed class CRC16IbmContext : Crc16Context
{ {
internal const ushort CRC16_IBM_POLY = 0xA001; internal const ushort CRC16IbmPoly = 0xA001;
internal const ushort CRC16_IBM_SEED = 0x0000; internal const ushort CRC16IbmSeed = 0x0000;
static readonly ushort[][] _ibmCrc16Table = static readonly ushort[][] _ibmCrc16Table =
[ [
@@ -227,16 +227,11 @@ public sealed class CRC16IbmContext : Crc16Context
/// <summary>Initializes an instance of the CRC16 with IBM polynomial and seed.</summary> /// <summary>Initializes an instance of the CRC16 with IBM polynomial and seed.</summary>
/// <inheritdoc /> /// <inheritdoc />
public CRC16IbmContext() : base(CRC16_IBM_POLY, CRC16_IBM_SEED, _ibmCrc16Table, false) {} public CRC16IbmContext() : base(CRC16IbmPoly, CRC16IbmSeed, _ibmCrc16Table, false) {}
/// <inheritdoc /> public new string Name => Localization.CRC16_IBM_Name;
public string Name => Localization.CRC16_IBM_Name; public new Guid Id => new("0470433E-0C78-4C37-8C9F-BD8E72340E78");
public new string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public Guid Id => new("0470433E-0C78-4C37-8C9F-BD8E72340E78");
/// <inheritdoc />
public string Author => Authors.NataliaPortillo;
/// <summary>Gets the hash of a file</summary> /// <summary>Gets the hash of a file</summary>
/// <param name="filename">File path.</param> /// <param name="filename">File path.</param>
@@ -253,14 +248,14 @@ public sealed class CRC16IbmContext : Crc16Context
/// <param name="filename">File path.</param> /// <param name="filename">File path.</param>
/// <param name="hash">Byte array of the hash value.</param> /// <param name="hash">Byte array of the hash value.</param>
public static string File(string filename, out byte[] hash) => public static string File(string filename, out byte[] hash) =>
File(filename, out hash, CRC16_IBM_POLY, CRC16_IBM_SEED, _ibmCrc16Table, false); File(filename, out hash, CRC16IbmPoly, CRC16IbmSeed, _ibmCrc16Table, false);
/// <summary>Gets the hash of the specified data buffer.</summary> /// <summary>Gets the hash of the specified data buffer.</summary>
/// <param name="data">Data buffer.</param> /// <param name="data">Data buffer.</param>
/// <param name="len">Length of the data buffer to hash.</param> /// <param name="len">Length of the data buffer to hash.</param>
/// <param name="hash">Byte array of the hash value.</param> /// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, uint len, out byte[] hash) => public static string Data(byte[] data, uint len, out byte[] hash) =>
Data(data, len, out hash, CRC16_IBM_POLY, CRC16_IBM_SEED, _ibmCrc16Table, false); Data(data, len, out hash, CRC16IbmPoly, CRC16IbmSeed, _ibmCrc16Table, false);
/// <summary>Gets the hash of the specified data buffer.</summary> /// <summary>Gets the hash of the specified data buffer.</summary>
/// <param name="data">Data buffer.</param> /// <param name="data">Data buffer.</param>

View File

@@ -71,7 +71,7 @@ static class Neon
while(blocks != 0) while(blocks != 0)
{ {
uint n = Fletcher32Context.NMAX / block_Size; /* The NMAX constraint. */ uint n = Fletcher32Context.Nmax / block_Size; /* The NMAX constraint. */
if(n > blocks) n = blocks; if(n > blocks) n = blocks;
@@ -200,8 +200,8 @@ static class Neon
/* /*
* Reduce. * Reduce.
*/ */
s1 %= Fletcher32Context.FLETCHER_MODULE; s1 %= Fletcher32Context.FletcherModule;
s2 %= Fletcher32Context.FLETCHER_MODULE; s2 %= Fletcher32Context.FletcherModule;
} }
/* /*
@@ -232,9 +232,9 @@ static class Neon
while(len-- != 0) s2 += s1 += buf[bufPos++]; while(len-- != 0) s2 += s1 += buf[bufPos++];
if(s1 >= Fletcher32Context.FLETCHER_MODULE) s1 -= Fletcher32Context.FLETCHER_MODULE; if(s1 >= Fletcher32Context.FletcherModule) s1 -= Fletcher32Context.FletcherModule;
s2 %= Fletcher32Context.FLETCHER_MODULE; s2 %= Fletcher32Context.FletcherModule;
} }
/* /*

View File

@@ -68,7 +68,7 @@ static class Ssse3
while(blocks != 0) while(blocks != 0)
{ {
uint n = Fletcher32Context.NMAX / block_Size; /* The NMAX constraint. */ uint n = Fletcher32Context.Nmax / block_Size; /* The NMAX constraint. */
if(n > blocks) n = blocks; if(n > blocks) n = blocks;
@@ -142,8 +142,8 @@ static class Ssse3
/* /*
* Reduce. * Reduce.
*/ */
s1 %= Fletcher32Context.FLETCHER_MODULE; s1 %= Fletcher32Context.FletcherModule;
s2 %= Fletcher32Context.FLETCHER_MODULE; s2 %= Fletcher32Context.FletcherModule;
} }
/* /*
@@ -174,9 +174,9 @@ static class Ssse3
while(len-- != 0) s2 += s1 += buf[bufPos++]; while(len-- != 0) s2 += s1 += buf[bufPos++];
if(s1 >= Fletcher32Context.FLETCHER_MODULE) s1 -= Fletcher32Context.FLETCHER_MODULE; if(s1 >= Fletcher32Context.FletcherModule) s1 -= Fletcher32Context.FletcherModule;
s2 %= Fletcher32Context.FLETCHER_MODULE; s2 %= Fletcher32Context.FletcherModule;
} }
/* /*

View File

@@ -52,8 +52,8 @@ namespace Aaru.Checksums;
[SuppressMessage("ReSharper", "UnusedMember.Global")] [SuppressMessage("ReSharper", "UnusedMember.Global")]
public sealed partial class Fletcher32Context : IChecksum public sealed partial class Fletcher32Context : IChecksum
{ {
internal const ushort FLETCHER_MODULE = 0xFFFF; internal const ushort FletcherModule = 0xFFFF;
internal const uint NMAX = 5552; internal const uint Nmax = 5552;
readonly IntPtr _nativeContext; readonly IntPtr _nativeContext;
readonly bool _useNative; readonly bool _useNative;
ushort _sum1, _sum2; ushort _sum1, _sum2;
@@ -175,11 +175,11 @@ public sealed partial class Fletcher32Context : IChecksum
{ {
sum1 += data[dataOff]; sum1 += data[dataOff];
if(sum1 >= FLETCHER_MODULE) sum1 -= FLETCHER_MODULE; if(sum1 >= FletcherModule) sum1 -= FletcherModule;
sum2 += sum1; sum2 += sum1;
if(sum2 >= FLETCHER_MODULE) sum2 -= FLETCHER_MODULE; if(sum2 >= FletcherModule) sum2 -= FletcherModule;
previousSum1 = (ushort)(sum1 & 0xFFFF); previousSum1 = (ushort)(sum1 & 0xFFFF);
previousSum2 = (ushort)(sum2 & 0xFFFF); previousSum2 = (ushort)(sum2 & 0xFFFF);
@@ -195,9 +195,9 @@ public sealed partial class Fletcher32Context : IChecksum
sum2 += sum1; sum2 += sum1;
} }
if(sum1 >= FLETCHER_MODULE) sum1 -= FLETCHER_MODULE; if(sum1 >= FletcherModule) sum1 -= FletcherModule;
sum2 %= FLETCHER_MODULE; /* only added so many FLETCHER_MODULE's */ sum2 %= FletcherModule; /* only added so many FLETCHER_MODULE's */
previousSum1 = (ushort)(sum1 & 0xFFFF); previousSum1 = (ushort)(sum1 & 0xFFFF);
previousSum2 = (ushort)(sum2 & 0xFFFF); previousSum2 = (ushort)(sum2 & 0xFFFF);
@@ -206,10 +206,10 @@ public sealed partial class Fletcher32Context : IChecksum
} }
/* do length NMAX blocks -- requires just one modulo operation */ /* do length NMAX blocks -- requires just one modulo operation */
while(len >= NMAX) while(len >= Nmax)
{ {
len -= NMAX; len -= Nmax;
uint n = NMAX / 16; uint n = Nmax / 16;
do do
{ {
@@ -250,8 +250,8 @@ public sealed partial class Fletcher32Context : IChecksum
dataOff += 16; dataOff += 16;
} while(--n != 0); } while(--n != 0);
sum1 %= FLETCHER_MODULE; sum1 %= FletcherModule;
sum2 %= FLETCHER_MODULE; sum2 %= FletcherModule;
} }
/* do remaining bytes (less than NMAX, still just one modulo) */ /* do remaining bytes (less than NMAX, still just one modulo) */
@@ -303,8 +303,8 @@ public sealed partial class Fletcher32Context : IChecksum
sum2 += sum1; sum2 += sum1;
} }
sum1 %= FLETCHER_MODULE; sum1 %= FletcherModule;
sum2 %= FLETCHER_MODULE; sum2 %= FletcherModule;
} }
previousSum1 = (ushort)(sum1 & 0xFFFF); previousSum1 = (ushort)(sum1 & 0xFFFF);

View File

@@ -40,8 +40,6 @@ namespace Aaru.Core;
/// <summary>Image information operations</summary> /// <summary>Image information operations</summary>
public static class ArchiveInfo public static class ArchiveInfo
{ {
const string MODULE_NAME = "Archive information";
/// <summary>Prints archive information to console</summary> /// <summary>Prints archive information to console</summary>
/// <param name="imageFormat">Archive</param> /// <param name="imageFormat">Archive</param>
public static void PrintArchiveInfo(IArchive imageFormat, IFilter filter, Encoding encoding) public static void PrintArchiveInfo(IArchive imageFormat, IFilter filter, Encoding encoding)

View File

@@ -67,52 +67,52 @@ sealed partial class Dump
/// <summary>Dumps a compact disc</summary> /// <summary>Dumps a compact disc</summary>
void CompactDisc() void CompactDisc()
{ {
ExtentsULong audioExtents; // Extents with audio sectors ExtentsULong audioExtents; // Extents with audio sectors
ulong blocks; // Total number of positive sectors ulong blocks; // Total number of positive sectors
uint blockSize; // Size of the read sector in bytes uint blockSize; // Size of the read sector in bytes
CdOffset cdOffset; // Read offset from database CdOffset cdOffset; // Read offset from database
byte[] cmdBuf; // Data buffer byte[] cmdBuf; // Data buffer
DumpHardware currentTry = null; // Current dump hardware try DumpHardware currentTry = null; // Current dump hardware try
double currentSpeed = 0; // Current read speed double currentSpeed = 0; // Current read speed
int? discOffset = null; // Disc write offset int? discOffset = null; // Disc write offset
ExtentsULong extents = null; // Extents ExtentsULong extents = null; // Extents
bool hiddenData; // Hidden track is data bool hiddenData; // Hidden track is data
IbgLog ibgLog; // IMGBurn log IbgLog ibgLog; // IMGBurn log
double imageWriteDuration = 0; // Duration of image write double imageWriteDuration = 0; // Duration of image write
long lastSector; // Last sector number long lastSector; // Last sector number
var leadOutExtents = new ExtentsULong(); // Lead-out extents var leadOutExtents = new ExtentsULong(); // Lead-out extents
Dictionary<int, long> leadOutStarts = new(); // Lead-out starts Dictionary<int, long> leadOutStarts = new(); // Lead-out starts
double maxSpeed = double.MinValue; // Maximum speed double maxSpeed = double.MinValue; // Maximum speed
MhddLog mhddLog; // MHDD log MhddLog mhddLog; // MHDD log
double minSpeed = double.MaxValue; // Minimum speed double minSpeed = double.MaxValue; // Minimum speed
bool newTrim; // Is trim a new one? bool newTrim; // Is trim a new one?
var offsetBytes = 0; // Read offset var offsetBytes = 0; // Read offset
var read6 = false; // Device supports READ(6) var read6 = false; // Device supports READ(6)
var read10 = false; // Device supports READ(10) var read10 = false; // Device supports READ(10)
var read12 = false; // Device supports READ(12) var read12 = false; // Device supports READ(12)
var read16 = false; // Device supports READ(16) var read16 = false; // Device supports READ(16)
var readcd = true; // Device supports READ CD var readcd = true; // Device supports READ CD
bool ret; // Image writing return status bool ret; // Image writing return status
const uint sectorSize = 2352; // Full sector size const uint sectorSize = 2352; // Full sector size
var sectorsForOffset = 0; // Sectors needed to fix offset var sectorsForOffset = 0; // Sectors needed to fix offset
var sense = true; // Sense indicator var sense = true; // Sense indicator
int sessions; // Number of sessions in disc int sessions; // Number of sessions in disc
SubchannelLog subLog = null; // Subchannel log SubchannelLog subLog = null; // Subchannel log
uint subSize = 0; // Subchannel size in bytes uint subSize = 0; // Subchannel size in bytes
TrackSubchannelType subType = TrackSubchannelType.None; // Track subchannel type TrackSubchannelType subType; // Track subchannel type
var supportsLongSectors = true; // Supports reading EDC and ECC var supportsLongSectors = true; // Supports reading EDC and ECC
bool supportsPqSubchannel; // Supports reading PQ subchannel bool supportsPqSubchannel; // Supports reading PQ subchannel
bool supportsRwSubchannel; // Supports reading RW subchannel bool supportsRwSubchannel; // Supports reading RW subchannel
byte[] tmpBuf; // Temporary buffer byte[] tmpBuf; // Temporary buffer
FullTOC.CDFullTOC? toc; // Full CD TOC FullTOC.CDFullTOC? toc; // Full CD TOC
double totalDuration = 0; // Total commands duration double totalDuration = 0; // Total commands duration
Dictionary<byte, byte> trackFlags = new(); // Track flags Dictionary<byte, byte> trackFlags = new(); // Track flags
Track[] tracks; // Tracks in disc Track[] tracks; // Tracks in disc
int firstTrackLastSession; // Number of first track in last session int firstTrackLastSession; // Number of first track in last session
bool hiddenTrack; // Disc has a hidden track before track 1 bool hiddenTrack; // Disc has a hidden track before track 1
MmcSubchannel supportedSubchannel; // Drive's maximum supported subchannel MmcSubchannel supportedSubchannel; // Drive's maximum supported subchannel
MmcSubchannel desiredSubchannel; // User requested subchannel MmcSubchannel desiredSubchannel; // User requested subchannel
var bcdSubchannel = false; // Subchannel positioning is in BCD var bcdSubchannel = false; // Subchannel positioning is in BCD
Dictionary<byte, string> isrcs = new(); Dictionary<byte, string> isrcs = new();
string mcn = null; string mcn = null;
HashSet<int> subchannelExtents = []; HashSet<int> subchannelExtents = [];
@@ -375,13 +375,11 @@ sealed partial class Dump
UpdateStatus?.Invoke(Localization.Core.Drive_can_read_without_subchannel); UpdateStatus?.Invoke(Localization.Core.Drive_can_read_without_subchannel);
subSize = 0; subSize = 0;
subType = TrackSubchannelType.None;
break; break;
case MmcSubchannel.Raw: case MmcSubchannel.Raw:
_dumpLog.WriteLine(Localization.Core.Full_raw_subchannel_reading_supported); _dumpLog.WriteLine(Localization.Core.Full_raw_subchannel_reading_supported);
UpdateStatus?.Invoke(Localization.Core.Full_raw_subchannel_reading_supported); UpdateStatus?.Invoke(Localization.Core.Full_raw_subchannel_reading_supported);
subType = TrackSubchannelType.Raw;
subSize = 96; subSize = 96;
break; break;
@@ -392,7 +390,6 @@ sealed partial class Dump
UpdateStatus?.Invoke(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect); UpdateStatus?.Invoke(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
subType = TrackSubchannelType.Q16;
subSize = 16; subSize = 16;
break; break;
@@ -401,7 +398,8 @@ sealed partial class Dump
subType = desiredSubchannel switch subType = desiredSubchannel switch
{ {
MmcSubchannel.None => TrackSubchannelType.None, MmcSubchannel.None => TrackSubchannelType.None,
MmcSubchannel.Raw or MmcSubchannel.Q16 => TrackSubchannelType.Raw MmcSubchannel.Raw or MmcSubchannel.Q16 => TrackSubchannelType.Raw,
_ => throw new ArgumentOutOfRangeException()
}; };
blockSize = sectorSize + subSize; blockSize = sectorSize + subSize;
@@ -1103,8 +1101,9 @@ sealed partial class Dump
foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub); foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub);
if(_resume.NextBlock < blocks) if(_resume.NextBlock < blocks)
for(ulong i = _resume.NextBlock; i < blocks; i++) {
subchannelExtents.Add((int)i); for(ulong i = _resume.NextBlock; i < blocks; i++) subchannelExtents.Add((int)i);
}
} }
if(_resume.NextBlock > 0) if(_resume.NextBlock > 0)
@@ -1593,8 +1592,9 @@ sealed partial class Dump
supportsLongSectors); supportsLongSectors);
foreach(Tuple<ulong, ulong> leadoutExtent in leadOutExtents.ToArray()) foreach(Tuple<ulong, ulong> leadoutExtent in leadOutExtents.ToArray())
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) {
subchannelExtents.Remove((int)e); for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) subchannelExtents.Remove((int)e);
}
if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel) if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel)
{ {

View File

@@ -145,7 +145,7 @@ partial class Dump
} }
else else
{ {
if(dcMode6?.Pages != null) if(dcMode6.Value.Pages != null)
{ {
foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage => modePage is foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage => modePage is
{ {
@@ -469,8 +469,9 @@ partial class Dump
// MEDIUM ERROR, retry with ignore error below // MEDIUM ERROR, retry with ignore error below
if(decSense is { ASC: 0x11 }) if(decSense is { ASC: 0x11 })
if(!sectorsNotEvenPartial.Contains(badSector)) {
sectorsNotEvenPartial.Add(badSector); if(!sectorsNotEvenPartial.Contains(badSector)) sectorsNotEvenPartial.Add(badSector);
}
} }
// Because one block has been partially used to fix the offset // Because one block has been partially used to fix the offset

View File

@@ -285,8 +285,9 @@ partial class Dump
Modes.DecodedMode? decMode = null; Modes.DecodedMode? decMode = null;
if(!sense && !_dev.Error) if(!sense && !_dev.Error)
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue) {
decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType); if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType);
}
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6); UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
@@ -314,8 +315,9 @@ partial class Dump
if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration); if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration);
if(!sense && !_dev.Error) if(!sense && !_dev.Error)
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue) {
decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType); if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType);
}
// TODO: Check partitions page // TODO: Check partitions page
if(decMode.HasValue) if(decMode.HasValue)
@@ -1249,7 +1251,7 @@ partial class Dump
var forward = false; var forward = false;
const bool runningPersistent = false; const bool runningPersistent = false;
Modes.ModePage? currentModePage = null; Modes.ModePage? currentModePage;
if(_persistent) if(_persistent)
{ {

View File

@@ -94,7 +94,7 @@ partial class Dump
opticalDisc = dskType switch opticalDisc = dskType switch
{ {
MediaType.REV35 or MediaType.REV70 or MediaType.REV120 => false, MediaType.REV35 or MediaType.REV70 or MediaType.REV120 => false,
_ => opticalDisc _ => true
}; };
} }

View File

@@ -109,7 +109,7 @@ partial class Dump
} }
else else
{ {
if(dcMode6?.Pages != null) if(dcMode6.Value.Pages != null)
{ {
foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage => modePage is foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage => modePage is
{ {

View File

@@ -843,7 +843,7 @@ public static class ImageInfo
} }
} }
if(imageFormat is IFluxImage fluxImage) AaruConsole.WriteLine(Localization.Core.Image_flux_captures); if(imageFormat is IFluxImage) AaruConsole.WriteLine(Localization.Core.Image_flux_captures);
if(imageFormat is not IOpticalMediaImage opticalImage) return; if(imageFormat is not IOpticalMediaImage opticalImage) return;

View File

@@ -124,8 +124,10 @@ public static class Remote
foreach(string migration in mctx.Database.GetPendingMigrations()) foreach(string migration in mctx.Database.GetPendingMigrations())
{ {
mctx.Database mctx.Database
#pragma warning disable EF1002
.ExecuteSqlRaw($"INSERT INTO \"__EFMigrationsHistory\" (MigrationId, ProductVersion) VALUES ('{ .ExecuteSqlRaw($"INSERT INTO \"__EFMigrationsHistory\" (MigrationId, ProductVersion) VALUES ('{
migration}', '0.0.0')"); migration}', '0.0.0')");
#pragma warning restore EF1002
} }
} }
else else

View File

@@ -8329,9 +8329,6 @@
</data> </data>
<data name="Software_write_protect_is_enabled" xml:space="preserve"> <data name="Software_write_protect_is_enabled" xml:space="preserve">
<value>La protección contra escritura está activada</value> <value>La protección contra escritura está activada</value>
</data>
<data name="Software_write_protect_is_enabled" xml:space="preserve">
<value>La protección contra escritura está activada</value>
</data> </data>
<data name="Spare_Area_Full_Flags_0" xml:space="preserve"> <data name="Spare_Area_Full_Flags_0" xml:space="preserve">
<value>Valores completos del área de reserva: 0x{0:X2}</value> <value>Valores completos del área de reserva: 0x{0:X2}</value>

View File

@@ -7453,9 +7453,6 @@
</data> </data>
<data name="Port_A_link_is_down" xml:space="preserve"> <data name="Port_A_link_is_down" xml:space="preserve">
<value>Port A link is down</value> <value>Port A link is down</value>
</data>
<data name="Port_A_uses_Parallel_SCSI_Ultra_160_interface" xml:space="preserve">
<value>Port A uses Parallel SCSI Ultra-160 interface</value>
</data> </data>
<data name="Unknown_port_A_transport_type_code_0" xml:space="preserve"> <data name="Unknown_port_A_transport_type_code_0" xml:space="preserve">
<value>Unknown port A transport type code {0}</value> <value>Unknown port A transport type code {0}</value>

View File

@@ -251,7 +251,7 @@ public static class CIS
continue; continue;
} }
if(strings == null) strings = []; strings ??= [];
strings.Add(StringHandlers.CToString(buffer.ToArray())); strings.Add(StringHandlers.CToString(buffer.ToArray()));
buffer = []; buffer = [];

View File

@@ -130,7 +130,7 @@ public static partial class Modes
double blocks; double blocks;
if(page.LBAFormat == 8) if(page.LBAFormat == 8)
blocks = page.BlocksPerSecondOfAudio * (1 / 256); blocks = page.BlocksPerSecondOfAudio * (1 / 256f);
else else
blocks = page.BlocksPerSecondOfAudio; blocks = page.BlocksPerSecondOfAudio;

View File

@@ -912,8 +912,8 @@ public class CSS
for(i = 0; i < 4; i++) for(i = 0; i < 4; i++)
{ {
lfsr1Lo = lfsr0 & 0xff; lfsr1Lo = lfsr0 & 0xff;
lfsr0 = lfsr0 >> 8; lfsr0 >>= 8;
for(uint j = 0; j < 256; j++) for(uint j = 0; j < 256; j++)
{ {

View File

@@ -39,7 +39,7 @@ namespace Aaru.Devices;
public partial class Device public partial class Device
{ {
protected static bool ReadMultipleBlockCannotSetBlockCount; protected static bool _readMultipleBlockCannotSetBlockCount;
/// <summary>Reads the CSD register from a SecureDigital or MultiMediaCard device</summary> /// <summary>Reads the CSD register from a SecureDigital or MultiMediaCard device</summary>
/// <param name="buffer">Data buffer</param> /// <param name="buffer">Data buffer</param>
@@ -212,7 +212,7 @@ public partial class Device
if(transferLength <= 1) if(transferLength <= 1)
return ReadSingleBlock(out buffer, out response, lba, blockSize, byteAddressed, timeout, out duration); return ReadSingleBlock(out buffer, out response, lba, blockSize, byteAddressed, timeout, out duration);
if(!ReadMultipleBlockCannotSetBlockCount) if(!_readMultipleBlockCannotSetBlockCount)
{ {
sense = ReadMultipleBlock(out buffer, sense = ReadMultipleBlock(out buffer,
out response, out response,
@@ -224,7 +224,7 @@ public partial class Device
out duration); out duration);
} }
if(ReadMultipleBlockCannotSetBlockCount) if(_readMultipleBlockCannotSetBlockCount)
{ {
return ReadMultipleUsingSingle(out buffer, return ReadMultipleUsingSingle(out buffer,
out response, out response,

View File

@@ -96,7 +96,7 @@ partial class Device : Devices.Device
} }
// Seems ioctl(2) does not allow the atomicity needed // Seems ioctl(2) does not allow the atomicity needed
if(dev.PlatformId == PlatformID.Linux) ReadMultipleBlockCannotSetBlockCount = true; if(dev.PlatformId == PlatformID.Linux) _readMultipleBlockCannotSetBlockCount = true;
dev.Type = DeviceType.Unknown; dev.Type = DeviceType.Unknown;
dev.ScsiType = PeripheralDeviceTypes.UnknownDevice; dev.ScsiType = PeripheralDeviceTypes.UnknownDevice;

View File

@@ -132,7 +132,7 @@ public sealed partial class Device : Devices.Device
return null; return null;
} }
if(dev._remote.ServerOperatingSystem == "Linux") ReadMultipleBlockCannotSetBlockCount = true; if(dev._remote.ServerOperatingSystem == "Linux") _readMultipleBlockCannotSetBlockCount = true;
dev.Type = DeviceType.Unknown; dev.Type = DeviceType.Unknown;
dev.ScsiType = PeripheralDeviceTypes.UnknownDevice; dev.ScsiType = PeripheralDeviceTypes.UnknownDevice;

View File

@@ -219,9 +219,8 @@ public sealed partial class LisaFS
if(!_mounted || !_debug) return ErrorNumber.AccessDenied; if(!_mounted || !_debug) return ErrorNumber.AccessDenied;
if(fileId is > 4 or <= 0) if(fileId is > 4 or <= 0)
{ if(fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED)
if(fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED) return ErrorNumber.InvalidArgument; return ErrorNumber.InvalidArgument;
}
if(_systemFileCache.TryGetValue(fileId, out buf) && !tags) return ErrorNumber.NoError; if(_systemFileCache.TryGetValue(fileId, out buf) && !tags) return ErrorNumber.NoError;
@@ -306,6 +305,7 @@ public sealed partial class LisaFS
if(fileId <= 4) if(fileId <= 4)
{ {
if(!_debug || fileId == 0) return ErrorNumber.NoSuchFile; if(!_debug || fileId == 0) return ErrorNumber.NoSuchFile;
stat = new FileEntryInfo(); stat = new FileEntryInfo();
error = GetAttributes(fileId, out FileAttributes attrs); error = GetAttributes(fileId, out FileAttributes attrs);
@@ -435,9 +435,8 @@ public sealed partial class LisaFS
if(!tags) if(!tags)
{ {
if(_fileSizeCache.TryGetValue(fileId, out int realSize)) if(_fileSizeCache.TryGetValue(fileId, out int realSize))
{ if(realSize > temp.Length)
if(realSize > temp.Length) AaruConsole.ErrorWriteLine(Localization.File_0_gets_truncated, fileId); AaruConsole.ErrorWriteLine(Localization.File_0_gets_truncated, fileId);
}
buf = temp; buf = temp;

View File

@@ -149,8 +149,10 @@ public sealed class SplashWindowViewModel(SplashWindow view) : ViewModelBase
foreach(string migration in ctx.Database.GetPendingMigrations()) foreach(string migration in ctx.Database.GetPendingMigrations())
{ {
ctx.Database ctx.Database
#pragma warning disable EF1002
.ExecuteSqlRaw($"INSERT INTO \"__EFMigrationsHistory\" (MigrationId, ProductVersion) VALUES ('{ .ExecuteSqlRaw($"INSERT INTO \"__EFMigrationsHistory\" (MigrationId, ProductVersion) VALUES ('{
migration}', '0.0.0')"); migration}', '0.0.0')");
#pragma warning restore EF1002
} }
ctx.SaveChanges(); ctx.SaveChanges();

View File

@@ -1926,9 +1926,8 @@ public sealed partial class AaruFormat
// Fill FLAC block // Fill FLAC block
if(remaining != 0) if(remaining != 0)
{ for(var r = 0; r < remaining * 4; r++)
for(var r = 0; r < remaining * 4; r++) _writingBuffer[_writingBufferPosition + r] = 0; _writingBuffer[_writingBufferPosition + r] = 0;
}
compressedLength = FLAC.EncodeBuffer(_writingBuffer, compressedLength = FLAC.EncodeBuffer(_writingBuffer,
_compressedBuffer, _compressedBuffer,
@@ -2720,9 +2719,8 @@ public sealed partial class AaruFormat
// Fill FLAC block // Fill FLAC block
if(remaining != 0) if(remaining != 0)
{ for(var r = 0; r < remaining * 4; r++)
for(var r = 0; r < remaining * 4; r++) _writingBuffer[_writingBufferPosition + r] = 0; _writingBuffer[_writingBufferPosition + r] = 0;
}
compressedLength = FLAC.EncodeBuffer(_writingBuffer, compressedLength = FLAC.EncodeBuffer(_writingBuffer,
_compressedBuffer, _compressedBuffer,
@@ -5262,8 +5260,7 @@ public sealed partial class AaruFormat
foreach(IndexEntry entry in _index) foreach(IndexEntry entry in _index)
{ {
_structureBytes = new byte[Marshal.SizeOf<IndexEntry>()]; _structureBytes = new byte[Marshal.SizeOf<IndexEntry>()];
IndexEntry indexEntry = entry; MemoryMarshal.Write(_structureBytes, in entry);
MemoryMarshal.Write(_structureBytes, in indexEntry);
blockStream.Write(_structureBytes, 0, _structureBytes.Length); blockStream.Write(_structureBytes, 0, _structureBytes.Length);
} }

View File

@@ -92,7 +92,7 @@ public class MasterSystem : IByteAddressableImage
// Not sure but seems to be a multiple of at least this, maybe more // Not sure but seems to be a multiple of at least this, maybe more
if(stream.Length % 8192 != 0) return ErrorNumber.InvalidArgument; if(stream.Length % 8192 != 0) return ErrorNumber.InvalidArgument;
var headerPosition = 0; int headerPosition;
stream.Position = 0x7ff0; stream.Position = 0x7ff0;
var magicBytes = new byte[8]; var magicBytes = new byte[8];

View File

@@ -235,8 +235,7 @@ public sealed partial class DiskCopy42
<= 28 => 18, <= 28 => 18,
<= 34 => 17, <= 34 => 17,
<= 41 => 16, <= 41 => 16,
<= 45 => 15, <= 45 => 15
_ => sectorsToCopy
}; };
Array.Copy(data, Array.Copy(data,

View File

@@ -423,9 +423,9 @@ public sealed partial class DiskCopy42
} }
/// <inheritdoc /> /// <inheritdoc />
public bool SetImageInfo(ImageInfo imageInfo) public bool SetImageInfo(ImageInfo info)
{ {
header.DiskName = imageInfo.MediaTitle ?? "-Aaru converted image-"; header.DiskName = info.MediaTitle ?? "-Aaru converted image-";
return true; return true;
} }

View File

@@ -93,10 +93,9 @@ public sealed partial class KryoFlux
if(!File.Exists(trackfile)) if(!File.Exists(trackfile))
{ {
if(cylinder == 0) switch(cylinder)
{ {
if(head == 0) case 0 when head == 0:
{
AaruConsole.DebugWriteLine(MODULE_NAME, AaruConsole.DebugWriteLine(MODULE_NAME,
Localization Localization
.Cannot_find_cyl_0_hd_0_supposing_only_top_head_was_dumped); .Cannot_find_cyl_0_hd_0_supposing_only_top_head_was_dumped);
@@ -105,24 +104,21 @@ public sealed partial class KryoFlux
heads = 1; heads = 1;
continue; continue;
} case 0:
AaruConsole.DebugWriteLine(MODULE_NAME,
Localization
.Cannot_find_cyl_0_hd_1_supposing_only_bottom_head_was_dumped);
AaruConsole.DebugWriteLine(MODULE_NAME, heads = 1;
Localization
.Cannot_find_cyl_0_hd_1_supposing_only_bottom_head_was_dumped);
heads = 1; continue;
case 1:
AaruConsole.DebugWriteLine(MODULE_NAME,
Localization.Cannot_find_cyl_1_supposing_double_stepping);
continue; step = 2;
}
if(cylinder == 1) continue;
{
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Cannot_find_cyl_1_supposing_double_stepping);
step = 2;
continue;
} }
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Arrived_end_of_disk_at_cylinder_0, cylinder); AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Arrived_end_of_disk_at_cylinder_0, cylinder);

View File

@@ -2949,4 +2949,7 @@
<data name="Create_a_dynamic_image" xml:space="preserve"> <data name="Create_a_dynamic_image" xml:space="preserve">
<value>Crear una imagen dinámica, los sectores vacíos se ignoran</value> <value>Crear una imagen dinámica, los sectores vacíos se ignoran</value>
</data> </data>
<data name="A2R_Name" xml:space="preserve">
<value>A2R</value>
</data>
</root> </root>

View File

@@ -942,9 +942,6 @@
</data> </data>
<data name="Dumping_Xbox_Game_Discs_requires_a_drive_with_Kreon_firmware" xml:space="preserve"> <data name="Dumping_Xbox_Game_Discs_requires_a_drive_with_Kreon_firmware" xml:space="preserve">
<value>Volcar discos de Xbox requiere una unidad con firmware Kreon.</value> <value>Volcar discos de Xbox requiere una unidad con firmware Kreon.</value>
</data>
<data name="Dumping_Xbox_Game_Discs_requires_a_drive_with_Kreon_firmware" xml:space="preserve">
<value>Volcar discos de Xbox requiere una unidad con firmware Kreon.</value>
</data> </data>
<data name="Dump_Ata_Output_format_does_not_support_ATA_IDENTIFY_" xml:space="preserve"> <data name="Dump_Ata_Output_format_does_not_support_ATA_IDENTIFY_" xml:space="preserve">
<value>El formato de salida no soporta ATA IDENTIFY.</value> <value>El formato de salida no soporta ATA IDENTIFY.</value>

View File

@@ -3026,4 +3026,7 @@ Probadores:
<data name="LogEntry_Type_Exception" xml:space="preserve"> <data name="LogEntry_Type_Exception" xml:space="preserve">
<value>Excepción</value> <value>Excepción</value>
</data> </data>
<data name="CD_PMA" xml:space="preserve">
<value>CD PMA:</value>
</data>
</root> </root>

View File

@@ -217,25 +217,23 @@ public sealed class AtariPartitions : IPartition
Offset = table.Entries[i].Start * sectorSize, Offset = table.Entries[i].Start * sectorSize,
Start = table.Entries[i].Start, Start = table.Entries[i].Start,
Type = Encoding.ASCII.GetString(partType), Type = Encoding.ASCII.GetString(partType),
Scheme = Name Scheme = Name,
Description = type switch
{
TYPE_GEMDOS => Localization.Atari_GEMDOS_partition,
TYPE_BIG_GEMDOS => Localization.Atari_GEMDOS_partition_bigger_than_32_MiB,
TYPE_LINUX => Localization.Linux_partition,
TYPE_SWAP => Localization.Swap_partition,
TYPE_RAW => Localization.RAW_partition,
TYPE_NETBSD => Localization.NetBSD_partition,
TYPE_NETBSD_SWAP => Localization.NetBSD_swap_partition,
TYPE_SYSTEM_V => Localization.Atari_UNIX_partition,
TYPE_MAC => Localization.Macintosh_partition,
TYPE_MINIX or TYPE_MINIX2 => Localization.MINIX_partition,
_ => Localization.Unknown_partition_type
}
}; };
part.Description = type switch
{
TYPE_GEMDOS => Localization.Atari_GEMDOS_partition,
TYPE_BIG_GEMDOS => Localization
.Atari_GEMDOS_partition_bigger_than_32_MiB,
TYPE_LINUX => Localization.Linux_partition,
TYPE_SWAP => Localization.Swap_partition,
TYPE_RAW => Localization.RAW_partition,
TYPE_NETBSD => Localization.NetBSD_partition,
TYPE_NETBSD_SWAP => Localization.NetBSD_swap_partition,
TYPE_SYSTEM_V => Localization.Atari_UNIX_partition,
TYPE_MAC => Localization.Macintosh_partition,
TYPE_MINIX or TYPE_MINIX2 => Localization.MINIX_partition,
_ => Localization.Unknown_partition_type
};
partitions.Add(part); partitions.Add(part);
partitionSequence++; partitionSequence++;
} }
@@ -308,25 +306,23 @@ public sealed class AtariPartitions : IPartition
Offset = extendedTable.Entries[j].Start * sectorSize, Offset = extendedTable.Entries[j].Start * sectorSize,
Start = extendedTable.Entries[j].Start, Start = extendedTable.Entries[j].Start,
Type = Encoding.ASCII.GetString(partType), Type = Encoding.ASCII.GetString(partType),
Scheme = Name Scheme = Name,
Description = extendedType switch
{
TYPE_GEMDOS => Localization.Atari_GEMDOS_partition,
TYPE_BIG_GEMDOS => Localization.Atari_GEMDOS_partition_bigger_than_32_MiB,
TYPE_LINUX => Localization.Linux_partition,
TYPE_SWAP => Localization.Swap_partition,
TYPE_RAW => Localization.RAW_partition,
TYPE_NETBSD => Localization.NetBSD_partition,
TYPE_NETBSD_SWAP => Localization.NetBSD_swap_partition,
TYPE_SYSTEM_V => Localization.Atari_UNIX_partition,
TYPE_MAC => Localization.Macintosh_partition,
TYPE_MINIX or TYPE_MINIX2 => Localization.MINIX_partition,
_ => Localization.Unknown_partition_type
}
}; };
part.Description = extendedType switch
{
TYPE_GEMDOS => Localization.Atari_GEMDOS_partition,
TYPE_BIG_GEMDOS => Localization
.Atari_GEMDOS_partition_bigger_than_32_MiB,
TYPE_LINUX => Localization.Linux_partition,
TYPE_SWAP => Localization.Swap_partition,
TYPE_RAW => Localization.RAW_partition,
TYPE_NETBSD => Localization.NetBSD_partition,
TYPE_NETBSD_SWAP => Localization.NetBSD_swap_partition,
TYPE_SYSTEM_V => Localization.Atari_UNIX_partition,
TYPE_MAC => Localization.Macintosh_partition,
TYPE_MINIX or TYPE_MINIX2 => Localization.MINIX_partition,
_ => Localization.Unknown_partition_type
};
partitions.Add(part); partitions.Add(part);
partitionSequence++; partitionSequence++;
} }
@@ -377,24 +373,23 @@ public sealed class AtariPartitions : IPartition
Offset = table.IcdEntries[i].Start * sectorSize, Offset = table.IcdEntries[i].Start * sectorSize,
Start = table.IcdEntries[i].Start, Start = table.IcdEntries[i].Start,
Type = Encoding.ASCII.GetString(partType), Type = Encoding.ASCII.GetString(partType),
Scheme = Name Scheme = Name,
Description = type switch
{
TYPE_GEMDOS => Localization.Atari_GEMDOS_partition,
TYPE_BIG_GEMDOS => Localization.Atari_GEMDOS_partition_bigger_than_32_MiB,
TYPE_LINUX => Localization.Linux_partition,
TYPE_SWAP => Localization.Swap_partition,
TYPE_RAW => Localization.RAW_partition,
TYPE_NETBSD => Localization.NetBSD_partition,
TYPE_NETBSD_SWAP => Localization.NetBSD_swap_partition,
TYPE_SYSTEM_V => Localization.Atari_UNIX_partition,
TYPE_MAC => Localization.Macintosh_partition,
TYPE_MINIX or TYPE_MINIX2 => Localization.MINIX_partition,
_ => Localization.Unknown_partition_type
}
}; };
part.Description = type switch
{
TYPE_GEMDOS => Localization.Atari_GEMDOS_partition,
TYPE_BIG_GEMDOS => Localization.Atari_GEMDOS_partition_bigger_than_32_MiB,
TYPE_LINUX => Localization.Linux_partition,
TYPE_SWAP => Localization.Swap_partition,
TYPE_RAW => Localization.RAW_partition,
TYPE_NETBSD => Localization.NetBSD_partition,
TYPE_NETBSD_SWAP => Localization.NetBSD_swap_partition,
TYPE_SYSTEM_V => Localization.Atari_UNIX_partition,
TYPE_MAC => Localization.Macintosh_partition,
TYPE_MINIX or TYPE_MINIX2 => Localization.MINIX_partition,
_ => Localization.Unknown_partition_type
};
partitions.Add(part); partitions.Add(part);
partitionSequence++; partitionSequence++;
} }

View File

@@ -137,8 +137,10 @@ class MainClass
foreach(string migration in ctx.Database.GetPendingMigrations()) foreach(string migration in ctx.Database.GetPendingMigrations())
{ {
ctx.Database ctx.Database
#pragma warning disable EF1002
.ExecuteSqlRaw($"INSERT INTO \"__EFMigrationsHistory\" (MigrationId, ProductVersion) VALUES ('{ .ExecuteSqlRaw($"INSERT INTO \"__EFMigrationsHistory\" (MigrationId, ProductVersion) VALUES ('{
migration}', '0.0.0')"); migration}', '0.0.0')");
#pragma warning restore EF1002
} }
ctx.SaveChanges(); ctx.SaveChanges();