Redo Reformat and cleanup.

Rider EAP was having a bug interpreting .editorconfig that didn't generate the code style as we wanted.
This is now done with Rider-stable.
This commit is contained in:
2023-10-04 17:34:40 +01:00
parent bc8bf7a2dc
commit 7363a5d9c5
453 changed files with 7241 additions and 7126 deletions

View File

@@ -58,14 +58,43 @@ public sealed partial class UDF
if(imagePlugin.Info.SectorSize < 512)
return false;
var anchor = new AnchorVolumeDescriptorPointer();
var anchor = new AnchorVolumeDescriptorPointer();
// All positions where anchor may reside, with the ratio between 512 and 2048bps
ulong[][] positions =
{
new ulong[] { 256, 1 }, new ulong[] { 512, 1 }, new ulong[] { partition.End - 256, 1 },
new ulong[] { partition.End, 1 }, new ulong[] { 1024, 4 }, new ulong[] { 2048, 4 },
new ulong[] { partition.End - 1024, 4 }, new ulong[] { partition.End - 4, 4 }
new ulong[]
{
256, 1
},
new ulong[]
{
512, 1
},
new ulong[]
{
partition.End - 256, 1
},
new ulong[]
{
partition.End, 1
},
new ulong[]
{
1024, 4
},
new ulong[]
{
2048, 4
},
new ulong[]
{
partition.End - 1024, 4
},
new ulong[]
{
partition.End - 4, 4
}
};
var anchorFound = false;
@@ -75,9 +104,9 @@ public sealed partial class UDF
foreach(ulong[] position in from position in
positions.Where(position =>
position[0] + partition.Start + position[1] <=
partition.End && position[0] < partition.End)
let errno =
imagePlugin.ReadSectors(position[0], (uint)position[1], out sector)
partition.End &&
position[0] < partition.End)
let errno = imagePlugin.ReadSectors(position[0], (uint)position[1], out sector)
where errno == ErrorNumber.NoError
select position)
{
@@ -85,8 +114,7 @@ public sealed partial class UDF
AaruConsole.DebugWriteLine(MODULE_NAME, "anchor.tag.tagIdentifier = {0}", anchor.tag.tagIdentifier);
AaruConsole.DebugWriteLine(MODULE_NAME, "anchor.tag.descriptorVersion = {0}",
anchor.tag.descriptorVersion);
AaruConsole.DebugWriteLine(MODULE_NAME, "anchor.tag.descriptorVersion = {0}", anchor.tag.descriptorVersion);
AaruConsole.DebugWriteLine(MODULE_NAME, "anchor.tag.tagChecksum = 0x{0:X2}", anchor.tag.tagChecksum);
AaruConsole.DebugWriteLine(MODULE_NAME, "anchor.tag.reserved = {0}", anchor.tag.reserved);
@@ -132,9 +160,8 @@ public sealed partial class UDF
{
ErrorNumber errno =
imagePlugin.
ReadSectors(
partition.Start + anchor.mainVolumeDescriptorSequenceExtent.location * ratio + count * ratio,
ratio, out sector);
ReadSectors(partition.Start + anchor.mainVolumeDescriptorSequenceExtent.location * ratio + count * ratio,
ratio, out sector);
if(errno != ErrorNumber.NoError)
{
@@ -189,9 +216,38 @@ public sealed partial class UDF
// All positions where anchor may reside, with the ratio between 512 and 2048bps
ulong[][] positions =
{
new ulong[] { 256, 1 }, new ulong[] { 512, 1 }, new ulong[] { partition.End - 256, 1 },
new ulong[] { partition.End, 1 }, new ulong[] { 1024, 4 }, new ulong[] { 2048, 4 },
new ulong[] { partition.End - 1024, 4 }, new ulong[] { partition.End - 4, 4 }
new ulong[]
{
256, 1
},
new ulong[]
{
512, 1
},
new ulong[]
{
partition.End - 256, 1
},
new ulong[]
{
partition.End, 1
},
new ulong[]
{
1024, 4
},
new ulong[]
{
2048, 4
},
new ulong[]
{
partition.End - 1024, 4
},
new ulong[]
{
partition.End - 4, 4
}
};
uint ratio = 1;
@@ -225,9 +281,8 @@ public sealed partial class UDF
{
errno =
imagePlugin.
ReadSectors(
partition.Start + anchor.mainVolumeDescriptorSequenceExtent.location * ratio + count * ratio,
ratio, out sector);
ReadSectors(partition.Start + anchor.mainVolumeDescriptorSequenceExtent.location * ratio + count * ratio,
ratio, out sector);
if(errno != ErrorNumber.NoError)
continue;
@@ -278,10 +333,12 @@ public sealed partial class UDF
lvid = new LogicalVolumeIntegrityDescriptor();
sbInformation.AppendFormat(Localization.Volume_is_number_0_of_1, pvd.volumeSequenceNumber,
pvd.maximumVolumeSequenceNumber).AppendLine();
pvd.maximumVolumeSequenceNumber).
AppendLine();
sbInformation.AppendFormat(Localization.Volume_set_identifier_0,
StringHandlers.DecompressUnicode(pvd.volumeSetIdentifier)).AppendLine();
StringHandlers.DecompressUnicode(pvd.volumeSetIdentifier)).
AppendLine();
sbInformation.
AppendFormat(Localization.Volume_name_0, StringHandlers.DecompressUnicode(lvd.logicalVolumeIdentifier)).
@@ -299,7 +356,8 @@ public sealed partial class UDF
AppendLine();
sbInformation.AppendFormat(Localization.Volume_conforms_to_0,
encoding.GetString(lvd.domainIdentifier.identifier).TrimEnd('\u0000')).AppendLine();
encoding.GetString(lvd.domainIdentifier.identifier).TrimEnd('\u0000')).
AppendLine();
sbInformation.AppendFormat(Localization.Volume_was_last_written_by_0,
encoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000')).
@@ -307,15 +365,18 @@ public sealed partial class UDF
sbInformation.AppendFormat(Localization.Volume_requires_UDF_version_0_1_to_be_read,
Convert.ToInt32($"{(lvidiu.minimumReadUDF & 0xFF00) >> 8}", 10),
Convert.ToInt32($"{lvidiu.minimumReadUDF & 0xFF}", 10)).AppendLine();
Convert.ToInt32($"{lvidiu.minimumReadUDF & 0xFF}", 10)).
AppendLine();
sbInformation.AppendFormat(Localization.Volume_requires_UDF_version_0_1_to_be_written_to,
Convert.ToInt32($"{(lvidiu.minimumWriteUDF & 0xFF00) >> 8}", 10),
Convert.ToInt32($"{lvidiu.minimumWriteUDF & 0xFF}", 10)).AppendLine();
Convert.ToInt32($"{lvidiu.minimumWriteUDF & 0xFF}", 10)).
AppendLine();
sbInformation.AppendFormat(Localization.Volume_cannot_be_written_by_any_UDF_version_higher_than_0_1,
Convert.ToInt32($"{(lvidiu.maximumWriteUDF & 0xFF00) >> 8}", 10),
Convert.ToInt32($"{lvidiu.maximumWriteUDF & 0xFF}", 10)).AppendLine();
Convert.ToInt32($"{lvidiu.maximumWriteUDF & 0xFF}", 10)).
AppendLine();
metadata = new FileSystem
{