diff --git a/.editorconfig b/.editorconfig
index 71a05170a..103a5d927 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -83,7 +83,7 @@ resharper_braces_for_ifelse
resharper_braces_for_while = required_for_multiline
resharper_builtin_type_apply_to_native_integer = false
resharper_constructor_or_destructor_body = expression_body
-resharper_csharp_align_first_arg_by_paren = false
+resharper_csharp_align_first_arg_by_paren = true
resharper_csharp_empty_block_style = together_same_line
resharper_csharp_place_comments_at_first_column = true
resharper_csharp_prefer_qualified_reference = false
@@ -108,6 +108,7 @@ resharper_int_align_enum_initializers
resharper_int_align_eq = true
resharper_keep_existing_embedded_arrangement = false
resharper_keep_existing_initializer_arrangement = false
+resharper_keep_existing_linebreaks = false
resharper_keep_existing_list_patterns_arrangement = false
resharper_keep_existing_property_patterns_arrangement = false
resharper_keep_existing_switch_expression_arrangement = false
@@ -125,6 +126,7 @@ resharper_outdent_statement_labels
resharper_parentheses_redundancy_style = remove
resharper_place_attribute_on_same_line = false
resharper_place_simple_embedded_statement_on_same_line = false
+resharper_place_simple_initializer_on_single_line = false
resharper_qualified_using_at_nested_scope = true
resharper_show_autodetect_configure_formatting_tip = false
resharper_simple_block_style = on_single_line
@@ -146,6 +148,8 @@ resharper_use_indent_from_vs
resharper_wrap_after_dot_in_method_calls = true
resharper_wrap_base_clause_style = chop_if_long
resharper_wrap_braced_init_list_style = chop_if_long
+resharper_wrap_chained_binary_expressions = chop_if_long
+resharper_wrap_chained_method_calls = chop_if_long
resharper_wrap_ctor_initializer_style = chop_if_long
resharper_wrap_lines = true
resharper_xmldoc_attribute_indent = align_by_first_attribute
diff --git a/Aaru.Checksums b/Aaru.Checksums
index d7a0a3e42..16b2a4039 160000
--- a/Aaru.Checksums
+++ b/Aaru.Checksums
@@ -1 +1 @@
-Subproject commit d7a0a3e42ff8fd7dc1a5c9039f6947699b0d27cf
+Subproject commit 16b2a40390f9bc7519fcd8f20957fe337cff2a9f
diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes
index 39d41b150..7796540b5 160000
--- a/Aaru.CommonTypes
+++ b/Aaru.CommonTypes
@@ -1 +1 @@
-Subproject commit 39d41b15039c27bd3306a61cb85c1b78b05d7fd6
+Subproject commit 7796540b5e5e81ceb5dfc2b6e775925b33da8e3d
diff --git a/Aaru.Compression/ADC.cs b/Aaru.Compression/ADC.cs
index edeb33330..5cc328894 100644
--- a/Aaru.Compression/ADC.cs
+++ b/Aaru.Compression/ADC.cs
@@ -57,11 +57,7 @@ public static class ADC
static extern int AARU_adc_decode_buffer(byte[] dstBuffer, int dstSize, byte[] srcBuffer, int srcSize);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- static int GetChunkType(byte byt) => (byt & 0x80) == 0x80
- ? PLAIN
- : (byt & 0x40) == 0x40
- ? THREE_BYTE
- : TWO_BYTE;
+ static int GetChunkType(byte byt) => (byt & 0x80) == 0x80 ? PLAIN : (byt & 0x40) == 0x40 ? THREE_BYTE : TWO_BYTE;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static int GetChunkSize(byte byt) => GetChunkType(byt) switch
diff --git a/Aaru.Compression/AppleRle.cs b/Aaru.Compression/AppleRle.cs
index 268b0d3e7..a49b61903 100644
--- a/Aaru.Compression/AppleRle.cs
+++ b/Aaru.Compression/AppleRle.cs
@@ -61,8 +61,7 @@ public static class AppleRle
var repeatMode = false; // true if we're repeating, false if we're just copying
int inPosition = 0, outPosition = 0;
- while(inPosition <= source.Length &&
- outPosition <= destination.Length)
+ while(inPosition <= source.Length && outPosition <= destination.Length)
{
switch(repeatMode)
{
@@ -102,9 +101,7 @@ public static class AppleRle
byte b2 = source[inPosition++];
var s = (short)(b1 << 8 | b2);
- if(s == 0 ||
- s >= DART_CHUNK ||
- s <= -DART_CHUNK)
+ if(s == 0 || s >= DART_CHUNK || s <= -DART_CHUNK)
continue;
if(s < 0)
diff --git a/Aaru.Compression/LZIP.cs b/Aaru.Compression/LZIP.cs
index 490a05e60..01697494d 100644
--- a/Aaru.Compression/LZIP.cs
+++ b/Aaru.Compression/LZIP.cs
@@ -59,7 +59,7 @@ public class LZIP
/// The size of the compressed data
public static int EncodeBuffer(byte[] source, byte[] destination, int dictionarySize, int matchLengthLimit) =>
Native.IsSupported
- ? AARU_lzip_encode_buffer(destination, destination.Length, source, source.Length,
- dictionarySize, matchLengthLimit)
+ ? AARU_lzip_encode_buffer(destination, destination.Length, source, source.Length, dictionarySize,
+ matchLengthLimit)
: 0;
}
\ No newline at end of file
diff --git a/Aaru.Compression/TeleDiskLzh.cs b/Aaru.Compression/TeleDiskLzh.cs
index 6d2c699fc..7118e33a6 100644
--- a/Aaru.Compression/TeleDiskLzh.cs
+++ b/Aaru.Compression/TeleDiskLzh.cs
@@ -202,8 +202,7 @@ public class TeleDiskLzh
else
{
// still chars from last string
- while(_tdctl.Bufndx < _tdctl.Bufcnt &&
- count < len)
+ while(_tdctl.Bufndx < _tdctl.Bufcnt && count < len)
{
c = _textBuf[_tdctl.Bufpos + _tdctl.Bufndx & N - 1];
buf[count] = (byte)c;
diff --git a/Aaru.Console b/Aaru.Console
index cd6a6c04b..7fb3e7a44 160000
--- a/Aaru.Console
+++ b/Aaru.Console
@@ -1 +1 @@
-Subproject commit cd6a6c04b17c71f7c5909f5b2d3893db8ec81800
+Subproject commit 7fb3e7a44934431fa1bb47eb669d95cc580ecee5
diff --git a/Aaru.Core/DataFile.cs b/Aaru.Core/DataFile.cs
index a74d5815c..5d3c10d11 100644
--- a/Aaru.Core/DataFile.cs
+++ b/Aaru.Core/DataFile.cs
@@ -116,8 +116,7 @@ public sealed class DataFile
/// What is the data about?
public static void WriteTo(string who, string outputPrefix, string outputSuffix, string whatWriting, byte[] data)
{
- if(!string.IsNullOrEmpty(outputPrefix) &&
- !string.IsNullOrEmpty(outputSuffix))
+ if(!string.IsNullOrEmpty(outputPrefix) && !string.IsNullOrEmpty(outputSuffix))
WriteTo(who, outputPrefix + outputSuffix, data, whatWriting);
}
diff --git a/Aaru.Core/Devices/Dumping/ATA.cs b/Aaru.Core/Devices/Dumping/ATA.cs
index 48618d638..7f27d4503 100644
--- a/Aaru.Core/Devices/Dumping/ATA.cs
+++ b/Aaru.Core/Devices/Dumping/ATA.cs
@@ -182,8 +182,7 @@ public partial class Dump
_dev.PlatformId, ref _resume, ref currentTry, ref extents, _dev.FirmwareRevision,
_private, _force);
- if(currentTry == null ||
- extents == null)
+ if(currentTry == null || extents == null)
{
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_process_resume_file_not_continuing);
@@ -249,7 +248,8 @@ public partial class Dump
_dumpLog.WriteLine(outputFormat.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -316,19 +316,15 @@ public partial class Dump
if(blocks - i < blocksToRead)
blocksToRead = (byte)(blocks - i);
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)blocks);
bool error = ataReader.ReadBlocks(out cmdBuf, i, blocksToRead, out duration, out _, out _);
@@ -401,19 +397,18 @@ public partial class Dump
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
_dumpLog.WriteLine(Localization.Core.Average_dump_speed_0,
- ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalDuration.Milliseconds()).
+ ByteSize.FromBytes(blockSize * (blocks + 1)).
+ Per(totalDuration.Milliseconds()).
Humanize());
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(imageWriteDuration.Seconds()).Humanize()));
+ Per(imageWriteDuration.Seconds()).
+ Humanize()));
#region Trimming
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _trim &&
- newTrim)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
{
_trimStopwatch.Restart();
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
@@ -463,9 +458,7 @@ public partial class Dump
#region Error handling
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _retryPasses > 0)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
{
var pass = 1;
var forward = true;
@@ -489,10 +482,8 @@ public partial class Dump
{
PulseProgress?.Invoke(_persistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_forward,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_forward,
+ badSector, pass)
: string.
Format(Localization.Core.Retrying_sector_0_pass_1_forward,
badSector, pass));
@@ -501,10 +492,8 @@ public partial class Dump
{
PulseProgress?.Invoke(_persistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_reverse,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_reverse,
+ badSector, pass)
: string.
Format(Localization.Core.Retrying_sector_0_pass_1_reverse,
badSector, pass));
@@ -533,9 +522,7 @@ public partial class Dump
outputFormat.WriteSector(cmdBuf, badSector);
}
- if(pass < _retryPasses &&
- !_aborted &&
- _resume.BadBlocks.Count > 0)
+ if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
{
pass++;
forward = !forward;
@@ -601,18 +588,17 @@ public partial class Dump
break;
}
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
PulseProgress?.
Invoke(string.Format(Localization.Core.Reading_cylinder_0_head_1_sector_2_3, cy, hd,
sc,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).
+ ByteSize.FromMegabytes(currentSpeed).
+ Per(_oneSecond).
Humanize()));
bool error =
@@ -627,8 +613,7 @@ public partial class Dump
mhddLog.Write(currentBlock, duration);
ibgLog.Write(currentBlock, currentSpeed * 1024);
- outputFormat.WriteSector(cmdBuf,
- (ulong)((cy * heads + hd) * sectors + (sc - 1)));
+ outputFormat.WriteSector(cmdBuf, (ulong)((cy * heads + hd) * sectors + (sc - 1)));
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
extents.Add(currentBlock);
@@ -692,11 +677,13 @@ public partial class Dump
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
_dumpLog.WriteLine(Localization.Core.Average_dump_speed_0,
- ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalDuration.Milliseconds()).
+ ByteSize.FromBytes(blockSize * (blocks + 1)).
+ Per(totalDuration.Milliseconds()).
Humanize());
_dumpLog.WriteLine(Localization.Core.Average_write_speed_0,
- ByteSize.FromBytes(blockSize * (blocks + 1)).Per(imageWriteDuration.Seconds()).
+ ByteSize.FromBytes(blockSize * (blocks + 1)).
+ Per(imageWriteDuration.Seconds()).
Humanize());
}
@@ -714,7 +701,8 @@ public partial class Dump
if(!outputFormat.SetImageInfo(metadata))
{
- ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
+ ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata +
+ Environment.NewLine +
outputFormat.ErrorMessage);
}
@@ -745,12 +733,10 @@ public partial class Dump
outputFormat.WriteMediaTag(ataIdentify, MediaTagType.ATA_IDENTIFY);
- if(_dev.IsUsb &&
- _dev.UsbDescriptors != null)
+ if(_dev.IsUsb && _dev.UsbDescriptors != null)
outputFormat.WriteMediaTag(_dev.UsbDescriptors, MediaTagType.USB_Descriptors);
- if(_dev.IsPcmcia &&
- _dev.Cis != null)
+ if(_dev.IsPcmcia && _dev.Cis != null)
outputFormat.WriteMediaTag(_dev.Cis, MediaTagType.PCMCIA_CIS);
if(_metadata)
@@ -791,8 +777,7 @@ public partial class Dump
sidecar = _preSidecar;
}
- if(_dev.IsUsb &&
- _dev.UsbDescriptors != null)
+ if(_dev.IsUsb && _dev.UsbDescriptors != null)
{
_dumpLog.WriteLine(Localization.Core.Reading_USB_descriptors);
UpdateStatus?.Invoke(Localization.Core.Reading_USB_descriptors);
@@ -810,8 +795,7 @@ public partial class Dump
};
}
- if(_dev.IsPcmcia &&
- _dev.Cis != null)
+ if(_dev.IsPcmcia && _dev.Cis != null)
{
_dumpLog.WriteLine(Localization.Core.Reading_PCMCIA_CIS);
UpdateStatus?.Invoke(Localization.Core.Reading_PCMCIA_CIS);
@@ -900,7 +884,8 @@ public partial class Dump
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(totalChkDuration.Milliseconds()).Humanize());
+ Per(totalChkDuration.Milliseconds()).
+ Humanize());
List<(ulong start, string type)> filesystems = new();
@@ -915,10 +900,11 @@ public partial class Dump
if(filesystems.Count > 0)
{
foreach(var filesystem in filesystems.Select(o => new
- {
- o.start,
- o.type
- }).Distinct())
+ {
+ o.start,
+ o.type
+ }).
+ Distinct())
{
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
filesystem.type, filesystem.start));
@@ -944,9 +930,7 @@ public partial class Dump
sidecar.BlockMedias[0].Size = blocks * blockSize;
- if(cylinders > 0 &&
- heads > 0 &&
- sectors > 0)
+ if(cylinders > 0 && heads > 0 && sectors > 0)
{
sidecar.BlockMedias[0].Cylinders = cylinders;
sidecar.BlockMedias[0].Heads = heads;
@@ -969,18 +953,17 @@ public partial class Dump
UpdateStatus?.Invoke("");
UpdateStatus?.
- Invoke(string.Format(
- Localization.Core.
- Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
- _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
- totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
- _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
+ Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
+ _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
+ totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
+ _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(totalDuration.Milliseconds()).Humanize()));
+ Per(totalDuration.Milliseconds()).
+ Humanize()));
if(maxSpeed > 0)
{
diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/CdiReady.cs b/Aaru.Core/Devices/Dumping/CompactDisc/CdiReady.cs
index dff549cec..67fae2399 100644
--- a/Aaru.Core/Devices/Dumping/CompactDisc/CdiReady.cs
+++ b/Aaru.Core/Devices/Dumping/CompactDisc/CdiReady.cs
@@ -59,7 +59,10 @@ partial class Dump
if(sector?.Length != 2352)
return false;
- byte[] syncMark = { 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00 };
+ byte[] syncMark =
+ {
+ 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
+ };
var testMark = new byte[12];
Array.Copy(sector, 0, testMark, 0, 12);
@@ -79,7 +82,10 @@ partial class Dump
if(sector?.Length != 2352)
return false;
- byte[] syncMark = { 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00 };
+ byte[] syncMark =
+ {
+ 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
+ };
var testMark = new byte[12];
@@ -202,19 +208,15 @@ partial class Dump
}
}
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)blocks);
sense = _dev.ReadCd(out cmdBuf, out senseBuf, firstSectorToRead, blockSize, blocksToRead,
MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true, true,
@@ -230,10 +232,8 @@ partial class Dump
for(uint r = 0; r < _maximumReadable; r++)
{
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i + r, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i + r, (long)blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i + r, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i + r, (long)blocks);
sense = _dev.ReadCd(out cmdBuf, out senseBuf, (uint)(i + r), blockSize, (uint)sectorsForOffset + 1,
MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true,
@@ -241,8 +241,7 @@ partial class Dump
totalDuration += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mhddLog.Write(i + r, cmdDuration);
ibgLog.Write(i + r, currentSpeed * 1024);
@@ -325,8 +324,7 @@ partial class Dump
_speedStopwatch.Restart();
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
if(cdiReadyReadAsAudio)
{
diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Data.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Data.cs
index 013e30b85..62e076cee 100644
--- a/Aaru.Core/Devices/Dumping/CompactDisc/Data.cs
+++ b/Aaru.Core/Devices/Dumping/CompactDisc/Data.cs
@@ -159,12 +159,10 @@ partial class Dump
{
if(j > (ulong)lastSector)
{
- if(!failedCrossingLeadOut &&
- !inData)
+ if(!failedCrossingLeadOut && !inData)
blocksToRead += (uint)sectorsForOffset;
- if(sectorsForOffset > 0 &&
- !inData)
+ if(sectorsForOffset > 0 && !inData)
crossingLeadOut = true;
break;
@@ -194,12 +192,10 @@ partial class Dump
}
}
- if(track.Sequence != 0 &&
- i + blocksToRead - (ulong)sectorsForOffset > track.EndSector + 1)
+ if(track.Sequence != 0 && i + blocksToRead - (ulong)sectorsForOffset > track.EndSector + 1)
blocksToRead = (uint)(track.EndSector + 1 - i + (ulong)sectorsForOffset);
- if(blocksToRead == 1 &&
- !inData)
+ if(blocksToRead == 1 && !inData)
blocksToRead += (uint)sectorsForOffset;
if(blocksToRead == 0)
@@ -269,23 +265,17 @@ partial class Dump
crossingLeadOut = false;
}
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)blocks);
- if(crossingLeadOut &&
- failedCrossingLeadOut &&
- blocksToRead > 1)
+ if(crossingLeadOut && failedCrossingLeadOut && blocksToRead > 1)
blocksToRead--;
if(_supportsPlextorD8 && !inData)
@@ -396,8 +386,7 @@ partial class Dump
DecodedSense? decSense = Sense.Decode(senseBuf);
// Try to workaround firmware
- if(decSense is { ASC: 0x11, ASCQ: 0x05 } ||
- decSense?.ASC == 0x64)
+ if(decSense is { ASC: 0x11, ASCQ: 0x05 } || decSense?.ASC == 0x64)
{
sense = _dev.ReadCd(out cmdBuf, out _, firstSectorToRead, blockSize, blocksToRead,
MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders,
@@ -435,19 +424,15 @@ partial class Dump
double elapsed;
// Overcome the track mode change drive error
- if(inData &&
- !nextData &&
- sense)
+ if(inData && !nextData && sense)
{
_speedStopwatch.Restart();
for(uint r = 0; r < blocksToRead; r++)
{
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i + r, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i + r, (long)blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i + r, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i + r, (long)blocks);
if(_supportsPlextorD8)
{
@@ -504,8 +489,7 @@ partial class Dump
out cmdDuration);
}
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mhddLog.Write(i + r, cmdDuration);
ibgLog.Write(i + r, currentSpeed * 1024);
@@ -655,8 +639,7 @@ partial class Dump
continue;
}
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
if(crossingLeadOut && failedCrossingLeadOut)
{
@@ -665,9 +648,7 @@ partial class Dump
}
// Because one block has been partially used to fix the offset
- if(_fixOffset &&
- !inData &&
- offsetBytes != 0)
+ if(_fixOffset && !inData && offsetBytes != 0)
{
FixOffsetData(offsetBytes, sectorSize, sectorsForOffset, supportedSubchannel, ref blocksToRead,
subSize, ref cmdBuf, blockSize, failedCrossingLeadOut);
diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs
index 7acd7f8c7..facf19d55 100644
--- a/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs
+++ b/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs
@@ -362,9 +362,9 @@ sealed partial class Dump
// Check if subchannel is BCD
if(supportedSubchannel != MmcSubchannel.None)
{
- sense = _dev.ReadCd(out cmdBuf, out _, (firstLba / 75 + 1) * 75 + 35, blockSize, 1,
- MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true, true,
- MmcErrorField.None, supportedSubchannel, _dev.Timeout, out _);
+ sense = _dev.ReadCd(out cmdBuf, out _, (firstLba / 75 + 1) * 75 + 35, blockSize, 1, MmcSectorTypes.AllTypes,
+ false, false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None,
+ supportedSubchannel, _dev.Timeout, out _);
if(!sense)
{
@@ -471,8 +471,7 @@ sealed partial class Dump
ResumeSupport.Process(true, true, blocks, _dev.Manufacturer, _dev.Model, _dev.Serial, _dev.PlatformId,
ref _resume, ref currentTry, ref extents, _dev.FirmwareRevision, _private, _force);
- if(currentTry == null ||
- extents == null)
+ if(currentTry == null || extents == null)
{
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_process_resume_file_not_continuing);
@@ -482,8 +481,7 @@ sealed partial class Dump
// Read media tags
ReadCdTags(ref dskType, mediaTags, out sessions, out firstTrackLastSession);
- if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreSessions) &&
- sessions > 1)
+ if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreSessions) && sessions > 1)
{
// TODO: Disabled until 6.0
/*if(!_force)
@@ -578,8 +576,7 @@ sealed partial class Dump
tracks = trkList.ToArray();
}
- if(tracks.Any(t => t.Type == TrackType.Audio) &&
- desiredSubchannel != MmcSubchannel.Raw)
+ if(tracks.Any(t => t.Type == TrackType.Audio) && desiredSubchannel != MmcSubchannel.Raw)
{
_dumpLog.WriteLine(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
@@ -789,8 +786,7 @@ sealed partial class Dump
_maximumReadable /= 2;
}
- if(!_dev.Error ||
- _maximumReadable == 1)
+ if(!_dev.Error || _maximumReadable == 1)
break;
}
@@ -805,8 +801,7 @@ sealed partial class Dump
var cdiWithHiddenTrack1 = false;
- if(dskType is MediaType.CDIREADY &&
- tracks.Min(t => t.Sequence) == 1)
+ if(dskType is MediaType.CDIREADY && tracks.Min(t => t.Sequence) == 1)
{
cdiWithHiddenTrack1 = true;
dskType = MediaType.CDI;
@@ -843,7 +838,8 @@ sealed partial class Dump
_dumpLog.WriteLine(outputOptical.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputOptical.ErrorMessage);
+ Environment.NewLine +
+ outputOptical.ErrorMessage);
return;
}
@@ -879,14 +875,14 @@ sealed partial class Dump
// Send track list to output plugin. This may fail if subchannel is set but unsupported.
ret = outputOptical.SetTracks(tracks.ToList());
- if(!ret &&
- desiredSubchannel == MmcSubchannel.None)
+ if(!ret && desiredSubchannel == MmcSubchannel.None)
{
_dumpLog.WriteLine(Localization.Core.Error_sending_tracks_to_output_image_not_continuing);
_dumpLog.WriteLine(outputOptical.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_sending_tracks_to_output_image_not_continuing +
- Environment.NewLine + outputOptical.ErrorMessage);
+ Environment.NewLine +
+ outputOptical.ErrorMessage);
return;
}
@@ -930,7 +926,10 @@ sealed partial class Dump
_dumpLog.WriteLine(Localization.Core.Setting_flags_for_track_0, track.Sequence);
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_flags_for_track_0, track.Sequence));
- outputOptical.WriteSectorTag(new[] { kvp.Value }, kvp.Key, SectorTagType.CdTrackFlags);
+ outputOptical.WriteSectorTag(new[]
+ {
+ kvp.Value
+ }, kvp.Key, SectorTagType.CdTrackFlags);
}
// Set MCN
@@ -938,9 +937,7 @@ sealed partial class Dump
{
sense = _dev.ReadMcn(out mcn, out _, out _, _dev.Timeout, out _);
- if(!sense &&
- mcn != null &&
- mcn != "0000000000000")
+ if(!sense && mcn != null && mcn != "0000000000000")
{
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_Media_Catalogue_Number_0, mcn));
_dumpLog.WriteLine(Localization.Core.Found_Media_Catalogue_Number_0, mcn);
@@ -966,8 +963,7 @@ sealed partial class Dump
}
}
- if(supportedSubchannel != MmcSubchannel.None &&
- desiredSubchannel != MmcSubchannel.None)
+ if(supportedSubchannel != MmcSubchannel.None && desiredSubchannel != MmcSubchannel.None)
{
subchannelExtents = new HashSet();
@@ -1123,8 +1119,7 @@ sealed partial class Dump
}
}
- if(!_fixOffset ||
- tracks.All(t => t.Type != TrackType.Audio))
+ if(!_fixOffset || tracks.All(t => t.Type != TrackType.Audio))
{
offsetBytes = 0;
sectorsForOffset = 0;
@@ -1335,9 +1330,7 @@ sealed partial class Dump
ref totalDuration, subLog, desiredSubchannel, tracks, isrcs, ref mcn, subchannelExtents,
smallestPregapLbaPerTrack);
- if(dskType is MediaType.CDR or MediaType.CDRW &&
- _resume.BadBlocks.Count > 0 &&
- _ignoreCdrRunOuts > 0)
+ if(dskType is MediaType.CDR or MediaType.CDRW && _resume.BadBlocks.Count > 0 && _ignoreCdrRunOuts > 0)
{
HandleCdrRunOutSectors(blocks, desiredSubchannel, extents, subchannelExtents, subLog, supportsLongSectors,
trackFlags, tracks);
@@ -1353,9 +1346,7 @@ sealed partial class Dump
subchannelExtents.Remove((int)e);
}
- if(subchannelExtents.Count > 0 &&
- _retryPasses > 0 &&
- _retrySubchannel)
+ if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel)
{
RetrySubchannel(readcd, subSize, supportedSubchannel, ref totalDuration, subLog, desiredSubchannel, tracks,
isrcs, ref mcn, subchannelExtents, smallestPregapLbaPerTrack);
@@ -1414,7 +1405,8 @@ sealed partial class Dump
if(!outputOptical.SetImageInfo(metadata))
{
- ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
+ ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata +
+ Environment.NewLine +
outputOptical.ErrorMessage);
}
@@ -1433,8 +1425,7 @@ sealed partial class Dump
_dumpLog.WriteLine(Localization.Core.Setting_ISRC_for_track_0_to_1, isrc.Key, isrc.Value);
}
- if(mcn != null &&
- outputOptical.WriteMediaTag(Encoding.ASCII.GetBytes(mcn), MediaTagType.CD_MCN))
+ if(mcn != null && outputOptical.WriteMediaTag(Encoding.ASCII.GetBytes(mcn), MediaTagType.CD_MCN))
{
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_disc_Media_Catalogue_Number_to_0, mcn));
_dumpLog.WriteLine(Localization.Core.Setting_disc_Media_Catalogue_Number_to_0, mcn);
@@ -1454,9 +1445,7 @@ sealed partial class Dump
continue;
}
- if(trk.Indexes.TryGetValue(0, out int idx0) &&
- trk.Indexes.TryGetValue(1, out int idx1) &&
- idx0 == idx1)
+ if(trk.Indexes.TryGetValue(0, out int idx0) && trk.Indexes.TryGetValue(1, out int idx1) && idx0 == idx1)
trk.Indexes.Remove(0);
}
@@ -1492,17 +1481,17 @@ sealed partial class Dump
UpdateStatus?.Invoke("");
UpdateStatus?.
- Invoke(string.Format(
- Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
- _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
- totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
- _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
+ Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
+ _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
+ totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
+ _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(totalDuration.Milliseconds()).Humanize()));
+ Per(totalDuration.Milliseconds()).
+ Humanize()));
if(maxSpeed > 0)
{
diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Error.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Error.cs
index dd2fb3010..9a8085ff4 100644
--- a/Aaru.Core/Devices/Dumping/CompactDisc/Error.cs
+++ b/Aaru.Core/Devices/Dumping/CompactDisc/Error.cs
@@ -95,9 +95,7 @@ partial class Dump
_ => PlextorSubchannel.None
};
- if(_resume.BadBlocks.Count <= 0 ||
- _aborted ||
- _retryPasses <= 0)
+ if(_resume.BadBlocks.Count <= 0 || _aborted || _retryPasses <= 0)
return;
var pass = 1;
@@ -127,7 +125,7 @@ partial class Dump
if(dcMode10?.Pages != null)
{
foreach(Modes.ModePage modePage in dcMode10.Value.Pages.Where(modePage =>
- modePage is { Page: 0x01, Subpage: 0x00 }))
+ modePage is { Page: 0x01, Subpage: 0x00 }))
currentModePage = modePage;
}
}
@@ -138,8 +136,10 @@ partial class Dump
if(dcMode6?.Pages != null)
{
- foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage =>
- modePage is { Page: 0x01, Subpage: 0x00 }))
+ foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage => modePage is
+ {
+ Page: 0x01, Subpage: 0x00
+ }))
currentModePage = modePage;
}
}
@@ -227,10 +227,8 @@ partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_forward,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_forward,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_forward, badSector,
pass));
}
@@ -238,10 +236,8 @@ partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_reverse,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_reverse,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_reverse, badSector,
pass));
}
@@ -251,9 +247,7 @@ partial class Dump
byte sectorsToReRead = 1;
var badSectorToReRead = (uint)badSector;
- if(_fixOffset &&
- audioExtents.Contains(badSector) &&
- offsetBytes != 0)
+ if(_fixOffset && audioExtents.Contains(badSector) && offsetBytes != 0)
{
if(offsetBytes < 0)
{
@@ -286,8 +280,7 @@ partial class Dump
DecodedSense? decSense = Sense.Decode(senseBuf);
// Try to workaround firmware
- if(decSense is { ASC: 0x11, ASCQ: 0x05 } ||
- decSense?.ASC == 0x64)
+ if(decSense is { ASC: 0x11, ASCQ: 0x05 } || decSense?.ASC == 0x64)
{
sense = _dev.ReadCd(out cmdBuf, out _, badSectorToReRead, blockSize, sectorsToReRead,
MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders,
@@ -309,8 +302,7 @@ partial class Dump
DecodedSense? decSense = Sense.Decode(senseBuf);
// Try to workaround firmware
- if(decSense is { ASC: 0x11, ASCQ: 0x05 } ||
- decSense?.ASC == 0x64)
+ if(decSense is { ASC: 0x11, ASCQ: 0x05 } || decSense?.ASC == 0x64)
{
sense = _dev.ReadCd(out cmdBuf, out _, badSectorToReRead, blockSize, sectorsToReRead,
MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true,
@@ -343,9 +335,7 @@ partial class Dump
}
// Because one block has been partially used to fix the offset
- if(_fixOffset &&
- audioExtents.Contains(badSector) &&
- offsetBytes != 0)
+ if(_fixOffset && audioExtents.Contains(badSector) && offsetBytes != 0)
{
uint blocksToRead = sectorsToReRead;
@@ -353,8 +343,7 @@ partial class Dump
ref cmdBuf, blockSize, false);
}
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
@@ -406,9 +395,7 @@ partial class Dump
}
}
- if(pass < _retryPasses &&
- !_aborted &&
- _resume.BadBlocks.Count > 0)
+ if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
{
pass++;
forward = !forward;
@@ -546,7 +533,10 @@ partial class Dump
var md = new Modes.DecodedMode
{
Header = new Modes.ModeHeader(),
- Pages = new[] { currentModePage.Value }
+ Pages = new[]
+ {
+ currentModePage.Value
+ }
};
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
@@ -586,8 +576,7 @@ partial class Dump
PlextorSubchannel supportedPlextorSubchannel;
var outputOptical = _outputPlugin as IWritableOpticalImage;
- if(supportedSubchannel == MmcSubchannel.None ||
- desiredSubchannel == MmcSubchannel.None)
+ if(supportedSubchannel == MmcSubchannel.None || desiredSubchannel == MmcSubchannel.None)
return;
supportedPlextorSubchannel = supportedSubchannel switch
@@ -677,9 +666,7 @@ partial class Dump
_dumpLog.WriteLine(Localization.Core.Correctly_retried_sector_0_subchannel_in_pass_1, badSector, pass);
}
- if(pass < _retryPasses &&
- !_aborted &&
- subchannelExtents.Count > 0)
+ if(pass < _retryPasses && !_aborted && subchannelExtents.Count > 0)
{
pass++;
forward = !forward;
diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/LeadOuts.cs b/Aaru.Core/Devices/Dumping/CompactDisc/LeadOuts.cs
index bfea45dfc..555a38cbb 100644
--- a/Aaru.Core/Devices/Dumping/CompactDisc/LeadOuts.cs
+++ b/Aaru.Core/Devices/Dumping/CompactDisc/LeadOuts.cs
@@ -114,12 +114,10 @@ partial class Dump
double cmdDuration = 0;
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
PulseProgress?.Invoke(string.Format(Localization.Core.Reading_sector_0_at_lead_out_1, i,
@@ -151,8 +149,7 @@ partial class Dump
else if(read6)
sense = _dev.Read6(out cmdBuf, out senseBuf, (uint)i, blockSize, 1, _dev.Timeout, out cmdDuration);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mhddLog.Write(i, cmdDuration);
ibgLog.Write(i, currentSpeed * 1024);
@@ -295,12 +292,10 @@ partial class Dump
double cmdDuration = 0;
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
PulseProgress?.Invoke(string.Format(Localization.Core.Reading_sector_0_at_lead_out_1, i,
@@ -332,8 +327,7 @@ partial class Dump
else if(read6)
sense = _dev.Read6(out cmdBuf, out senseBuf, (uint)i, blockSize, 1, _dev.Timeout, out cmdDuration);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mhddLog.Write(i, cmdDuration, _maximumReadable);
ibgLog.Write(i, currentSpeed * 1024);
diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Pregap.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Pregap.cs
index 1832fef26..7313f9545 100644
--- a/Aaru.Core/Devices/Dumping/CompactDisc/Pregap.cs
+++ b/Aaru.Core/Devices/Dumping/CompactDisc/Pregap.cs
@@ -98,8 +98,7 @@ partial class Dump
// ReSharper restore IntVariableOverflowInUncheckedContext
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
firstTrackPregapMs.Write(cmdBuf, 0, (int)blockSize);
gotFirstTrackPregap = true;
@@ -163,8 +162,7 @@ partial class Dump
Dictionary pregaps = new();
inexactPositioning = false;
- if(!supportsPqSubchannel &&
- !supportsRwSubchannel)
+ if(!supportsPqSubchannel && !supportsRwSubchannel)
return;
// Check if subchannel is BCD
@@ -220,9 +218,7 @@ partial class Dump
continue;
}
- if(t > 0 &&
- tracks[t - 1].Type == tracks[t].Type &&
- dumping)
+ if(t > 0 && tracks[t - 1].Type == tracks[t].Type && dumping)
{
AaruConsole.DebugWriteLine(PREGAP_MODULE_NAME, Localization.Core.Skipping_track_0, track.Sequence);
@@ -331,9 +327,7 @@ partial class Dump
posQ = subBuf[7] * 60 * 75 + subBuf[8] * 75 + subBuf[9] - 150;
- if(subBuf[1] != track.Sequence - 1 ||
- subBuf[2] == 0 ||
- posQ != lba)
+ if(subBuf[1] != track.Sequence - 1 || subBuf[2] == 0 || posQ != lba)
break;
pregaps[track.Sequence] = 0;
@@ -347,8 +341,7 @@ partial class Dump
// Calculate pregap
lba = (int)track.StartSector - 150;
- while(lba > (int)previousTrack.StartSector &&
- lba <= (int)track.StartSector)
+ while(lba > (int)previousTrack.StartSector && lba <= (int)track.StartSector)
{
// Some drives crash if you try to read just before the previous read, so seek away first
if(!forward)
@@ -463,17 +456,13 @@ partial class Dump
{
dumpLog?.
WriteLine(string.
- Format(
- Localization.Core.
- Could_not_read_subchannel_for_this_track_supposing_0_sectors,
- pregaps[track.Sequence]));
+ Format(Localization.Core.Could_not_read_subchannel_for_this_track_supposing_0_sectors,
+ pregaps[track.Sequence]));
updateStatus?.
Invoke(string.
- Format(
- Localization.Core.
- Could_not_read_subchannel_for_this_track_supposing_0_sectors,
- pregaps[track.Sequence]));
+ Format(Localization.Core.Could_not_read_subchannel_for_this_track_supposing_0_sectors,
+ pregaps[track.Sequence]));
}
break;
@@ -547,8 +536,7 @@ partial class Dump
}
// Same track, but not pregap
- if(subBuf[1] == track.Sequence &&
- subBuf[2] > 0)
+ if(subBuf[1] == track.Sequence && subBuf[2] > 0)
{
lba--;
forward = false;
@@ -568,8 +556,8 @@ partial class Dump
if(diff != 0)
{
- AaruConsole.DebugWriteLine(PREGAP_MODULE_NAME,
- Localization.Core.Invalid_Q_position_for_LBA_0_got_1, lba, posQ);
+ AaruConsole.DebugWriteLine(PREGAP_MODULE_NAME, Localization.Core.Invalid_Q_position_for_LBA_0_got_1,
+ lba, posQ);
inexactPositioning = true;
}
@@ -626,8 +614,7 @@ partial class Dump
// Minus five, to ensure dumping will fix if there is a pregap LBA 0
var red = 5;
- while(trk.Pregap > 0 &&
- red > 0)
+ while(trk.Pregap > 0 && red > 0)
{
trk.Pregap--;
red--;
diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Recordable.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Recordable.cs
index 3b95c6962..136883cdf 100644
--- a/Aaru.Core/Devices/Dumping/CompactDisc/Recordable.cs
+++ b/Aaru.Core/Devices/Dumping/CompactDisc/Recordable.cs
@@ -100,8 +100,7 @@ partial class Dump
continue;
}
- if(track.Type != TrackType.Audio &&
- track.Type != TrackType.Data)
+ if(track.Type != TrackType.Audio && track.Type != TrackType.Data)
{
SectorBuilder sb = new();
sb.ReconstructPrefix(ref sector, track.Type, (long)s);
diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Tags.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Tags.cs
index 310c21045..a04c9a64f 100644
--- a/Aaru.Core/Devices/Dumping/CompactDisc/Tags.cs
+++ b/Aaru.Core/Devices/Dumping/CompactDisc/Tags.cs
@@ -91,8 +91,7 @@ partial class Dump
{
DiscInformation.StandardDiscInformation? discInfo = DiscInformation.Decode000b(cmdBuf);
- if(discInfo.HasValue &&
- mediaType == MediaType.CD)
+ if(discInfo.HasValue && mediaType == MediaType.CD)
{
mediaType = discInfo.Value.DiscType switch
{
@@ -107,8 +106,7 @@ partial class Dump
UpdateStatus?.Invoke(Localization.Core.Reading_PMA);
sense = _dev.ReadPma(out cmdBuf, out _, _dev.Timeout, out _);
- if(!sense &&
- PMA.Decode(cmdBuf).HasValue)
+ if(!sense && PMA.Decode(cmdBuf).HasValue)
{
tmpBuf = new byte[cmdBuf.Length - 4];
Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4);
diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Tracks.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Tracks.cs
index 70475a631..600672080 100644
--- a/Aaru.Core/Devices/Dumping/CompactDisc/Tracks.cs
+++ b/Aaru.Core/Devices/Dumping/CompactDisc/Tracks.cs
@@ -114,8 +114,7 @@ partial class Dump
? TrackType.Data
: TrackType.Audio,
StartSector =
- (ulong)(trk.PHOUR * 3600 * 75 + trk.PMIN * 60 * 75 + trk.PSEC * 75 + trk.PFRAME -
- 150),
+ (ulong)(trk.PHOUR * 3600 * 75 + trk.PMIN * 60 * 75 + trk.PSEC * 75 + trk.PFRAME - 150),
BytesPerSector = (int)sectorSize,
RawBytesPerSector = (int)sectorSize
});
@@ -185,8 +184,7 @@ partial class Dump
TOC.CDTOC? oldToc = TOC.Decode(cmdBuf);
- if((sense || !oldToc.HasValue) &&
- !force)
+ if((sense || !oldToc.HasValue) && !force)
{
dumpLog?.WriteLine(Localization.Core.
Could_not_read_TOC_if_you_want_to_continue_use_force_and_will_try_from_LBA_0_to_360000);
diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Trim.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Trim.cs
index 22d3f5392..a324681f5 100644
--- a/Aaru.Core/Devices/Dumping/CompactDisc/Trim.cs
+++ b/Aaru.Core/Devices/Dumping/CompactDisc/Trim.cs
@@ -99,10 +99,7 @@ partial class Dump
_ => PlextorSubchannel.None
};
- if(_resume.BadBlocks.Count <= 0 ||
- _aborted ||
- !_trim ||
- !newTrim)
+ if(_resume.BadBlocks.Count <= 0 || _aborted || !_trim || !newTrim)
return;
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
@@ -133,9 +130,7 @@ partial class Dump
byte sectorsToTrim = 1;
var badSectorToRead = (uint)badSector;
- if(_fixOffset &&
- audioExtents.Contains(badSector) &&
- offsetBytes != 0)
+ if(_fixOffset && audioExtents.Contains(badSector) && offsetBytes != 0)
{
if(offsetBytes < 0)
{
@@ -166,8 +161,7 @@ partial class Dump
DecodedSense? decSense = Sense.Decode(senseBuf);
// Try to workaround firmware
- if(decSense is { ASC: 0x11, ASCQ: 0x05 } ||
- decSense?.ASC == 0x64)
+ if(decSense is { ASC: 0x11, ASCQ: 0x05 } || decSense?.ASC == 0x64)
{
sense = _dev.ReadCd(out cmdBuf, out _, badSectorToRead, blockSize, sectorsToTrim,
MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders,
@@ -233,8 +227,7 @@ partial class Dump
continue;
}
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
@@ -242,9 +235,7 @@ partial class Dump
}
// Because one block has been partially used to fix the offset
- if(_fixOffset &&
- audioExtents.Contains(badSector) &&
- offsetBytes != 0)
+ if(_fixOffset && audioExtents.Contains(badSector) && offsetBytes != 0)
{
uint blocksToRead = sectorsToTrim;
@@ -281,8 +272,7 @@ partial class Dump
outputOptical.SetTracks(tracks.ToList());
- if(track.StartSector != trkStartBefore &&
- !_resume.BadBlocks.Contains(track.StartSector))
+ if(track.StartSector != trkStartBefore && !_resume.BadBlocks.Contains(track.StartSector))
{
_resume.BadBlocks.Add(track.StartSector);
diff --git a/Aaru.Core/Devices/Dumping/Dump.cs b/Aaru.Core/Devices/Dumping/Dump.cs
index 53bb00590..e990d4f6d 100644
--- a/Aaru.Core/Devices/Dumping/Dump.cs
+++ b/Aaru.Core/Devices/Dumping/Dump.cs
@@ -230,7 +230,8 @@ public partial class Dump
_ctx = AaruContext.Create(Settings.Settings.MainDbPath);
// Search for device in main database
- _dbDev = _ctx.Devices.FirstOrDefault(d => d.Manufacturer == _dev.Manufacturer && d.Model == _dev.Model &&
+ _dbDev = _ctx.Devices.FirstOrDefault(d => d.Manufacturer == _dev.Manufacturer &&
+ d.Model == _dev.Model &&
d.Revision == _dev.FirmwareRevision);
if(_dbDev is null)
@@ -293,8 +294,7 @@ public partial class Dump
_errorLog.Close();
_dumpLog.Close();
- if(_resume == null ||
- !_doResume)
+ if(_resume == null || !_doResume)
return;
_resume.LastWriteDate = DateTime.UtcNow;
diff --git a/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs b/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs
index 8a885ecfc..d48a2c776 100644
--- a/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs
+++ b/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs
@@ -163,10 +163,7 @@ public partial class Dump
break;
}
- if(!sfcFound &&
- !genesisFound &&
- !smsFound &&
- !n64Found)
+ if(!sfcFound && !genesisFound && !smsFound && !n64Found)
{
StoppingErrorMessage?.Invoke(Localization.Core.No_cartridge_found_not_dumping);
_dumpLog.WriteLine(Localization.Core.No_cartridge_found_not_dumping);
@@ -177,17 +174,11 @@ public partial class Dump
var cluster = BitConverter.ToUInt16(buffer, romPos + 0x1A);
var romSize = BitConverter.ToUInt32(buffer, romPos + 0x1C);
- MediaType mediaType = gbaFound
- ? MediaType.GameBoyAdvanceGamePak
- : gbFound || gbcFound
- ? MediaType.GameBoyGamePak
- : n64Found
- ? MediaType.N64GamePak
- : smsFound
- ? MediaType.MasterSystemCartridge
- : genesisFound
- ? MediaType.MegaDriveCartridge
- : MediaType.SNESGamePak;
+ MediaType mediaType = gbaFound ? MediaType.GameBoyAdvanceGamePak :
+ gbFound || gbcFound ? MediaType.GameBoyGamePak :
+ n64Found ? MediaType.N64GamePak :
+ smsFound ? MediaType.MasterSystemCartridge :
+ genesisFound ? MediaType.MegaDriveCartridge : MediaType.SNESGamePak;
uint blocksToRead = 64;
double totalDuration = 0;
@@ -196,8 +187,7 @@ public partial class Dump
double minSpeed = double.MaxValue;
byte[] senseBuf;
- if(_outputPlugin is not IByteAddressableImage outputBai ||
- !outputBai.SupportedMediaTypes.Contains(mediaType))
+ if(_outputPlugin is not IByteAddressableImage outputBai || !outputBai.SupportedMediaTypes.Contains(mediaType))
{
_dumpLog.WriteLine(Localization.Core.The_specified_format_does_not_support_the_inserted_cartridge);
@@ -257,7 +247,8 @@ public partial class Dump
_dumpLog.WriteLine(outputBai.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputBai.ErrorMessage);
+ Environment.NewLine +
+ outputBai.ErrorMessage);
return;
}
@@ -285,19 +276,15 @@ public partial class Dump
if(romSectors - i < blocksToRead)
blocksToRead = (uint)(romSectors - i);
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_byte_0_of_1_2, i * 512, romSize,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i * 512, romSize);
+ Invoke(string.Format(Localization.Core.Reading_byte_0_of_1_2, i * 512, romSize, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i * 512, romSize);
sense = _dev.Read10(out readBuffer, out senseBuf, 0, false, true, false, false, (uint)(startSector + i),
512, 0, (ushort)blocksToRead, _dev.Timeout, out double cmdDuration);
@@ -306,8 +293,7 @@ public partial class Dump
_writeStopwatch.Restart();
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
outputBai.WriteBytes(readBuffer, 0, readBuffer.Length, out _);
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
@@ -341,30 +327,24 @@ public partial class Dump
_speedStopwatch.Stop();
- if(romRemaining > 0 &&
- !_aborted)
+ if(romRemaining > 0 && !_aborted)
{
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_byte_0_of_1_2, romSectors * 512, romSize,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)romSectors * 512, romSize);
+ Invoke(string.Format(Localization.Core.Reading_byte_0_of_1_2, romSectors * 512, romSize, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)romSectors * 512, romSize);
sense = _dev.Read10(out readBuffer, out senseBuf, 0, false, true, false, false, romSectors, 512, 0, 1,
_dev.Timeout, out double cmdDuration);
totalDuration += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
_writeStopwatch.Restart();
outputBai.WriteBytes(readBuffer, 0, (int)romRemaining, out _);
@@ -401,11 +381,13 @@ public partial class Dump
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
- ByteSize.FromBytes(512 * (romSectors + 1)).Per(totalDuration.Milliseconds()).
+ ByteSize.FromBytes(512 * (romSectors + 1)).
+ Per(totalDuration.Milliseconds()).
Humanize()));
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
- ByteSize.FromBytes(512 * (romSectors + 1)).Per(imageWriteDuration.Seconds()).
+ ByteSize.FromBytes(512 * (romSectors + 1)).
+ Per(imageWriteDuration.Seconds()).
Humanize()));
var metadata = new CommonTypes.Structs.ImageInfo
@@ -416,7 +398,8 @@ public partial class Dump
if(!outputBai.SetImageInfo(metadata))
{
- ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
+ ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata +
+ Environment.NewLine +
outputBai.ErrorMessage);
}
@@ -452,16 +435,16 @@ public partial class Dump
UpdateStatus?.Invoke("");
UpdateStatus?.
- Invoke(string.Format(
- Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
- _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
- totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
- _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
+ Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
+ _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
+ totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
+ _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
- ByteSize.FromBytes(512 * (romSectors + 1)).Per(totalDuration.Milliseconds()).
+ ByteSize.FromBytes(512 * (romSectors + 1)).
+ Per(totalDuration.Milliseconds()).
Humanize()));
if(maxSpeed > 0)
diff --git a/Aaru.Core/Devices/Dumping/MMC.cs b/Aaru.Core/Devices/Dumping/MMC.cs
index 142c366cf..483eb7d51 100644
--- a/Aaru.Core/Devices/Dumping/MMC.cs
+++ b/Aaru.Core/Devices/Dumping/MMC.cs
@@ -212,8 +212,7 @@ partial class Dump
sense = _dev.ModeSense6(out cmdBuf, out _, false, ScsiModeSensePageControl.Current, 0x00, _dev.Timeout,
out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
decMode = Modes.DecodeMode6(cmdBuf, PeripheralDeviceTypes.MultiMediaDevice);
}
else
@@ -239,8 +238,7 @@ partial class Dump
sense = _dev.ModeSense10(out cmdBuf, out _, false, false, ScsiModeSensePageControl.Current,
0x00, 0x00, _dev.Timeout, out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
decMode = Modes.DecodeMode10(cmdBuf, PeripheralDeviceTypes.MultiMediaDevice);
}
else
@@ -387,8 +385,7 @@ partial class Dump
if(!sense)
{
- if(DMI.IsXbox(cmdBuf) ||
- DMI.IsXbox360(cmdBuf))
+ if(DMI.IsXbox(cmdBuf) || DMI.IsXbox360(cmdBuf))
{
if(DMI.IsXbox(cmdBuf))
dskType = MediaType.XGD;
@@ -558,11 +555,9 @@ partial class Dump
{
UpdateStatus?.
Invoke(string.
- Format(
- Localization.Core.
- Drive_reports_0_copy_protection_not_yet_supported_dump_incorrect,
- (CSS_CPRM.DecodeLeadInCopyright(cmdBuf)?.CopyrightType ??
- CopyrightType.NoProtection).ToString()));
+ Format(Localization.Core.Drive_reports_0_copy_protection_not_yet_supported_dump_incorrect,
+ (CSS_CPRM.DecodeLeadInCopyright(cmdBuf)?.CopyrightType ??
+ CopyrightType.NoProtection).ToString()));
}
}
}
@@ -889,8 +884,7 @@ partial class Dump
CSS_CPRM.LeadInCopyright? cpy = CSS_CPRM.DecodeLeadInCopyright(tmp);
- if(cpy.HasValue &&
- cpy.Value.CopyrightType != CopyrightType.NoProtection)
+ if(cpy.HasValue && cpy.Value.CopyrightType != CopyrightType.NoProtection)
sidecar.OpticalDiscs[0].CopyProtection = cpy.Value.CopyrightType.ToString();
break;
diff --git a/Aaru.Core/Devices/Dumping/Metadata.cs b/Aaru.Core/Devices/Dumping/Metadata.cs
index e25761411..5f297034d 100644
--- a/Aaru.Core/Devices/Dumping/Metadata.cs
+++ b/Aaru.Core/Devices/Dumping/Metadata.cs
@@ -103,7 +103,8 @@ partial class Dump
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
- ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalChkDuration.Milliseconds()).
+ ByteSize.FromBytes(blockSize * (blocks + 1)).
+ Per(totalChkDuration.Milliseconds()).
Humanize());
if(_preSidecar != null)
@@ -127,10 +128,11 @@ partial class Dump
if(filesystems.Count > 0)
{
foreach(var filesystem in filesystems.Select(o => new
- {
- o.start,
- o.type
- }).Distinct())
+ {
+ o.start,
+ o.type
+ }).
+ Distinct())
_dumpLog.WriteLine(Localization.Core.Found_filesystem_0_at_sector_1, filesystem.type, filesystem.start);
}
diff --git a/Aaru.Core/Devices/Dumping/MiniDisc.cs b/Aaru.Core/Devices/Dumping/MiniDisc.cs
index 7a6ea99a9..cce3e56e6 100644
--- a/Aaru.Core/Devices/Dumping/MiniDisc.cs
+++ b/Aaru.Core/Devices/Dumping/MiniDisc.cs
@@ -89,9 +89,7 @@ partial class Dump
sense = _dev.ModeSense6(out byte[] cmdBuf, out _, true, ScsiModeSensePageControl.Current, 0x3F, 5, out _);
- if(!sense &&
- !_dev.Error &&
- Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue)
+ if(!sense && !_dev.Error && Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue)
decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType);
if(decMode.HasValue)
@@ -171,20 +169,17 @@ partial class Dump
sense = _dev.MiniDiscGetType(out cmdBuf, out _, _dev.Timeout, out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
mediaTags.Add(MediaTagType.MiniDiscType, cmdBuf);
sense = _dev.MiniDiscD5(out cmdBuf, out _, _dev.Timeout, out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
mediaTags.Add(MediaTagType.MiniDiscD5, cmdBuf);
sense = _dev.MiniDiscReadDataTOC(out cmdBuf, out _, _dev.Timeout, out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
mediaTags.Add(MediaTagType.MiniDiscDTOC, cmdBuf);
var utocMs = new MemoryStream();
@@ -243,7 +238,8 @@ partial class Dump
_dumpLog.WriteLine(outputFormat.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -273,11 +269,9 @@ partial class Dump
UpdateStatus?.
Invoke(string.
- Format(
- Localization.Core.
- Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
- rigidPage.Value.Cylinders, rigidPage.Value.Heads,
- (uint)(blocks / (rigidPage.Value.Cylinders * rigidPage.Value.Heads))));
+ Format(Localization.Core.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
+ rigidPage.Value.Cylinders, rigidPage.Value.Heads,
+ (uint)(blocks / (rigidPage.Value.Cylinders * rigidPage.Value.Heads))));
outputFormat.SetGeometry(rigidPage.Value.Cylinders, rigidPage.Value.Heads,
(uint)(blocks / (rigidPage.Value.Cylinders * rigidPage.Value.Heads)));
@@ -300,11 +294,9 @@ partial class Dump
UpdateStatus?.
Invoke(string.
- Format(
- Localization.Core.
- Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
- flexiblePage.Value.Cylinders, flexiblePage.Value.Heads,
- flexiblePage.Value.SectorsPerTrack));
+ Format(Localization.Core.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
+ flexiblePage.Value.Cylinders, flexiblePage.Value.Heads,
+ flexiblePage.Value.SectorsPerTrack));
outputFormat.SetGeometry(flexiblePage.Value.Cylinders, flexiblePage.Value.Heads,
flexiblePage.Value.SectorsPerTrack);
@@ -324,8 +316,7 @@ partial class Dump
_dev.PlatformId, ref _resume, ref currentTry, ref extents, _dev.FirmwareRevision,
_private, _force);
- if(currentTry == null ||
- extents == null)
+ if(currentTry == null || extents == null)
{
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_process_resume_file_not_continuing);
@@ -375,27 +366,22 @@ partial class Dump
if(blocks - i < blocksToRead)
blocksToRead = (uint)(blocks - i);
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)blocks);
sense = _dev.Read6(out readBuffer, out _, (uint)i, blockSize, (byte)blocksToRead, _dev.Timeout,
out double cmdDuration);
totalDuration += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mhddLog.Write(i, cmdDuration, blocksToRead);
ibgLog.Write(i, currentSpeed * 1024);
@@ -478,10 +464,7 @@ partial class Dump
#region Trimming
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _trim &&
- newTrim)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
{
_trimStopwatch.Restart();
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
@@ -528,9 +511,7 @@ partial class Dump
#region Error handling
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _retryPasses > 0)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
{
var pass = 1;
var forward = true;
@@ -553,7 +534,7 @@ partial class Dump
if(dcMode6?.Pages != null)
{
foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage =>
- modePage is { Page: 0x01, Subpage: 0x00 }))
+ modePage is { Page: 0x01, Subpage: 0x00 }))
currentModePage = modePage;
}
}
@@ -649,10 +630,8 @@ partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_forward,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_forward,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_forward,
badSector, pass));
}
@@ -660,10 +639,8 @@ partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_reverse,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_reverse,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_reverse,
badSector, pass));
}
@@ -673,8 +650,7 @@ partial class Dump
totalDuration += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
@@ -690,9 +666,7 @@ partial class Dump
outputFormat.WriteSector(readBuffer, badSector);
}
- if(pass < _retryPasses &&
- !_aborted &&
- _resume.BadBlocks.Count > 0)
+ if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
{
pass++;
forward = !forward;
@@ -709,7 +683,10 @@ partial class Dump
var md = new Modes.DecodedMode
{
Header = new Modes.ModeHeader(),
- Pages = new[] { currentModePage.Value }
+ Pages = new[]
+ {
+ currentModePage.Value
+ }
};
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
@@ -741,7 +718,8 @@ partial class Dump
if(!outputFormat.SetImageInfo(metadata))
{
- ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
+ ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata +
+ Environment.NewLine +
outputFormat.ErrorMessage);
}
@@ -813,7 +791,8 @@ partial class Dump
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
- ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalChkDuration.Milliseconds()).
+ ByteSize.FromBytes(blockSize * (blocks + 1)).
+ Per(totalChkDuration.Milliseconds()).
Humanize());
if(_preSidecar != null)
@@ -835,10 +814,11 @@ partial class Dump
if(filesystems.Count > 0)
{
foreach(var filesystem in filesystems.Select(o => new
- {
- o.start,
- o.type
- }).Distinct())
+ {
+ o.start,
+ o.type
+ }).
+ Distinct())
{
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
filesystem.type, filesystem.start));
@@ -853,8 +833,7 @@ partial class Dump
sidecar.BlockMedias[0].MediaType = xmlType.type;
sidecar.BlockMedias[0].MediaSubType = xmlType.subType;
- if(!_dev.IsRemovable ||
- _dev.IsUsb)
+ if(!_dev.IsRemovable || _dev.IsUsb)
{
if(_dev.Type == DeviceType.ATAPI)
sidecar.BlockMedias[0].Interface = "ATAPI";
@@ -896,17 +875,17 @@ partial class Dump
UpdateStatus?.Invoke("");
UpdateStatus?.
- Invoke(string.Format(
- Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
- _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
- totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
- _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
+ Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
+ _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
+ totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
+ _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(totalDuration.Milliseconds()).Humanize()));
+ Per(totalDuration.Milliseconds()).
+ Humanize()));
if(maxSpeed > 0)
{
diff --git a/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs b/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs
index 0abfccd57..17004bee1 100644
--- a/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs
+++ b/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs
@@ -138,7 +138,8 @@ public partial class Dump
_dumpLog.WriteLine(outputFormat.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -153,8 +154,7 @@ public partial class Dump
_dev.PlatformId, ref _resume, ref currentTry, ref extents, _dev.FirmwareRevision,
_private, _force);
- if(currentTry == null ||
- extents == null)
+ if(currentTry == null || extents == null)
{
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_process_resume_file_not_continuing);
@@ -202,27 +202,22 @@ public partial class Dump
if(blocks - i < blocksToRead)
blocksToRead = (uint)(blocks - i);
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, blocks);
sense = _dev.Read12(out readBuffer, out senseBuf, 0, false, true, false, false, (uint)i, blockSize, 0,
blocksToRead, false, _dev.Timeout, out double cmdDuration);
totalDuration += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mhddLog.Write(i, cmdDuration, blocksToRead);
ibgLog.Write(i, currentSpeed * 1024);
@@ -307,10 +302,7 @@ public partial class Dump
#region Trimming
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _trim &&
- newTrim)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
{
_trimStopwatch.Restart();
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
@@ -359,9 +351,7 @@ public partial class Dump
#region Error handling
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _retryPasses > 0)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
{
var pass = 1;
var forward = true;
@@ -389,7 +379,7 @@ public partial class Dump
if(dcMode10.HasValue)
{
foreach(Modes.ModePage modePage in dcMode10.Value.Pages.Where(modePage =>
- modePage is { Page: 0x01, Subpage: 0x00 }))
+ modePage is { Page: 0x01, Subpage: 0x00 }))
currentModePage = modePage;
}
}
@@ -401,7 +391,7 @@ public partial class Dump
if(dcMode6.HasValue)
{
foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage =>
- modePage is { Page: 0x01, Subpage: 0x00 }))
+ modePage is { Page: 0x01, Subpage: 0x00 }))
currentModePage = modePage;
}
}
@@ -496,10 +486,8 @@ public partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_forward,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_forward,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_forward,
badSector, pass));
}
@@ -507,10 +495,8 @@ public partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_reverse,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_reverse,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_reverse,
badSector, pass));
}
@@ -523,8 +509,7 @@ public partial class Dump
if(sense || _dev.Error)
_errorLog?.WriteLine(badSector, _dev.Error, _dev.LastError, senseBuf);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
@@ -540,9 +525,7 @@ public partial class Dump
outputFormat.WriteSector(readBuffer, badSector);
}
- if(pass < _retryPasses &&
- !_aborted &&
- _resume.BadBlocks.Count > 0)
+ if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
{
pass++;
forward = !forward;
@@ -559,7 +542,10 @@ public partial class Dump
var md = new Modes.DecodedMode
{
Header = new Modes.ModeHeader(),
- Pages = new[] { currentModePage.Value }
+ Pages = new[]
+ {
+ currentModePage.Value
+ }
};
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
@@ -589,7 +575,8 @@ public partial class Dump
if(!outputFormat.SetImageInfo(metadata))
{
- ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
+ ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata +
+ Environment.NewLine +
outputFormat.ErrorMessage);
}
@@ -663,7 +650,8 @@ public partial class Dump
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
- ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalChkDuration.Milliseconds()).
+ ByteSize.FromBytes(blockSize * (blocks + 1)).
+ Per(totalChkDuration.Milliseconds()).
Humanize());
if(_preSidecar != null)
@@ -685,10 +673,11 @@ public partial class Dump
if(filesystems.Count > 0)
{
foreach(var filesystem in filesystems.Select(o => new
- {
- o.start,
- o.type
- }).Distinct())
+ {
+ o.start,
+ o.type
+ }).
+ Distinct())
{
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
filesystem.type, filesystem.start));
@@ -733,17 +722,17 @@ public partial class Dump
UpdateStatus?.Invoke("");
UpdateStatus?.
- Invoke(string.Format(
- Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
- _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
- totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
- _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
+ Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
+ _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
+ totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
+ _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(totalDuration.Milliseconds()).Humanize()));
+ Per(totalDuration.Milliseconds()).
+ Humanize()));
if(maxSpeed > 0)
{
diff --git a/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs b/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs
index dbeee09ba..6a5c816bb 100644
--- a/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs
+++ b/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs
@@ -146,7 +146,8 @@ public partial class Dump
_dumpLog.WriteLine(outputOptical.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputOptical.ErrorMessage);
+ Environment.NewLine +
+ outputOptical.ErrorMessage);
return;
}
@@ -175,8 +176,7 @@ public partial class Dump
_dev.PlatformId, ref _resume, ref currentTry, ref extents, _dev.FirmwareRevision,
_private, _force);
- if(currentTry == null ||
- extents == null)
+ if(currentTry == null || extents == null)
{
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_process_resume_file_not_continuing);
@@ -224,19 +224,15 @@ public partial class Dump
if(blocks - i < blocksToRead)
blocksToRead = (uint)(blocks - i);
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)blocks);
sense = _dev.Read12(out readBuffer, out senseBuf, 0, false, true, false, false, (uint)(umdStart + i * 4),
512, 0, blocksToRead * 4, false, _dev.Timeout, out double cmdDuration);
@@ -245,8 +241,7 @@ public partial class Dump
_writeStopwatch.Restart();
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mhddLog.Write(i, cmdDuration, blocksToRead);
ibgLog.Write(i, currentSpeed * 1024);
@@ -328,10 +323,7 @@ public partial class Dump
#region Trimming
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _trim &&
- newTrim)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
{
_trimStopwatch.Restart();
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
@@ -378,9 +370,7 @@ public partial class Dump
#region Error handling
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _retryPasses > 0)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
{
var pass = 1;
var forward = true;
@@ -403,7 +393,7 @@ public partial class Dump
if(dcMode6.HasValue)
{
foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage =>
- modePage is { Page: 0x01, Subpage: 0x00 }))
+ modePage is { Page: 0x01, Subpage: 0x00 }))
currentModePage = modePage;
}
}
@@ -497,10 +487,8 @@ public partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_forward,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_forward,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_forward,
badSector, pass));
}
@@ -508,10 +496,8 @@ public partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_reverse,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_reverse,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_reverse,
badSector, pass));
}
@@ -525,8 +511,7 @@ public partial class Dump
if(sense || _dev.Error)
_errorLog?.WriteLine(badSector, _dev.Error, _dev.LastError, senseBuf);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
@@ -542,9 +527,7 @@ public partial class Dump
outputOptical.WriteSector(readBuffer, badSector);
}
- if(pass < _retryPasses &&
- !_aborted &&
- _resume.BadBlocks.Count > 0)
+ if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
{
pass++;
forward = !forward;
@@ -561,7 +544,10 @@ public partial class Dump
var md = new Modes.DecodedMode
{
Header = new Modes.ModeHeader(),
- Pages = new[] { currentModePage.Value }
+ Pages = new[]
+ {
+ currentModePage.Value
+ }
};
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
@@ -592,7 +578,8 @@ public partial class Dump
if(!outputOptical.SetImageInfo(metadata))
{
- ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
+ ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata +
+ Environment.NewLine +
outputOptical.ErrorMessage);
}
@@ -626,17 +613,17 @@ public partial class Dump
UpdateStatus?.Invoke("");
UpdateStatus?.
- Invoke(string.Format(
- Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
- _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
- totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
- _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
+ Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
+ _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
+ totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
+ _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(totalDuration.Milliseconds()).Humanize()));
+ Per(totalDuration.Milliseconds()).
+ Humanize()));
if(maxSpeed > 0)
{
diff --git a/Aaru.Core/Devices/Dumping/ResumeSupport.cs b/Aaru.Core/Devices/Dumping/ResumeSupport.cs
index 9a519f829..67e24bf38 100644
--- a/Aaru.Core/Devices/Dumping/ResumeSupport.cs
+++ b/Aaru.Core/Devices/Dumping/ResumeSupport.cs
@@ -84,8 +84,7 @@ static class ResumeSupport
throw new InvalidOperationException(Localization.Core.Resume_specifies_not_tape_but_device_is_tape);
}
- if(resume.Removable != removable &&
- !force)
+ if(resume.Removable != removable && !force)
{
if(resume.Removable)
{
@@ -97,60 +96,47 @@ static class ResumeSupport
Resume_specifies_non_removable_but_device_is_removable);
}
- if(!isTape &&
- resume.LastBlock != blocks - 1 &&
- !force)
+ if(!isTape && resume.LastBlock != blocks - 1 && !force)
{
throw new
- InvalidOperationException(string.Format(
- Localization.Core.
- Resume_file_different_number_of_blocks_not_continuing,
- resume.LastBlock + 1, blocks));
+ InvalidOperationException(string.Format(Localization.Core.Resume_file_different_number_of_blocks_not_continuing,
+ resume.LastBlock + 1, blocks));
}
foreach(DumpHardware oldTry in resume.Tries)
{
- if(!removable &&
- !force)
+ if(!removable && !force)
{
if(oldTry.Manufacturer != manufacturer)
{
throw new
InvalidOperationException(string.
- Format(
- Localization.Core.
- Resume_file_different_manufacturer_not_continuing,
- oldTry.Manufacturer, manufacturer));
+ Format(Localization.Core.Resume_file_different_manufacturer_not_continuing,
+ oldTry.Manufacturer, manufacturer));
}
if(oldTry.Model != model)
{
throw new
InvalidOperationException(string.
- Format(
- Localization.Core.
- Resume_file_different_model_not_continuing,
- oldTry.Model, model));
+ Format(Localization.Core.Resume_file_different_model_not_continuing,
+ oldTry.Model, model));
}
if(oldTry.Serial != serial)
{
throw new
InvalidOperationException(string.
- Format(
- Localization.Core.
- Resume_file_different_serial_number_not_continuing,
- oldTry.Serial, serial));
+ Format(Localization.Core.Resume_file_different_serial_number_not_continuing,
+ oldTry.Serial, serial));
}
if(oldTry.Firmware != firmware)
{
throw new
InvalidOperationException(string.
- Format(
- Localization.Core.
- Resume_file_different_firmware_revision_not_continuing,
- oldTry.Firmware, firmware));
+ Format(Localization.Core.Resume_file_different_firmware_revision_not_continuing,
+ oldTry.Firmware, firmware));
}
}
@@ -162,8 +148,11 @@ static class ResumeSupport
oldTry.Software.Version != Version.GetVersion())
continue;
- if(removable && (oldTry.Manufacturer != manufacturer || oldTry.Model != model ||
- oldTry.Serial != serial || oldTry.Firmware != firmware))
+ if(removable &&
+ (oldTry.Manufacturer != manufacturer ||
+ oldTry.Model != model ||
+ oldTry.Serial != serial ||
+ oldTry.Firmware != firmware))
continue;
currentTry = oldTry;
diff --git a/Aaru.Core/Devices/Dumping/SSC.cs b/Aaru.Core/Devices/Dumping/SSC.cs
index 370795c4d..1dfb803cc 100644
--- a/Aaru.Core/Devices/Dumping/SSC.cs
+++ b/Aaru.Core/Devices/Dumping/SSC.cs
@@ -78,14 +78,14 @@ partial class Dump
InitProgress?.Invoke();
- if(decSense.HasValue &&
- decSense.Value.SenseKey != SenseKeys.NoSense)
+ if(decSense.HasValue && decSense.Value.SenseKey != SenseKeys.NoSense)
{
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense, decSense.Value.SenseKey, decSense.Value.ASC,
decSense.Value.ASCQ);
StoppingErrorMessage?.Invoke(Localization.Core.Drive_has_status_error_please_correct_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
return;
}
@@ -120,7 +120,8 @@ partial class Dump
decSense.Value.ASC != 0x00))
{
StoppingErrorMessage?.Invoke(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
@@ -141,12 +142,12 @@ partial class Dump
decSense = Sense.Decode(senseBuf);
if(decSense.HasValue &&
- (decSense.Value.ASC == 0x20 && decSense.Value.ASCQ != 0x00 || decSense.Value.ASC != 0x20 &&
- decSense.Value.SenseKey !=
- SenseKeys.IllegalRequest))
+ (decSense.Value.ASC == 0x20 && decSense.Value.ASCQ != 0x00 ||
+ decSense.Value.ASC != 0x20 && decSense.Value.SenseKey != SenseKeys.IllegalRequest))
{
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_get_position_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
_dumpLog.WriteLine(Localization.Core.Could_not_get_position_Sense_follows);
@@ -170,7 +171,8 @@ partial class Dump
if(sense)
{
StoppingErrorMessage?.Invoke(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows +
- Environment.NewLine + decSense?.Description);
+ Environment.NewLine +
+ decSense?.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
@@ -196,7 +198,8 @@ partial class Dump
decSense.Value.ASC != 0x00))
{
StoppingErrorMessage?.Invoke(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
@@ -213,7 +216,8 @@ partial class Dump
decSense = Sense.Decode(senseBuf);
StoppingErrorMessage?.Invoke(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows +
- Environment.NewLine + decSense?.Description);
+ Environment.NewLine +
+ decSense?.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
@@ -248,8 +252,7 @@ partial class Dump
sense = _dev.ModeSense10(out cmdBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0xFF, 5,
out duration);
- if(!sense ||
- _dev.Error)
+ if(!sense || _dev.Error)
{
sense = _dev.ModeSense10(out cmdBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F,
0x00, 5, out duration);
@@ -257,8 +260,7 @@ partial class Dump
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);
@@ -278,8 +280,7 @@ partial class Dump
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);
@@ -365,9 +366,10 @@ partial class Dump
if(!eom)
{
- StoppingErrorMessage?.Invoke(
- Localization.Core.Drive_could_not_return_back_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ StoppingErrorMessage?.Invoke(Localization.Core.
+ Drive_could_not_return_back_Sense_follows +
+ Environment.NewLine +
+ decSense.Value.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_return_back_Sense_follows);
@@ -382,15 +384,15 @@ partial class Dump
transferLen = 1;
sense = _dev.Read6(out cmdBuf, out senseBuf, false, fixedLen, transferLen, blockSize,
- _dev.Timeout,
- out duration);
+ _dev.Timeout, out duration);
if(sense)
{
decSense = Sense.Decode(senseBuf);
StoppingErrorMessage?.Invoke(Localization.Core.Drive_could_not_read_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_read_Sense_follows);
@@ -426,8 +428,8 @@ partial class Dump
transferLen = blockSize;
- UpdateStatus?.Invoke(string.Format(
- Localization.Core.Blocksize_changed_to_0_bytes_at_block_1,
+ UpdateStatus?.
+ Invoke(string.Format(Localization.Core.Blocksize_changed_to_0_bytes_at_block_1,
blockSize, currentBlock));
_dumpLog.WriteLine(Localization.Core.Blocksize_changed_to_0_bytes_at_block_1, blockSize,
@@ -444,7 +446,8 @@ partial class Dump
StoppingErrorMessage?.Invoke(Localization.Core.
Drive_could_not_go_back_one_block_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_go_back_one_block_Sense_follows);
@@ -458,7 +461,8 @@ partial class Dump
}
StoppingErrorMessage?.Invoke(Localization.Core.Drive_could_not_read_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_read_Sense_follows);
@@ -469,7 +473,8 @@ partial class Dump
}
default:
StoppingErrorMessage?.Invoke(Localization.Core.Drive_could_not_read_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_read_Sense_follows);
@@ -503,7 +508,8 @@ partial class Dump
if(!eom)
{
StoppingErrorMessage?.Invoke(Localization.Core.Drive_could_not_return_back_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_return_back_Sense_follows);
@@ -521,8 +527,7 @@ partial class Dump
_dev.PlatformId, ref _resume, ref currentTry, ref extents, _dev.FirmwareRevision,
_private, _force, true);
- if(currentTry == null ||
- extents == null)
+ if(currentTry == null || extents == null)
{
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_process_resume_file_not_continuing);
@@ -772,7 +777,8 @@ partial class Dump
decSense.Value.ASC != 0x00))
{
StoppingErrorMessage?.Invoke(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
@@ -792,7 +798,8 @@ partial class Dump
_dumpLog.WriteLine(outputTape.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_setting_output_image_in_tape_mode_not_continuing +
- Environment.NewLine + outputTape.ErrorMessage);
+ Environment.NewLine +
+ outputTape.ErrorMessage);
return;
}
@@ -806,7 +813,8 @@ partial class Dump
_dumpLog.WriteLine(outputTape.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputTape.ErrorMessage);
+ Environment.NewLine +
+ outputTape.ErrorMessage);
return;
}
@@ -828,8 +836,7 @@ partial class Dump
FirstBlock = currentBlock
};
- if((canLocate || canLocateLong) &&
- _resume.NextBlock > 0)
+ if((canLocate || canLocateLong) && _resume.NextBlock > 0)
{
currentBlock = _resume.NextBlock;
@@ -905,12 +912,10 @@ partial class Dump
continue;
}
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
PulseProgress?.Invoke(string.Format(Localization.Core.Reading_block_0_1, currentBlock,
@@ -921,9 +926,7 @@ partial class Dump
totalDuration += duration;
- if(sense &&
- senseBuf?.Length != 0 &&
- !ArrayHelpers.ArrayIsNullOrEmpty(senseBuf))
+ if(sense && senseBuf?.Length != 0 && !ArrayHelpers.ArrayIsNullOrEmpty(senseBuf))
{
decSense = Sense.Decode(senseBuf);
@@ -945,9 +948,7 @@ partial class Dump
Sense.DecodeDescriptor04(desc04, out filemark, out eom, out ili);
}
- if(decSense.Value is { ASC: 0x00, ASCQ: 0x00 } &&
- ili &&
- valid)
+ if(decSense.Value is { ASC: 0x00, ASCQ: 0x00 } && ili && valid)
{
blockSize = (uint)((int)blockSize - BitConverter.ToInt32(BitConverter.GetBytes(information), 0));
@@ -969,7 +970,8 @@ partial class Dump
decSense = Sense.Decode(senseBuf);
StoppingErrorMessage?.Invoke(Localization.Core.Drive_could_not_go_back_one_block_Sense_follows +
- Environment.NewLine + decSense.Value.Description);
+ Environment.NewLine +
+ decSense.Value.Description);
outputTape.Close();
_dumpLog.WriteLine(Localization.Core.Drive_could_not_go_back_one_block_Sense_follows);
@@ -1042,10 +1044,8 @@ partial class Dump
if(decSense is null)
{
StoppingErrorMessage?.
- Invoke(string.Format(
- Localization.Core.
- Drive_could_not_read_block_0_Sense_cannot_be_decoded_look_at_log_for_dump,
- currentBlock));
+ Invoke(string.Format(Localization.Core.Drive_could_not_read_block_0_Sense_cannot_be_decoded_look_at_log_for_dump,
+ currentBlock));
_dumpLog.WriteLine(string.Format(Localization.Core.Drive_could_not_read_block_0_Sense_bytes_follow,
currentBlock));
@@ -1148,10 +1148,7 @@ partial class Dump
#region Error handling
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _retryPasses > 0 &&
- (canLocate || canLocateLong))
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0 && (canLocate || canLocateLong))
{
var pass = 1;
var forward = false;
@@ -1183,10 +1180,8 @@ partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_forward,
- badBlock, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_forward,
+ badBlock, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_forward,
badBlock, pass));
}
@@ -1194,10 +1189,8 @@ partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_reverse,
- badBlock, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_reverse,
+ badBlock, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_reverse,
badBlock, pass));
}
@@ -1287,8 +1280,7 @@ partial class Dump
totalDuration += duration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
_resume.BadBlocks.Remove(badBlock);
extents.Add(badBlock);
@@ -1303,9 +1295,7 @@ partial class Dump
outputTape.WriteSector(cmdBuf, badBlock);
}
- if(pass < _retryPasses &&
- !_aborted &&
- _resume.BadBlocks.Count > 0)
+ if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
{
pass++;
forward = !forward;
@@ -1345,7 +1335,8 @@ partial class Dump
if(!outputTape.SetImageInfo(metadata))
{
- ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
+ ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata +
+ Environment.NewLine +
outputTape.ErrorMessage);
}
@@ -1425,7 +1416,8 @@ partial class Dump
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
- ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalChkDuration.Milliseconds()).
+ ByteSize.FromBytes(blockSize * (blocks + 1)).
+ Per(totalChkDuration.Milliseconds()).
Humanize());
if(_preSidecar != null)
@@ -1447,10 +1439,11 @@ partial class Dump
if(filesystems.Count > 0)
{
foreach(var filesystem in filesystems.Select(o => new
- {
- o.start,
- o.type
- }).Distinct())
+ {
+ o.start,
+ o.type
+ }).
+ Distinct())
{
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
filesystem.type, filesystem.start));
@@ -1468,8 +1461,7 @@ partial class Dump
sidecar.BlockMedias[0].MediaSubType = xmlType.subType;
// TODO: Implement device firmware revision
- if(!_dev.IsRemovable ||
- _dev.IsUsb)
+ if(!_dev.IsRemovable || _dev.IsUsb)
{
if(_dev.Type == DeviceType.ATAPI)
sidecar.BlockMedias[0].Interface = "ATAPI";
@@ -1509,17 +1501,17 @@ partial class Dump
UpdateStatus?.Invoke("");
UpdateStatus?.
- Invoke(string.Format(
- Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
- _sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
- totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
- _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
+ Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
+ _sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
+ totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
+ _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(totalDuration.Milliseconds()).Humanize()));
+ Per(totalDuration.Milliseconds()).
+ Humanize()));
if(maxSpeed > 0)
{
diff --git a/Aaru.Core/Devices/Dumping/Sbc/Data.cs b/Aaru.Core/Devices/Dumping/Sbc/Data.cs
index b684df0fc..1e6da47f4 100644
--- a/Aaru.Core/Devices/Dumping/Sbc/Data.cs
+++ b/Aaru.Core/Devices/Dumping/Sbc/Data.cs
@@ -91,29 +91,22 @@ partial class Dump
if(blocks - i < blocksToRead)
blocksToRead = (uint)(blocks - i);
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)blocks);
sense = scsiReader.ReadBlocks(out buffer, i, blocksToRead, out double cmdDuration, out _, out _);
totalDuration += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
- if(Settings.Settings.Current.EnableDecryption &&
- discKey != null &&
- _titleKeys)
+ if(Settings.Settings.Current.EnableDecryption && discKey != null && _titleKeys)
{
for(ulong j = 0; j < blocksToRead; j++)
{
@@ -137,8 +130,10 @@ partial class Dump
if(titleKey.HasValue)
{
- outputFormat.WriteSectorTag(new[] { titleKey.Value.CMI }, i + j,
- SectorTagType.DvdSectorCmi);
+ outputFormat.WriteSectorTag(new[]
+ {
+ titleKey.Value.CMI
+ }, i + j, SectorTagType.DvdSectorCmi);
}
else
continue;
@@ -147,11 +142,15 @@ partial class Dump
if((titleKey.Value.CMI & 0x80) >> 7 == 0)
{
// The CMI indicates this sector is not encrypted.
- outputFormat.WriteSectorTag(new byte[] { 0, 0, 0, 0, 0 }, i + j,
- SectorTagType.DvdSectorTitleKey);
+ outputFormat.WriteSectorTag(new byte[]
+ {
+ 0, 0, 0, 0, 0
+ }, i + j, SectorTagType.DvdSectorTitleKey);
- outputFormat.WriteSectorTag(new byte[] { 0, 0, 0, 0, 0 }, i + j,
- SectorTagType.DvdTitleKeyDecrypted);
+ outputFormat.WriteSectorTag(new byte[]
+ {
+ 0, 0, 0, 0, 0
+ }, i + j, SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys.Remove(i + j);
@@ -162,11 +161,15 @@ partial class Dump
// not encrypted even if the CMI says it is.
if(titleKey.Value.Key.All(k => k == 0))
{
- outputFormat.WriteSectorTag(new byte[] { 0, 0, 0, 0, 0 }, i + j,
- SectorTagType.DvdSectorTitleKey);
+ outputFormat.WriteSectorTag(new byte[]
+ {
+ 0, 0, 0, 0, 0
+ }, i + j, SectorTagType.DvdSectorTitleKey);
- outputFormat.WriteSectorTag(new byte[] { 0, 0, 0, 0, 0 }, i + j,
- SectorTagType.DvdTitleKeyDecrypted);
+ outputFormat.WriteSectorTag(new byte[]
+ {
+ 0, 0, 0, 0, 0
+ }, i + j, SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys.Remove(i + j);
diff --git a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs
index 8516b18a6..33809ddd5 100644
--- a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs
+++ b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs
@@ -111,15 +111,13 @@ partial class Dump
{
mediaTags = new Dictionary();
- if(_dev.IsUsb &&
- _dev.UsbDescriptors != null)
+ if(_dev.IsUsb && _dev.UsbDescriptors != null)
mediaTags.Add(MediaTagType.USB_Descriptors, null);
if(_dev.Type == DeviceType.ATAPI)
mediaTags.Add(MediaTagType.ATAPI_IDENTIFY, null);
- if(_dev.IsPcmcia &&
- _dev.Cis != null)
+ if(_dev.IsPcmcia && _dev.Cis != null)
mediaTags.Add(MediaTagType.PCMCIA_CIS, null);
sense = _dev.ScsiInquiry(out byte[] cmdBuf, out _);
@@ -137,15 +135,13 @@ partial class Dump
sense = _dev.ModeSense10(out cmdBuf, out _, false, true, ScsiModeSensePageControl.Current, 0x3F, 0xFF,
5, out _);
- if(!sense ||
- _dev.Error)
+ if(!sense || _dev.Error)
{
sense = _dev.ModeSense10(out cmdBuf, out _, false, true, ScsiModeSensePageControl.Current, 0x3F,
0x00, 5, out _);
}
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue)
{
@@ -169,8 +165,7 @@ partial class Dump
if(sense || _dev.Error)
sense = _dev.ModeSense(out cmdBuf, out _, 5, out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue)
{
@@ -189,7 +184,8 @@ partial class Dump
// TODO: Fix this
containsFloppyPage = decMode.Value.Pages?.Aggregate(containsFloppyPage,
(current, modePage) =>
- current | modePage.Page == 0x05) == true;
+ current | modePage.Page == 0x05) ==
+ true;
}
}
}
@@ -231,8 +227,7 @@ partial class Dump
return;
}
- if(blocks != 0 &&
- blockSize != 0)
+ if(blocks != 0 && blockSize != 0)
{
blocks++;
@@ -367,7 +362,8 @@ partial class Dump
_dumpLog.WriteLine(outputFormat.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -402,8 +398,7 @@ partial class Dump
{
writeSingleOpticalTrack = false;
- if(discInformation?.Sessions > 1 &&
- !canStoreNotCdSessions)
+ if(discInformation?.Sessions > 1 && !canStoreNotCdSessions)
{
if(_force)
{
@@ -525,7 +520,8 @@ partial class Dump
_dumpLog.WriteLine(outputFormat.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -554,7 +550,8 @@ partial class Dump
StoppingErrorMessage?.Invoke(Localization.Core.
Error_sending_tracks_to_output_image_not_continuing +
- Environment.NewLine + opticalPlugin.ErrorMessage);
+ Environment.NewLine +
+ opticalPlugin.ErrorMessage);
return;
}
@@ -610,11 +607,9 @@ partial class Dump
UpdateStatus?.
Invoke(string.
- Format(
- Localization.Core.
- Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
- rigidPage.Value.Cylinders, rigidPage.Value.Heads,
- (uint)(blocks / (rigidPage.Value.Cylinders * rigidPage.Value.Heads))));
+ Format(Localization.Core.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
+ rigidPage.Value.Cylinders, rigidPage.Value.Heads,
+ (uint)(blocks / (rigidPage.Value.Cylinders * rigidPage.Value.Heads))));
outputFormat.SetGeometry(rigidPage.Value.Cylinders, rigidPage.Value.Heads,
(uint)(blocks / (rigidPage.Value.Cylinders * rigidPage.Value.Heads)));
@@ -637,11 +632,9 @@ partial class Dump
UpdateStatus?.
Invoke(string.
- Format(
- Localization.Core.
- Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
- flexiblePage.Value.Cylinders, flexiblePage.Value.Heads,
- flexiblePage.Value.SectorsPerTrack));
+ Format(Localization.Core.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
+ flexiblePage.Value.Cylinders, flexiblePage.Value.Heads,
+ flexiblePage.Value.SectorsPerTrack));
outputFormat.SetGeometry(flexiblePage.Value.Cylinders, flexiblePage.Value.Heads,
flexiblePage.Value.SectorsPerTrack);
@@ -665,7 +658,8 @@ partial class Dump
_dumpLog.WriteLine(outputFormat.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -705,8 +699,8 @@ partial class Dump
bool discIs80Mm =
mediaTags?.TryGetValue(MediaTagType.DVD_PFI, out byte[] pfiBytes) == true &&
PFI.Decode(pfiBytes, dskType)?.DiscSize == DVDSize.Eighty ||
- mediaTags?.TryGetValue(MediaTagType.BD_DI, out byte[] diBytes) == true && DI.
- Decode(diBytes)?.Units?.Any(s => s.DiscSize == DI.BluSize.Eighty) == true;
+ mediaTags?.TryGetValue(MediaTagType.BD_DI, out byte[] diBytes) == true &&
+ DI.Decode(diBytes)?.Units?.Any(s => s.DiscSize == DI.BluSize.Eighty) == true;
Spiral.DiscParameters discSpiralParameters = Spiral.DiscParametersFromMediaType(dskType, discIs80Mm);
@@ -724,8 +718,7 @@ partial class Dump
_mediaGraph?.PaintSectorsBad(_resume.BadBlocks);
}
- if(currentTry == null ||
- extents == null)
+ if(currentTry == null || extents == null)
{
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_process_resume_file_not_continuing);
@@ -786,9 +779,7 @@ partial class Dump
ReadSbcData(blocks, blocksToRead, blockSize, currentTry, extents, ref currentSpeed, ref minSpeed,
ref maxSpeed, ref totalDuration, scsiReader, mhddLog, ibgLog, ref imageWriteDuration,
ref newTrim, ref dvdDecrypt,
- mediaTags.TryGetValue(MediaTagType.DVD_DiscKey_Decrypted, out byte[] tag)
- ? tag
- : null);
+ mediaTags.TryGetValue(MediaTagType.DVD_DiscKey_Decrypted, out byte[] tag) ? tag : null);
}
_dumpStopwatch.Stop();
@@ -821,10 +812,7 @@ partial class Dump
#region Trimming
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _trim &&
- newTrim)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
{
_trimStopwatch.Restart();
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
@@ -850,9 +838,7 @@ partial class Dump
#region Error handling
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _retryPasses > 0)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
RetrySbcData(scsiReader, currentTry, extents, ref totalDuration, blankExtents);
if(_resume.MissingTitleKeys?.Count > 0 &&
@@ -884,7 +870,8 @@ partial class Dump
// Cannot write tag to image
StoppingErrorMessage?.Invoke(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key));
- _dumpLog.WriteLine(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key) + Environment.NewLine +
+ _dumpLog.WriteLine(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key) +
+ Environment.NewLine +
outputFormat.ErrorMessage);
return;
@@ -892,23 +879,21 @@ partial class Dump
}
else
{
- if(!_dev.IsRemovable ||
- _dev.IsUsb)
+ if(!_dev.IsRemovable || _dev.IsUsb)
{
- if(_dev.IsUsb &&
- _dev.UsbDescriptors != null)
+ if(_dev.IsUsb && _dev.UsbDescriptors != null)
{
UpdateStatus?.Invoke(Localization.Core.Reading_USB_descriptors);
_dumpLog.WriteLine(Localization.Core.Reading_USB_descriptors);
ret = outputFormat.WriteMediaTag(_dev.UsbDescriptors, MediaTagType.USB_Descriptors);
- if(!ret &&
- !_force)
+ if(!ret && !_force)
{
_dumpLog.WriteLine(Localization.Core.Cannot_write_USB_descriptors);
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_USB_descriptors +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -929,13 +914,13 @@ partial class Dump
ret = outputFormat.WriteMediaTag(cmdBuf, MediaTagType.ATAPI_IDENTIFY);
- if(!ret &&
- !_force)
+ if(!ret && !_force)
{
_dumpLog.WriteLine(Localization.Core.Cannot_write_ATAPI_IDENTIFY_PACKET_DEVICE);
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_ATAPI_IDENTIFY_PACKET_DEVICE +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -950,12 +935,12 @@ partial class Dump
_dumpLog.WriteLine(Localization.Core.Requesting_SCSI_INQUIRY);
ret = outputFormat.WriteMediaTag(cmdBuf, MediaTagType.SCSI_INQUIRY);
- if(!ret &&
- !_force)
+ if(!ret && !_force)
{
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCSI_INQUIRY);
- _dumpLog.WriteLine(Localization.Core.Cannot_write_SCSI_INQUIRY + Environment.NewLine +
+ _dumpLog.WriteLine(Localization.Core.Cannot_write_SCSI_INQUIRY +
+ Environment.NewLine +
outputFormat.ErrorMessage);
return;
@@ -967,27 +952,25 @@ partial class Dump
sense = _dev.ModeSense10(out cmdBuf, out _, false, true, ScsiModeSensePageControl.Current, 0x3F,
0xFF, 5, out _);
- if(!sense ||
- _dev.Error)
+ if(!sense || _dev.Error)
{
sense = _dev.ModeSense10(out cmdBuf, out _, false, true, ScsiModeSensePageControl.Current, 0x3F,
0x00, 5, out _);
}
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue)
{
ret = outputFormat.WriteMediaTag(cmdBuf, MediaTagType.SCSI_MODESENSE_10);
- if(!ret &&
- !_force)
+ if(!ret && !_force)
{
_dumpLog.WriteLine(Localization.Core.Cannot_write_SCSI_MODE_SENSE_10);
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCSI_MODE_SENSE_10 +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -1009,20 +992,19 @@ partial class Dump
if(sense || _dev.Error)
sense = _dev.ModeSense(out cmdBuf, out _, 5, out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue)
{
ret = outputFormat.WriteMediaTag(cmdBuf, MediaTagType.SCSI_MODESENSE_6);
- if(!ret &&
- !_force)
+ if(!ret && !_force)
{
_dumpLog.WriteLine(Localization.Core.Cannot_write_SCSI_MODE_SENSE_6);
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCSI_MODE_SENSE_6 +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -1051,7 +1033,8 @@ partial class Dump
if(!outputFormat.SetImageInfo(metadata))
{
- ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
+ ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata +
+ Environment.NewLine +
outputFormat.ErrorMessage);
}
@@ -1139,11 +1122,9 @@ partial class Dump
}
// All USB flash drives report as removable, even if the media is not removable
- if(!_dev.IsRemovable ||
- _dev.IsUsb)
+ if(!_dev.IsRemovable || _dev.IsUsb)
{
- if(_dev.IsUsb &&
- _dev.UsbDescriptors != null)
+ if(_dev.IsUsb && _dev.UsbDescriptors != null)
{
if(outputFormat.SupportedMediaTags.Contains(MediaTagType.USB_Descriptors))
{
@@ -1241,15 +1222,13 @@ partial class Dump
sense = _dev.ModeSense10(out cmdBuf, out _, false, true, ScsiModeSensePageControl.Current,
0x3F, 0xFF, 5, out _);
- if(!sense ||
- _dev.Error)
+ if(!sense || _dev.Error)
{
sense = _dev.ModeSense10(out cmdBuf, out _, false, true,
ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out _);
}
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue)
{
@@ -1280,8 +1259,7 @@ partial class Dump
if(sense || _dev.Error)
sense = _dev.ModeSense(out cmdBuf, out _, 5, out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue)
{
@@ -1312,10 +1290,11 @@ partial class Dump
if(filesystems.Count > 0)
{
foreach(var filesystem in filesystems.Select(o => new
- {
- o.start,
- o.type
- }).Distinct())
+ {
+ o.start,
+ o.type
+ }).
+ Distinct())
{
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
filesystem.type, filesystem.start));
@@ -1333,8 +1312,7 @@ partial class Dump
sidecar.BlockMedias[0].MediaSubType = xmlType.subType;
// TODO: Implement device firmware revision
- if(!_dev.IsRemovable ||
- _dev.IsUsb)
+ if(!_dev.IsRemovable || _dev.IsUsb)
{
if(_dev.Type == DeviceType.ATAPI)
sidecar.BlockMedias[0].Interface = "ATAPI";
@@ -1377,17 +1355,17 @@ partial class Dump
UpdateStatus?.Invoke("");
UpdateStatus?.
- Invoke(string.Format(
- Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
- _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
- totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
- _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
+ Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
+ _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
+ totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
+ _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(totalDuration.Milliseconds())).Humanize());
+ Per(totalDuration.Milliseconds())).
+ Humanize());
if(maxSpeed > 0)
{
diff --git a/Aaru.Core/Devices/Dumping/Sbc/Error.cs b/Aaru.Core/Devices/Dumping/Sbc/Error.cs
index cf896e8e8..61aeee883 100644
--- a/Aaru.Core/Devices/Dumping/Sbc/Error.cs
+++ b/Aaru.Core/Devices/Dumping/Sbc/Error.cs
@@ -89,7 +89,7 @@ partial class Dump
if(dcMode10?.Pages != null)
{
foreach(Modes.ModePage modePage in dcMode10.Value.Pages.Where(modePage =>
- modePage is { Page: 0x01, Subpage: 0x00 }))
+ modePage is { Page: 0x01, Subpage: 0x00 }))
currentModePage = modePage;
}
}
@@ -100,8 +100,10 @@ partial class Dump
if(dcMode6?.Pages != null)
{
- foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage =>
- modePage is { Page: 0x01, Subpage: 0x00 }))
+ foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage => modePage is
+ {
+ Page: 0x01, Subpage: 0x00
+ }))
currentModePage = modePage;
}
}
@@ -249,10 +251,8 @@ partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_forward,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_forward,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_forward, badSector,
pass));
}
@@ -260,10 +260,8 @@ partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_reverse,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_reverse,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_reverse, badSector,
pass));
}
@@ -301,9 +299,7 @@ partial class Dump
outputFormat.WriteSector(buffer, badSector);
}
- if(pass < _retryPasses &&
- !_aborted &&
- _resume.BadBlocks.Count > 0)
+ if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
{
pass++;
forward = !forward;
@@ -320,7 +316,10 @@ partial class Dump
var md = new Modes.DecodedMode
{
Header = new Modes.ModeHeader(),
- Pages = new[] { currentModePage.Value }
+ Pages = new[]
+ {
+ currentModePage.Value
+ }
};
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
@@ -384,17 +383,24 @@ partial class Dump
if(!titleKey.HasValue)
continue;
- outputFormat.WriteSectorTag(new[] { titleKey.Value.CMI }, missingKey, SectorTagType.DvdSectorCmi);
+ outputFormat.WriteSectorTag(new[]
+ {
+ titleKey.Value.CMI
+ }, missingKey, SectorTagType.DvdSectorCmi);
// If the CMI bit is 1, the sector is using copy protection, else it is not
// If the decoded title key is zeroed, there should be no copy protection
- if((titleKey.Value.CMI & 0x80) >> 7 == 0 ||
- titleKey.Value.Key.All(k => k == 0))
+ if((titleKey.Value.CMI & 0x80) >> 7 == 0 || titleKey.Value.Key.All(k => k == 0))
{
- outputFormat.WriteSectorTag(new byte[] { 0, 0, 0, 0, 0 }, missingKey, SectorTagType.DvdSectorTitleKey);
+ outputFormat.WriteSectorTag(new byte[]
+ {
+ 0, 0, 0, 0, 0
+ }, missingKey, SectorTagType.DvdSectorTitleKey);
- outputFormat.WriteSectorTag(new byte[] { 0, 0, 0, 0, 0 }, missingKey,
- SectorTagType.DvdTitleKeyDecrypted);
+ outputFormat.WriteSectorTag(new byte[]
+ {
+ 0, 0, 0, 0, 0
+ }, missingKey, SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys.Remove(missingKey);
@@ -421,9 +427,7 @@ partial class Dump
}
}
- if(pass < _retryPasses &&
- !_aborted &&
- _resume.MissingTitleKeys.Count > 0)
+ if(pass < _retryPasses && !_aborted && _resume.MissingTitleKeys.Count > 0)
{
pass++;
forward = !forward;
diff --git a/Aaru.Core/Devices/Dumping/Sbc/Optical.cs b/Aaru.Core/Devices/Dumping/Sbc/Optical.cs
index 0065ac3de..326589814 100644
--- a/Aaru.Core/Devices/Dumping/Sbc/Optical.cs
+++ b/Aaru.Core/Devices/Dumping/Sbc/Optical.cs
@@ -67,8 +67,7 @@ partial class Dump
DecodedSense? decodedSense = Sense.Decode(buffer);
- if(_dev.LastError != 0 ||
- decodedSense?.SenseKey == SenseKeys.IllegalRequest)
+ if(_dev.LastError != 0 || decodedSense?.SenseKey == SenseKeys.IllegalRequest)
{
UpdateStatus?.Invoke(Localization.Core.The_current_environment_doesn_t_support_the_medium_scan_command);
@@ -77,8 +76,7 @@ partial class Dump
}
// TODO: Find a place where MEDIUM SCAN works properly
- else if(buffer?.Length > 0 &&
- !ArrayHelpers.ArrayIsNullOrEmpty(buffer))
+ else if(buffer?.Length > 0 && !ArrayHelpers.ArrayIsNullOrEmpty(buffer))
AaruConsole.WriteLine(Localization.Core.MEDIUM_SCAN_github_plead_message);
changingCounter = false;
@@ -115,11 +113,8 @@ partial class Dump
c = (uint)(blocks - b);
UpdateProgress?.
- Invoke(
- written
- ? string.Format(Localization.Core.Scanning_for_0_written_blocks_starting_in_block_1, c, b)
- : string.Format(Localization.Core.Scanning_for_0_blank_blocks_starting_in_block_1, c, b),
- b, (long)blocks);
+ Invoke(written ? string.Format(Localization.Core.Scanning_for_0_written_blocks_starting_in_block_1, c, b) : string.Format(Localization.Core.Scanning_for_0_blank_blocks_starting_in_block_1, c, b),
+ b, (long)blocks);
conditionMet = _dev.MediumScan(out _, written, false, false, false, false, b, c, c, out _, out _,
uint.MaxValue, out _);
@@ -205,25 +200,20 @@ partial class Dump
if(extent.Item2 + 1 - i < blocksToRead)
blocksToRead = (uint)(extent.Item2 + 1 - i);
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)blocks);
sense = scsiReader.ReadBlocks(out buffer, i, blocksToRead, out double cmdDuration, out _, out _);
totalDuration += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mhddLog.Write(i, cmdDuration, blocksToRead);
ibgLog.Write(i, currentSpeed * 1024);
diff --git a/Aaru.Core/Devices/Dumping/Sbc/Trim.cs b/Aaru.Core/Devices/Dumping/Sbc/Trim.cs
index 51a5f7dec..781c0dacb 100644
--- a/Aaru.Core/Devices/Dumping/Sbc/Trim.cs
+++ b/Aaru.Core/Devices/Dumping/Sbc/Trim.cs
@@ -84,8 +84,7 @@ partial class Dump
continue;
}
- if((sense || _dev.Error) &&
- !recoveredError)
+ if((sense || _dev.Error) && !recoveredError)
continue;
_resume.BadBlocks.Remove(badSector);
diff --git a/Aaru.Core/Devices/Dumping/SecureDigital.cs b/Aaru.Core/Devices/Dumping/SecureDigital.cs
index 93a9c674a..51e324551 100644
--- a/Aaru.Core/Devices/Dumping/SecureDigital.cs
+++ b/Aaru.Core/Devices/Dumping/SecureDigital.cs
@@ -226,8 +226,9 @@ public partial class Dump
}
else
{
- supportsCmd23 = Decoders.SecureDigital.Decoders.DecodeSCR(scr)?.CommandSupport.
- HasFlag(CommandSupport.SetBlockCount) ?? false;
+ supportsCmd23 = Decoders.SecureDigital.Decoders.DecodeSCR(scr)?.
+ CommandSupport.HasFlag(CommandSupport.SetBlockCount) ??
+ false;
mediaTags.Add(MediaTagType.SD_SCR, null);
}
@@ -298,8 +299,7 @@ public partial class Dump
if(error)
blocksToRead /= 2;
- if(!error ||
- blocksToRead == 1)
+ if(!error || blocksToRead == 1)
break;
}
@@ -315,9 +315,7 @@ public partial class Dump
}
}
- if(_useBufferedReads &&
- blocksToRead > 1 &&
- !supportsCmd23)
+ if(_useBufferedReads && blocksToRead > 1 && !supportsCmd23)
{
while(true)
{
@@ -326,8 +324,7 @@ public partial class Dump
if(error)
blocksToRead /= 2;
- if(!error ||
- blocksToRead == 1)
+ if(!error || blocksToRead == 1)
break;
// Device is in timeout, reopen to reset
@@ -344,9 +341,7 @@ public partial class Dump
}
}
- if(!_useBufferedReads &&
- blocksToRead > 1 &&
- !supportsCmd23)
+ if(!_useBufferedReads && blocksToRead > 1 && !supportsCmd23)
{
while(true)
{
@@ -360,8 +355,7 @@ public partial class Dump
if(_dev.LastError == 110)
_dev.ReOpen();
- if(!error ||
- blocksToRead == 1)
+ if(!error || blocksToRead == 1)
break;
}
@@ -423,8 +417,7 @@ public partial class Dump
ResumeSupport.Process(true, false, blocks, _dev.Manufacturer, _dev.Model, _dev.Serial, _dev.PlatformId,
ref _resume, ref currentTry, ref extents, _dev.FirmwareRevision, _private, _force);
- if(currentTry == null ||
- extents == null)
+ if(currentTry == null || extents == null)
{
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_process_resume_file_not_continuing);
@@ -472,7 +465,8 @@ public partial class Dump
_dumpLog.WriteLine(outputFormat.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -509,12 +503,12 @@ public partial class Dump
: MediaTagType.MMC_CID);
// Cannot write CID to image
- if(!ret &&
- !_force)
+ if(!ret && !_force)
{
_dumpLog.WriteLine(Localization.Core.Cannot_write_CID_to_output_image);
- StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_CID_to_output_image + Environment.NewLine +
+ StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_CID_to_output_image +
+ Environment.NewLine +
outputFormat.ErrorMessage);
return;
@@ -530,12 +524,12 @@ public partial class Dump
: MediaTagType.MMC_CSD);
// Cannot write CSD to image
- if(!ret &&
- !_force)
+ if(!ret && !_force)
{
_dumpLog.WriteLine(Localization.Core.Cannot_write_CSD_to_output_image);
- StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_CSD_to_output_image + Environment.NewLine +
+ StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_CSD_to_output_image +
+ Environment.NewLine +
outputFormat.ErrorMessage);
return;
@@ -547,13 +541,13 @@ public partial class Dump
ret = outputFormat.WriteMediaTag(ecsd, MediaTagType.MMC_ExtendedCSD);
// Cannot write Extended CSD to image
- if(!ret &&
- !_force)
+ if(!ret && !_force)
{
_dumpLog.WriteLine(Localization.Core.Cannot_write_Extended_CSD_to_output_image);
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_Extended_CSD_to_output_image +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -568,12 +562,12 @@ public partial class Dump
: MediaTagType.MMC_OCR);
// Cannot write OCR to image
- if(!ret &&
- !_force)
+ if(!ret && !_force)
{
_dumpLog.WriteLine(Localization.Core.Cannot_write_OCR_to_output_image);
- StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_OCR_to_output_image + Environment.NewLine +
+ StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_OCR_to_output_image +
+ Environment.NewLine +
outputFormat.ErrorMessage);
return;
@@ -585,12 +579,12 @@ public partial class Dump
ret = outputFormat.WriteMediaTag(scr, MediaTagType.SD_SCR);
// Cannot write SCR to image
- if(!ret &&
- !_force)
+ if(!ret && !_force)
{
_dumpLog.WriteLine(Localization.Core.Cannot_write_SCR_to_output_image);
- StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCR_to_output_image + Environment.NewLine +
+ StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCR_to_output_image +
+ Environment.NewLine +
outputFormat.ErrorMessage);
return;
@@ -646,19 +640,15 @@ public partial class Dump
if(blocks - i < blocksToRead)
blocksToRead = (byte)(blocks - i);
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)blocks);
if(blocksToRead == 1)
{
@@ -757,10 +747,7 @@ public partial class Dump
#region Trimming
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _trim &&
- newTrim)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
{
_trimStopwatch.Restart();
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
@@ -814,9 +801,7 @@ public partial class Dump
#region Error handling
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _retryPasses > 0)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
{
var pass = 1;
var forward = true;
@@ -865,9 +850,7 @@ public partial class Dump
_dumpLog.WriteLine(Localization.Core.Correctly_retried_block_0_in_pass_1, badSector, pass);
}
- if(pass < _retryPasses &&
- !_aborted &&
- _resume.BadBlocks.Count > 0)
+ if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
{
pass++;
forward = !forward;
@@ -897,7 +880,8 @@ public partial class Dump
if(!outputFormat.SetImageInfo(metadata))
{
- ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
+ ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata +
+ Environment.NewLine +
outputFormat.ErrorMessage);
}
@@ -971,7 +955,8 @@ public partial class Dump
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
- ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalChkDuration.Milliseconds()).
+ ByteSize.FromBytes(blockSize * (blocks + 1)).
+ Per(totalChkDuration.Milliseconds()).
Humanize());
(string type, string subType) xmlType = (null, null);
@@ -1023,17 +1008,17 @@ public partial class Dump
UpdateStatus?.Invoke("");
UpdateStatus?.
- Invoke(string.Format(
- Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
- _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
- totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
- _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
+ Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
+ _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
+ totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
+ _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(totalDuration.Milliseconds()).Humanize()));
+ Per(totalDuration.Milliseconds()).
+ Humanize()));
if(maxSpeed > 0)
{
diff --git a/Aaru.Core/Devices/Dumping/XGD.cs b/Aaru.Core/Devices/Dumping/XGD.cs
index b2312ae3d..1c1fe2a61 100644
--- a/Aaru.Core/Devices/Dumping/XGD.cs
+++ b/Aaru.Core/Devices/Dumping/XGD.cs
@@ -205,11 +205,11 @@ partial class Dump
Array.Copy(readBuffer, 4, tmpBuf, 0, readBuffer.Length - 4);
mediaTags.Add(MediaTagType.DVD_PFI, tmpBuf);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Video_partition_total_size_0_sectors,
- totalSize);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Video_partition_total_size_0_sectors, totalSize);
ulong l0Video = (PFI.Decode(readBuffer, MediaType.DVDROM)?.Layer0EndPSN ?? 0) -
- (PFI.Decode(readBuffer, MediaType.DVDROM)?.DataAreaStartPSN ?? 0) + 1;
+ (PFI.Decode(readBuffer, MediaType.DVDROM)?.DataAreaStartPSN ?? 0) +
+ 1;
ulong l1Video = totalSize - l0Video + 1;
UpdateStatus?.Invoke(Localization.Core.Reading_Disc_Manufacturing_Information);
@@ -236,19 +236,22 @@ partial class Dump
UpdateStatus?.Invoke(Localization.Core.Video_partition_is_too_big_did_lock_work_Trying_cold_values);
_dumpLog.WriteLine(Localization.Core.Video_partition_is_too_big_did_lock_work_Trying_cold_values);
- totalSize = (ulong)((coldReadCapacity[0] << 24) + (coldReadCapacity[1] << 16) + (coldReadCapacity[2] << 8) +
- coldReadCapacity[3]) & 0xFFFFFFFF;
+ totalSize = (ulong)((coldReadCapacity[0] << 24) +
+ (coldReadCapacity[1] << 16) +
+ (coldReadCapacity[2] << 8) +
+ coldReadCapacity[3]) &
+ 0xFFFFFFFF;
tmpBuf = new byte[coldPfi.Length - 4];
Array.Copy(coldPfi, 4, tmpBuf, 0, coldPfi.Length - 4);
mediaTags.Remove(MediaTagType.DVD_PFI);
mediaTags.Add(MediaTagType.DVD_PFI, tmpBuf);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Video_partition_total_size_0_sectors,
- totalSize);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Video_partition_total_size_0_sectors, totalSize);
l0Video = (PFI.Decode(coldPfi, MediaType.DVDROM)?.Layer0EndPSN ?? 0) -
- (PFI.Decode(coldPfi, MediaType.DVDROM)?.DataAreaStartPSN ?? 0) + 1;
+ (PFI.Decode(coldPfi, MediaType.DVDROM)?.DataAreaStartPSN ?? 0) +
+ 1;
l1Video = totalSize - l0Video + 1;
@@ -291,10 +294,10 @@ partial class Dump
ulong gameSize =
((ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + readBuffer[3]) &
- 0xFFFFFFFF) + 1;
+ 0xFFFFFFFF) +
+ 1;
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Game_partition_total_size_0_sectors,
- gameSize);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Game_partition_total_size_0_sectors, gameSize);
// Get middle zone size
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Getting_middle_zone_size);
@@ -453,8 +456,7 @@ partial class Dump
if(sense || _dev.Error)
blocksToRead /= 2;
- if(!_dev.Error ||
- blocksToRead == 1)
+ if(!_dev.Error || blocksToRead == 1)
break;
}
@@ -513,7 +515,8 @@ partial class Dump
_dumpLog.WriteLine(outputFormat.ErrorMessage);
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -529,8 +532,7 @@ partial class Dump
ResumeSupport.Process(true, true, totalSize, _dev.Manufacturer, _dev.Model, _dev.Serial, _dev.PlatformId,
ref _resume, ref currentTry, ref extents, _dev.FirmwareRevision, _private, _force);
- if(currentTry == null ||
- extents == null)
+ if(currentTry == null || extents == null)
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_process_resume_file_not_continuing);
if(_createGraph)
@@ -606,7 +608,8 @@ partial class Dump
else
{
extentStart = (xboxSs.Value.Layer0EndPSN + 1) * 2 -
- ((xboxSs.Value.Extents[e].StartPSN ^ 0xFFFFFF) + 1) - 0x30000;
+ ((xboxSs.Value.Extents[e].StartPSN ^ 0xFFFFFF) + 1) -
+ 0x30000;
}
if(xboxSs.Value.Extents[e].EndPSN <= xboxSs.Value.Layer0EndPSN)
@@ -614,7 +617,8 @@ partial class Dump
else
{
extentEnd = (xboxSs.Value.Layer0EndPSN + 1) * 2 -
- ((xboxSs.Value.Extents[e].EndPSN ^ 0xFFFFFF) + 1) - 0x30000;
+ ((xboxSs.Value.Extents[e].EndPSN ^ 0xFFFFFF) + 1) -
+ 0x30000;
}
}
@@ -644,27 +648,22 @@ partial class Dump
if(extentStart - i < blocksToRead)
blocksToRead = (uint)(extentStart - i);
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)totalSize);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)totalSize);
sense = _dev.Read12(out readBuffer, out senseBuf, 0, false, false, false, false, (uint)i, blockSize, 0,
blocksToRead, false, _dev.Timeout, out cmdDuration);
totalDuration += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mhddLog.Write(i, cmdDuration, blocksToRead);
ibgLog.Write(i, currentSpeed * 1024);
@@ -704,8 +703,10 @@ partial class Dump
i += _skip - blocksToRead;
string[] senseLines = Sense.PrettifySense(senseBuf).
- Split(new[] { Environment.NewLine },
- StringSplitOptions.RemoveEmptyEntries);
+ Split(new[]
+ {
+ Environment.NewLine
+ }, StringSplitOptions.RemoveEmptyEntries);
foreach(string senseLine in senseLines)
_dumpLog.WriteLine(senseLine);
@@ -790,10 +791,8 @@ partial class Dump
blocksToRead = (uint)(middleZone - 1 - middle);
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, middle + currentSector, totalSize,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)(middle + currentSector), (long)totalSize);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, middle + currentSector, totalSize, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)(middle + currentSector), (long)totalSize);
mhddLog.Write(middle + currentSector, cmdDuration, blocksToRead);
ibgLog.Write(middle + currentSector, currentSpeed * 1024);
@@ -853,27 +852,22 @@ partial class Dump
if(l0Video + l1Video - l1 < blocksToRead)
blocksToRead = (uint)(l0Video + l1Video - l1);
- if(currentSpeed > maxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > maxSpeed && currentSpeed > 0)
maxSpeed = currentSpeed;
- if(currentSpeed < minSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < minSpeed && currentSpeed > 0)
minSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, currentSector, totalSize,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)currentSector, (long)totalSize);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, currentSector, totalSize, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)currentSector, (long)totalSize);
sense = _dev.Read12(out readBuffer, out senseBuf, 0, false, false, false, false, (uint)l1, blockSize, 0,
blocksToRead, false, _dev.Timeout, out cmdDuration);
totalDuration += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mhddLog.Write(currentSector, cmdDuration, blocksToRead);
ibgLog.Write(currentSector, currentSpeed * 1024);
@@ -907,7 +901,10 @@ partial class Dump
l1 += _skip - blocksToRead;
string[] senseLines = Sense.PrettifySense(senseBuf).
- Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
+ Split(new[]
+ {
+ Environment.NewLine
+ }, StringSplitOptions.RemoveEmptyEntries);
foreach(string senseLine in senseLines)
_dumpLog.WriteLine(senseLine);
@@ -984,10 +981,7 @@ partial class Dump
#region Trimming
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _trim &&
- newTrim)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
{
_trimStopwatch.Restart();
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
@@ -1040,9 +1034,7 @@ partial class Dump
#region Error handling
- if(_resume.BadBlocks.Count > 0 &&
- !_aborted &&
- _retryPasses > 0)
+ if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
{
List tmpList = new();
@@ -1083,7 +1075,7 @@ partial class Dump
if(dcMode10.HasValue)
{
foreach(Modes.ModePage modePage in dcMode10.Value.Pages.Where(modePage =>
- modePage is { Page: 0x01, Subpage: 0x00 }))
+ modePage is { Page: 0x01, Subpage: 0x00 }))
currentModePage = modePage;
}
}
@@ -1095,7 +1087,7 @@ partial class Dump
if(dcMode6.HasValue)
{
foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage =>
- modePage is { Page: 0x01, Subpage: 0x00 }))
+ modePage is { Page: 0x01, Subpage: 0x00 }))
currentModePage = modePage;
}
}
@@ -1181,10 +1173,8 @@ partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_forward,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_forward,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_forward,
badSector, pass));
}
@@ -1192,10 +1182,8 @@ partial class Dump
{
PulseProgress?.Invoke(runningPersistent
? string.
- Format(
- Localization.Core.
- Retrying_sector_0_pass_1_recovering_partial_data_reverse,
- badSector, pass)
+ Format(Localization.Core.Retrying_sector_0_pass_1_recovering_partial_data_reverse,
+ badSector, pass)
: string.Format(Localization.Core.Retrying_sector_0_pass_1_reverse,
badSector, pass));
}
@@ -1208,8 +1196,7 @@ partial class Dump
if(sense || _dev.Error)
_errorLog?.WriteLine(currentSector, _dev.Error, _dev.LastError, senseBuf);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
@@ -1225,9 +1212,7 @@ partial class Dump
outputFormat.WriteSector(readBuffer, badSector);
}
- if(pass < _retryPasses &&
- !_aborted &&
- _resume.BadBlocks.Count > 0)
+ if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
{
pass++;
forward = !forward;
@@ -1244,7 +1229,10 @@ partial class Dump
var md = new Modes.DecodedMode
{
Header = new Modes.ModeHeader(),
- Pages = new[] { currentModePage.Value }
+ Pages = new[]
+ {
+ currentModePage.Value
+ }
};
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
@@ -1284,7 +1272,8 @@ partial class Dump
_dumpLog.WriteLine(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key));
StoppingErrorMessage?.Invoke(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key) +
- Environment.NewLine + outputFormat.ErrorMessage);
+ Environment.NewLine +
+ outputFormat.ErrorMessage);
return;
}
@@ -1306,7 +1295,8 @@ partial class Dump
if(!outputFormat.SetImageInfo(metadata))
{
- ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata + Environment.NewLine +
+ ErrorMessage?.Invoke(Localization.Core.Error_0_setting_metadata +
+ Environment.NewLine +
outputFormat.ErrorMessage);
}
@@ -1355,17 +1345,17 @@ partial class Dump
UpdateStatus?.Invoke("");
UpdateStatus?.
- Invoke(string.Format(
- Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
- _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
- totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
- imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
- _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
+ Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
+ _dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
+ totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
+ imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
+ _imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
- Per(totalDuration.Milliseconds()).Humanize()));
+ Per(totalDuration.Milliseconds()).
+ Humanize()));
if(maxSpeed > 0)
{
diff --git a/Aaru.Core/Devices/Info/DeviceInfo.cs b/Aaru.Core/Devices/Info/DeviceInfo.cs
index 335fd7460..fd42ddfee 100644
--- a/Aaru.Core/Devices/Info/DeviceInfo.cs
+++ b/Aaru.Core/Devices/Info/DeviceInfo.cs
@@ -95,15 +95,13 @@ public partial class DeviceInfo
AaruConsole.DebugWriteLine(MODULE_NAME, "SECTOR = 0x{0:X2}", errorRegisters.Sector);
- AaruConsole.DebugWriteLine(MODULE_NAME, "CYLHIGH = 0x{0:X2}",
- errorRegisters.CylinderHigh);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "CYLHIGH = 0x{0:X2}", errorRegisters.CylinderHigh);
AaruConsole.DebugWriteLine(MODULE_NAME, "CYLLOW = 0x{0:X2}", errorRegisters.CylinderLow);
AaruConsole.DebugWriteLine(MODULE_NAME, "DEVICE = 0x{0:X2}", errorRegisters.DeviceHead);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Error_code_equals_0,
- dev.LastError);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Error_code_equals_0, dev.LastError);
break;
}
@@ -138,15 +136,13 @@ public partial class DeviceInfo
AaruConsole.DebugWriteLine(MODULE_NAME, "SECTOR = 0x{0:X2}", errorRegisters.Sector);
- AaruConsole.DebugWriteLine(MODULE_NAME, "CYLHIGH = 0x{0:X2}",
- errorRegisters.CylinderHigh);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "CYLHIGH = 0x{0:X2}", errorRegisters.CylinderHigh);
AaruConsole.DebugWriteLine(MODULE_NAME, "CYLLOW = 0x{0:X2}", errorRegisters.CylinderLow);
AaruConsole.DebugWriteLine(MODULE_NAME, "DEVICE = 0x{0:X2}", errorRegisters.DeviceHead);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Error_code_equals_0,
- dev.LastError);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Error_code_equals_0, dev.LastError);
break;
}
@@ -201,8 +197,7 @@ public partial class DeviceInfo
sense = dev.ModeSense10(out byte[] modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current,
0x3F, 0xFF, 5, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
ScsiModeSense10 = modeBuf;
if(sense || dev.Error)
@@ -210,13 +205,11 @@ public partial class DeviceInfo
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current,
0x3F, 0x00, 5, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
ScsiModeSense10 = modeBuf;
}
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
ScsiMode = Modes.DecodeMode10(modeBuf, devType);
bool useMode10 = !(sense || dev.Error || !ScsiMode.HasValue);
@@ -224,8 +217,7 @@ public partial class DeviceInfo
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F, 0xFF,
5, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
ScsiModeSense6 = modeBuf;
if(sense || dev.Error)
@@ -233,8 +225,7 @@ public partial class DeviceInfo
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F,
0x00, 5, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
ScsiModeSense6 = modeBuf;
}
@@ -242,14 +233,11 @@ public partial class DeviceInfo
{
sense = dev.ModeSense(out modeBuf, out senseBuf, 5, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
ScsiModeSense6 = modeBuf;
}
- if(!sense &&
- !dev.Error &&
- !useMode10)
+ if(!sense && !dev.Error && !useMode10)
ScsiMode = Modes.DecodeMode6(modeBuf, devType);
switch(devType)
@@ -584,8 +572,7 @@ public partial class DeviceInfo
sense = dev.ReadExtendedCsd(out mmcBuf, out _, dev.Timeout, out _);
- if(!sense &&
- !ArrayHelpers.ArrayIsNullOrEmpty(mmcBuf))
+ if(!sense && !ArrayHelpers.ArrayIsNullOrEmpty(mmcBuf))
ExtendedCSD = mmcBuf;
}
diff --git a/Aaru.Core/Devices/Reader.cs b/Aaru.Core/Devices/Reader.cs
index 71ce87f79..b81295b6a 100644
--- a/Aaru.Core/Devices/Reader.cs
+++ b/Aaru.Core/Devices/Reader.cs
@@ -148,8 +148,8 @@ sealed partial class Reader
ReadBlocks(out buffer, block, 1, out duration, out recoveredError, out blankCheck);
internal bool ReadBlocks(out byte[] buffer, ulong block, out double duration, out bool recoveredError,
- out bool blankCheck) => ReadBlocks(out buffer, block, BlocksToRead, out duration,
- out recoveredError, out blankCheck);
+ out bool blankCheck) => ReadBlocks(out buffer, block, BlocksToRead, out duration,
+ out recoveredError, out blankCheck);
internal bool ReadBlocks(out byte[] buffer, ulong block, uint count, out double duration, out bool recoveredError,
out bool blankCheck)
diff --git a/Aaru.Core/Devices/ReaderATA.cs b/Aaru.Core/Devices/ReaderATA.cs
index adf031101..f4482f375 100644
--- a/Aaru.Core/Devices/ReaderATA.cs
+++ b/Aaru.Core/Devices/ReaderATA.cs
@@ -64,8 +64,7 @@ sealed partial class Reader
if(_dev.Type != DeviceType.ATA)
return;
- if(_ataId.CurrentCylinders > 0 &&
- _ataId is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
+ if(_ataId.CurrentCylinders > 0 && _ataId is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
{
Cylinders = _ataId.CurrentCylinders;
Heads = (byte)_ataId.CurrentHeads;
@@ -172,19 +171,14 @@ sealed partial class Reader
if(IsLba)
{
- if(Blocks > 0xFFFFFFF &&
- !_ataReadLba48 &&
- !_ataReadDmaLba48)
+ if(Blocks > 0xFFFFFFF && !_ataReadLba48 && !_ataReadDmaLba48)
{
ErrorMessage = Localization.Core.Device_needs_48_bit_LBA_commands_but_I_cant_issue_them_Aborting;
return true;
}
- if(!_ataReadLba &&
- !_ataReadRetryLba &&
- !_ataReadDmaLba &&
- !_ataReadDmaRetryLba)
+ if(!_ataReadLba && !_ataReadRetryLba && !_ataReadDmaLba && !_ataReadDmaRetryLba)
{
ErrorMessage = Localization.Core.Device_needs_28_bit_LBA_commands_but_I_cant_issue_them_Aborting;
@@ -193,10 +187,7 @@ sealed partial class Reader
}
else
{
- if(!_ataRead &&
- !_ataReadRetry &&
- !_ataReadDma &&
- !_ataReadDmaRetry)
+ if(!_ataRead && !_ataReadRetry && !_ataReadDma && !_ataReadDmaRetry)
{
ErrorMessage = Localization.Core.Device_needs_CHS_commands_but_I_cant_issue_them_Aborting;
@@ -236,13 +227,11 @@ sealed partial class Reader
bool AtaGetBlockSize()
{
- if((_ataId.PhysLogSectorSize & 0x8000) == 0x0000 &&
- (_ataId.PhysLogSectorSize & 0x4000) == 0x4000)
+ if((_ataId.PhysLogSectorSize & 0x8000) == 0x0000 && (_ataId.PhysLogSectorSize & 0x4000) == 0x4000)
{
if((_ataId.PhysLogSectorSize & 0x1000) == 0x1000)
{
- if(_ataId.LogicalSectorWords <= 255 ||
- _ataId.LogicalAlignment == 0xFFFF)
+ if(_ataId.LogicalSectorWords <= 255 || _ataId.LogicalAlignment == 0xFFFF)
LogicalBlockSize = 512;
else
LogicalBlockSize = _ataId.LogicalSectorWords * 2;
@@ -325,13 +314,11 @@ sealed partial class Reader
if(error)
BlocksToRead /= 2;
- if(!error ||
- BlocksToRead == 1)
+ if(!error || BlocksToRead == 1)
break;
}
- if(!error ||
- !IsLba)
+ if(!error || !IsLba)
return false;
BlocksToRead = 1;
diff --git a/Aaru.Core/Devices/ReaderSCSI.cs b/Aaru.Core/Devices/ReaderSCSI.cs
index 664157ad1..a43fa5543 100644
--- a/Aaru.Core/Devices/ReaderSCSI.cs
+++ b/Aaru.Core/Devices/ReaderSCSI.cs
@@ -93,10 +93,7 @@ sealed partial class Reader
_read16 = !_dev.Read16(out _, out senseBuf, 0, false, false, false, lba, LogicalBlockSize, 0, 1, false,
_timeout, out _);
- if(_read6 ||
- _read10 ||
- _read12 ||
- _read16)
+ if(_read6 || _read10 || _read12 || _read16)
break;
lba = (uint)rnd.Next(1, (int)Blocks);
@@ -131,9 +128,8 @@ sealed partial class Reader
}
case true when !_read10 && !_read12 && !_read16 && Blocks > 0x001FFFFF + 1:
ErrorMessage =
- string.Format(
- Localization.Core.Device_only_supports_SCSI_READ_6_but_has_more_than_0_blocks_1_blocks_total,
- 0x001FFFFF + 1, Blocks);
+ string.Format(Localization.Core.Device_only_supports_SCSI_READ_6_but_has_more_than_0_blocks_1_blocks_total,
+ 0x001FFFFF + 1, Blocks);
return true;
}
@@ -144,13 +140,11 @@ sealed partial class Reader
if(_read10)
_read12 = false;
- if(!_read16 &&
- Blocks > 0xFFFFFFFF + (long)1)
+ if(!_read16 && Blocks > 0xFFFFFFFF + (long)1)
{
ErrorMessage =
- string.Format(
- Localization.Core.Device_only_supports_SCSI_READ_10_but_has_more_than_0_blocks_1_blocks_total,
- 0xFFFFFFFF + (long)1, Blocks);
+ string.Format(Localization.Core.Device_only_supports_SCSI_READ_10_but_has_more_than_0_blocks_1_blocks_total,
+ 0xFFFFFFFF + (long)1, Blocks);
return true;
}
@@ -234,21 +228,20 @@ sealed partial class Reader
case 512:
{
foreach(ushort testSize in new ushort[]
- {
- // Long sector sizes for floppies
- 514,
+ {
+ // Long sector sizes for floppies
+ 514,
- // Long sector sizes for SuperDisk
- 536, 558,
+ // Long sector sizes for SuperDisk
+ 536, 558,
- // Long sector sizes for 512-byte magneto-opticals
- 600, 610, 630
- })
+ // Long sector sizes for 512-byte magneto-opticals
+ 600, 610, 630
+ })
{
testSense = _dev.ReadLong16(out _, out senseBuf, false, 0, testSize, _timeout, out _);
- if(!testSense &&
- !_dev.Error)
+ if(!testSense && !_dev.Error)
{
_readLong16 = true;
LongBlockSize = testSize;
@@ -275,18 +268,17 @@ sealed partial class Reader
case 1024:
{
foreach(ushort testSize in new ushort[]
- {
- // Long sector sizes for floppies
- 1026,
+ {
+ // Long sector sizes for floppies
+ 1026,
- // Long sector sizes for 1024-byte magneto-opticals
- 1200
- })
+ // Long sector sizes for 1024-byte magneto-opticals
+ 1200
+ })
{
testSense = _dev.ReadLong16(out _, out senseBuf, false, 0, testSize, _timeout, out _);
- if(!testSense &&
- !_dev.Error)
+ if(!testSense && !_dev.Error)
{
_readLong16 = true;
LongBlockSize = testSize;
@@ -314,8 +306,7 @@ sealed partial class Reader
{
testSense = _dev.ReadLong16(out _, out senseBuf, false, 0, 2380, _timeout, out _);
- if(!testSense &&
- !_dev.Error)
+ if(!testSense && !_dev.Error)
{
_readLong16 = true;
LongBlockSize = 2380;
@@ -326,8 +317,7 @@ sealed partial class Reader
testSense = _dev.ReadLong10(out _, out senseBuf, false, false, 0, 2380, _timeout,
out _);
- if(!testSense &&
- !_dev.Error)
+ if(!testSense && !_dev.Error)
{
_readLong10 = true;
LongBlockSize = 2380;
@@ -341,8 +331,7 @@ sealed partial class Reader
{
testSense = _dev.ReadLong16(out _, out senseBuf, false, 0, 4760, _timeout, out _);
- if(!testSense &&
- !_dev.Error)
+ if(!testSense && !_dev.Error)
{
_readLong16 = true;
LongBlockSize = 4760;
@@ -353,8 +342,7 @@ sealed partial class Reader
testSense = _dev.ReadLong10(out _, out senseBuf, false, false, 0, 4760, _timeout,
out _);
- if(!testSense &&
- !_dev.Error)
+ if(!testSense && !_dev.Error)
{
_readLong10 = true;
LongBlockSize = 4760;
@@ -368,8 +356,7 @@ sealed partial class Reader
{
testSense = _dev.ReadLong16(out _, out senseBuf, false, 0, 9424, _timeout, out _);
- if(!testSense &&
- !_dev.Error)
+ if(!testSense && !_dev.Error)
{
_readLong16 = true;
LongBlockSize = 9424;
@@ -380,8 +367,7 @@ sealed partial class Reader
testSense = _dev.ReadLong10(out _, out senseBuf, false, false, 0, 9424, _timeout,
out _);
- if(!testSense &&
- !_dev.Error)
+ if(!testSense && !_dev.Error)
{
_readLong10 = true;
LongBlockSize = 9424;
@@ -394,8 +380,7 @@ sealed partial class Reader
}
}
- if(!CanReadRaw &&
- _dev.Manufacturer == "SYQUEST")
+ if(!CanReadRaw && _dev.Manufacturer == "SYQUEST")
{
testSense = _dev.SyQuestReadLong10(out _, out senseBuf, 0, 0xFFFF, _timeout, out _);
@@ -475,13 +460,11 @@ sealed partial class Reader
}
}
- if(!CanReadRaw &&
- LogicalBlockSize == 256)
+ if(!CanReadRaw && LogicalBlockSize == 256)
{
testSense = _dev.SyQuestReadLong6(out _, out senseBuf, 0, 262, _timeout, out _);
- if(!testSense &&
- !_dev.Error)
+ if(!testSense && !_dev.Error)
{
_syqReadLong6 = true;
LongBlockSize = 262;
@@ -511,13 +494,11 @@ sealed partial class Reader
}
// READ LONG (10) for some DVD drives
- if(!CanReadRaw &&
- _dev.Manufacturer == "MATSHITA")
+ if(!CanReadRaw && _dev.Manufacturer == "MATSHITA")
{
testSense = _dev.ReadLong10(out _, out senseBuf, false, false, 0, 37856, _timeout, out _);
- if(!testSense &&
- !_dev.Error)
+ if(!testSense && !_dev.Error)
{
_readLongDvd = true;
LongBlockSize = 37856;
@@ -635,8 +616,7 @@ sealed partial class Reader
BlocksToRead /= 2;
}
- if(!_dev.Error ||
- BlocksToRead == 1)
+ if(!_dev.Error || BlocksToRead == 1)
break;
}
@@ -730,8 +710,7 @@ sealed partial class Reader
if(sense || _dev.Error)
_errorLog?.WriteLine(block, _dev.Error, _dev.LastError, senseBuf);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
return false;
recoveredError = Sense.Decode(senseBuf)?.SenseKey == SenseKeys.RecoveredError;
diff --git a/Aaru.Core/Devices/Report/ATA.cs b/Aaru.Core/Devices/Report/ATA.cs
index cfa1451e1..834e68ec1 100644
--- a/Aaru.Core/Devices/Report/ATA.cs
+++ b/Aaru.Core/Devices/Report/ATA.cs
@@ -79,8 +79,7 @@ public sealed partial class DeviceReport
if(ataId.UnformattedBPS != 0)
mediaTest.UnformattedBPS = ataId.UnformattedBPS;
- if(ataId.Cylinders > 0 &&
- ataId is { Heads: > 0, SectorsPerTrack: > 0 })
+ if(ataId.Cylinders > 0 && ataId is { Heads: > 0, SectorsPerTrack: > 0 })
{
mediaTest.CHS = new Chs
{
@@ -92,8 +91,7 @@ public sealed partial class DeviceReport
mediaTest.Blocks = (ulong)(ataId.Cylinders * ataId.Heads * ataId.SectorsPerTrack);
}
- if(ataId.CurrentCylinders > 0 &&
- ataId is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
+ if(ataId.CurrentCylinders > 0 && ataId is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
{
mediaTest.CurrentCHS = new Chs
{
@@ -121,8 +119,7 @@ public sealed partial class DeviceReport
mediaTest.Blocks = ataId.LBA48Sectors;
}
- if(ataId.NominalRotationRate != 0x0000 &&
- ataId.NominalRotationRate != 0xFFFF)
+ if(ataId.NominalRotationRate != 0x0000 && ataId.NominalRotationRate != 0xFFFF)
{
if(ataId.NominalRotationRate == 0x0001)
mediaTest.SolidStateDevice = true;
@@ -136,13 +133,11 @@ public sealed partial class DeviceReport
uint logicalSectorSize;
uint physicalSectorSize;
- if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 &&
- (ataId.PhysLogSectorSize & 0x4000) == 0x4000)
+ if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 && (ataId.PhysLogSectorSize & 0x4000) == 0x4000)
{
if((ataId.PhysLogSectorSize & 0x1000) == 0x1000)
{
- if(ataId.LogicalSectorWords <= 255 ||
- ataId.LogicalAlignment == 0xFFFF)
+ if(ataId.LogicalSectorWords <= 255 || ataId.LogicalAlignment == 0xFFFF)
logicalSectorSize = 512;
else
logicalSectorSize = ataId.LogicalSectorWords * 2;
@@ -167,13 +162,11 @@ public sealed partial class DeviceReport
{
mediaTest.PhysicalBlockSize = physicalSectorSize;
- if((ataId.LogicalAlignment & 0x8000) == 0x0000 &&
- (ataId.LogicalAlignment & 0x4000) == 0x4000)
+ if((ataId.LogicalAlignment & 0x8000) == 0x0000 && (ataId.LogicalAlignment & 0x4000) == 0x4000)
mediaTest.LogicalAlignment = (ushort)(ataId.LogicalAlignment & 0x3FFF);
}
- if(ataId.EccBytes != 0x0000 &&
- ataId.EccBytes != 0xFFFF)
+ if(ataId.EccBytes != 0x0000 && ataId.EccBytes != 0xFFFF)
mediaTest.LongBlockSize = logicalSectorSize + ataId.EccBytes;
if(ataId.UnformattedBPS > logicalSectorSize &&
@@ -198,8 +191,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorChs, false, 0, 0, 1, 1, _dev.Timeout, out _);
});
- mediaTest.SupportsReadSectors = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
- readBuf.Length > 0;
+ mediaTest.SupportsReadSectors =
+ !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -212,8 +205,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, _dev.Timeout, out _);
});
- mediaTest.SupportsReadRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
- readBuf.Length > 0;
+ mediaTest.SupportsReadRetry =
+ !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -226,8 +219,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, _dev.Timeout, out _);
});
- mediaTest.SupportsReadDma = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
- readBuf.Length > 0;
+ mediaTest.SupportsReadDma =
+ !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -240,8 +233,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, _dev.Timeout, out _);
});
- mediaTest.SupportsReadDmaRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
- readBuf.Length > 0;
+ mediaTest.SupportsReadDmaRetry =
+ !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -257,8 +250,7 @@ public sealed partial class DeviceReport
mediaTest.SupportsSeek = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2, sense,
- errorChs.Status,
- errorChs.Error);
+ errorChs.Status, errorChs.Error);
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -266,8 +258,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorLba, false, 0, 1, _dev.Timeout, out _);
});
- mediaTest.SupportsReadLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
- readBuf.Length > 0;
+ mediaTest.SupportsReadLba =
+ !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -280,8 +272,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorLba, true, 0, 1, _dev.Timeout, out _);
});
- mediaTest.SupportsReadRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
- readBuf.Length > 0;
+ mediaTest.SupportsReadRetryLba =
+ !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -294,8 +286,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorLba, false, 0, 1, _dev.Timeout, out _);
});
- mediaTest.SupportsReadDmaLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
- readBuf.Length > 0;
+ mediaTest.SupportsReadDmaLba =
+ !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -308,8 +300,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorLba, true, 0, 1, _dev.Timeout, out _);
});
- mediaTest.SupportsReadDmaRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
- readBuf.Length > 0;
+ mediaTest.SupportsReadDmaRetryLba =
+ !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -325,8 +317,7 @@ public sealed partial class DeviceReport
mediaTest.SupportsSeekLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2, sense,
- errorChs.Status,
- errorChs.Error);
+ errorChs.Status, errorChs.Error);
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -334,8 +325,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out AtaErrorRegistersLba28 _, 0, 1, _dev.Timeout, out _);
});
- mediaTest.SupportsReadLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
- readBuf.Length > 0;
+ mediaTest.SupportsReadLba48 =
+ !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -348,8 +339,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorLba48, 0, 1, _dev.Timeout, out _);
});
- mediaTest.SupportsReadDmaLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
- readBuf.Length > 0;
+ mediaTest.SupportsReadDmaLba48 =
+ !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -367,8 +358,7 @@ public sealed partial class DeviceReport
{
ataId = Identify.Decode(buffer).Value;
- if(ataId.EccBytes != 0x0000 &&
- ataId.EccBytes != 0xFFFF)
+ if(ataId.EccBytes != 0x0000 && ataId.EccBytes != 0xFFFF)
mediaTest.LongBlockSize = logicalSectorSize + ataId.EccBytes;
if(ataId.UnformattedBPS > logicalSectorSize &&
@@ -384,8 +374,11 @@ public sealed partial class DeviceReport
_dev.Timeout, out _);
});
- mediaTest.SupportsReadLong = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
- readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
+ mediaTest.SupportsReadLong = !sense &&
+ (errorChs.Status & 0x01) != 0x01 &&
+ errorChs.Error == 0 &&
+ readBuf.Length > 0 &&
+ BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -400,9 +393,11 @@ public sealed partial class DeviceReport
_dev.Timeout, out _);
});
- mediaTest.SupportsReadLongRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
- readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) !=
- checkCorrectRead;
+ mediaTest.SupportsReadLongRetry = !sense &&
+ (errorChs.Status & 0x01) != 0x01 &&
+ errorChs.Error == 0 &&
+ readBuf.Length > 0 &&
+ BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -417,8 +412,11 @@ public sealed partial class DeviceReport
out _);
});
- mediaTest.SupportsReadLongLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
- readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
+ mediaTest.SupportsReadLongLba = !sense &&
+ (errorLba.Status & 0x01) != 0x01 &&
+ errorLba.Error == 0 &&
+ readBuf.Length > 0 &&
+ BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -433,9 +431,11 @@ public sealed partial class DeviceReport
out _);
});
- mediaTest.SupportsReadLongRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
- readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) !=
- checkCorrectRead;
+ mediaTest.SupportsReadLongRetryLba = !sense &&
+ (errorLba.Status & 0x01) != 0x01 &&
+ errorLba.Error == 0 &&
+ readBuf.Length > 0 &&
+ BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -464,8 +464,7 @@ public sealed partial class DeviceReport
if(ataId.UnformattedBPS != 0)
capabilities.UnformattedBPS = ataId.UnformattedBPS;
- if(ataId.Cylinders > 0 &&
- ataId is { Heads: > 0, SectorsPerTrack: > 0 })
+ if(ataId.Cylinders > 0 && ataId is { Heads: > 0, SectorsPerTrack: > 0 })
{
capabilities.CHS = new Chs
{
@@ -477,8 +476,7 @@ public sealed partial class DeviceReport
capabilities.Blocks = (ulong)(ataId.Cylinders * ataId.Heads * ataId.SectorsPerTrack);
}
- if(ataId.CurrentCylinders > 0 &&
- ataId is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
+ if(ataId.CurrentCylinders > 0 && ataId is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
{
capabilities.CurrentCHS = new Chs
{
@@ -502,8 +500,7 @@ public sealed partial class DeviceReport
capabilities.Blocks = ataId.LBA48Sectors;
}
- if(ataId.NominalRotationRate != 0x0000 &&
- ataId.NominalRotationRate != 0xFFFF)
+ if(ataId.NominalRotationRate != 0x0000 && ataId.NominalRotationRate != 0xFFFF)
{
if(ataId.NominalRotationRate == 0x0001)
capabilities.SolidStateDevice = true;
@@ -517,13 +514,11 @@ public sealed partial class DeviceReport
uint logicalSectorSize;
uint physicalSectorSize;
- if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 &&
- (ataId.PhysLogSectorSize & 0x4000) == 0x4000)
+ if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 && (ataId.PhysLogSectorSize & 0x4000) == 0x4000)
{
if((ataId.PhysLogSectorSize & 0x1000) == 0x1000)
{
- if(ataId.LogicalSectorWords <= 255 ||
- ataId.LogicalAlignment == 0xFFFF)
+ if(ataId.LogicalSectorWords <= 255 || ataId.LogicalAlignment == 0xFFFF)
logicalSectorSize = 512;
else
logicalSectorSize = ataId.LogicalSectorWords * 2;
@@ -548,13 +543,11 @@ public sealed partial class DeviceReport
{
capabilities.PhysicalBlockSize = physicalSectorSize;
- if((ataId.LogicalAlignment & 0x8000) == 0x0000 &&
- (ataId.LogicalAlignment & 0x4000) == 0x4000)
+ if((ataId.LogicalAlignment & 0x8000) == 0x0000 && (ataId.LogicalAlignment & 0x4000) == 0x4000)
capabilities.LogicalAlignment = (ushort)(ataId.LogicalAlignment & 0x3FFF);
}
- if(ataId.EccBytes != 0x0000 &&
- ataId.EccBytes != 0xFFFF)
+ if(ataId.EccBytes != 0x0000 && ataId.EccBytes != 0xFFFF)
capabilities.LongBlockSize = logicalSectorSize + ataId.EccBytes;
if(ataId.UnformattedBPS > logicalSectorSize &&
@@ -579,8 +572,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorChs, false, 0, 0, 1, 1, _dev.Timeout, out _);
});
- capabilities.SupportsReadSectors = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
- readBuf.Length > 0;
+ capabilities.SupportsReadSectors =
+ !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -621,8 +614,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, _dev.Timeout, out _);
});
- capabilities.SupportsReadDmaRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
- readBuf.Length > 0;
+ capabilities.SupportsReadDmaRetry =
+ !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -660,8 +653,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorLba, true, 0, 1, _dev.Timeout, out _);
});
- capabilities.SupportsReadRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
- readBuf.Length > 0;
+ capabilities.SupportsReadRetryLba =
+ !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba.Status, errorLba.Error, readBuf.Length);
@@ -674,8 +667,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorLba, false, 0, 1, _dev.Timeout, out _);
});
- capabilities.SupportsReadDmaLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
- readBuf.Length > 0;
+ capabilities.SupportsReadDmaLba =
+ !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba.Status, errorLba.Error, readBuf.Length);
@@ -713,8 +706,8 @@ public sealed partial class DeviceReport
sense = _dev.Read(out readBuf, out errorLba48, 0, 1, _dev.Timeout, out _);
});
- capabilities.SupportsReadLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
- readBuf.Length > 0;
+ capabilities.SupportsReadLba48 =
+ !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba48.Status, errorLba48.Error, readBuf.Length);
@@ -727,8 +720,8 @@ public sealed partial class DeviceReport
sense = _dev.ReadDma(out readBuf, out errorLba48, 0, 1, _dev.Timeout, out _);
});
- capabilities.SupportsReadDmaLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
- readBuf.Length > 0;
+ capabilities.SupportsReadDmaLba48 =
+ !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && readBuf.Length > 0;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba48.Status, errorLba48.Error, readBuf.Length);
@@ -746,8 +739,7 @@ public sealed partial class DeviceReport
{
ataId = Identify.Decode(buffer).Value;
- if(ataId.EccBytes != 0x0000 &&
- ataId.EccBytes != 0xFFFF)
+ if(ataId.EccBytes != 0x0000 && ataId.EccBytes != 0xFFFF)
capabilities.LongBlockSize = logicalSectorSize + ataId.EccBytes;
if(ataId.UnformattedBPS > logicalSectorSize &&
@@ -763,8 +755,11 @@ public sealed partial class DeviceReport
_dev.Timeout, out _);
});
- capabilities.SupportsReadLong = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
- readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
+ capabilities.SupportsReadLong = !sense &&
+ (errorChs.Status & 0x01) != 0x01 &&
+ errorChs.Error == 0 &&
+ readBuf.Length > 0 &&
+ BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -779,9 +774,11 @@ public sealed partial class DeviceReport
_dev.Timeout, out _);
});
- capabilities.SupportsReadLongRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
- readBuf.Length > 0 &&
- BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
+ capabilities.SupportsReadLongRetry = !sense &&
+ (errorChs.Status & 0x01) != 0x01 &&
+ errorChs.Error == 0 &&
+ readBuf.Length > 0 &&
+ BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorChs.Status, errorChs.Error, readBuf.Length);
@@ -796,8 +793,11 @@ public sealed partial class DeviceReport
out _);
});
- capabilities.SupportsReadLongLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
- readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
+ capabilities.SupportsReadLongLba = !sense &&
+ (errorLba.Status & 0x01) != 0x01 &&
+ errorLba.Error == 0 &&
+ readBuf.Length > 0 &&
+ BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba.Status, errorLba.Error, readBuf.Length);
@@ -812,9 +812,11 @@ public sealed partial class DeviceReport
out _);
});
- capabilities.SupportsReadLongRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
- readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) !=
- checkCorrectRead;
+ capabilities.SupportsReadLongRetryLba = !sense &&
+ (errorLba.Status & 0x01) != 0x01 &&
+ errorLba.Error == 0 &&
+ readBuf.Length > 0 &&
+ BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
AaruConsole.DebugWriteLine(ATA_MODULE_NAME, Localization.Core.Sense_0_Status_1_Error_2_Length_3, sense,
errorLba.Status, errorLba.Error, readBuf.Length);
diff --git a/Aaru.Core/Devices/Report/GdRomSwapTrick.cs b/Aaru.Core/Devices/Report/GdRomSwapTrick.cs
index c27a78a78..6717f0283 100644
--- a/Aaru.Core/Devices/Report/GdRomSwapTrick.cs
+++ b/Aaru.Core/Devices/Report/GdRomSwapTrick.cs
@@ -53,8 +53,7 @@ public sealed partial class DeviceReport
var pressedKey = new ConsoleKeyInfo();
- while(pressedKey.Key != ConsoleKey.Y &&
- pressedKey.Key != ConsoleKey.N)
+ while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N)
{
AaruConsole.Write(Localization.Core.
Have_you_previously_tried_with_a_GD_ROM_disc_and_did_the_computer_hang_or_crash_Q);
@@ -256,8 +255,7 @@ public sealed partial class DeviceReport
return;
}
- if(newLeadOutTrack.PMIN >= 0xA0 &&
- !tocIsNotBcd)
+ if(newLeadOutTrack.PMIN >= 0xA0 && !tocIsNotBcd)
newLeadOutTrack.PMIN -= 0x90;
if(newLeadOutTrack.PMIN != leadOutTrack.PMIN ||
@@ -1112,14 +1110,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba100000PqReadable = !_dev.ReadCd(out byte[] lba100000PqBuffer,
- out byte[] lba100000PqSenseBuffer,
- 100000, 2368, cluster,
- MmcSectorTypes.AllTypes, false,
- false, true,
- MmcHeaderCodes.AllHeaders, true,
- true, MmcErrorField.None,
- MmcSubchannel.Q16, _dev.Timeout,
- out _);
+ out byte[] lba100000PqSenseBuffer,
+ 100000, 2368, cluster,
+ MmcSectorTypes.AllTypes, false,
+ false, true,
+ MmcHeaderCodes.AllHeaders, true,
+ true, MmcErrorField.None,
+ MmcSubchannel.Q16, _dev.Timeout,
+ out _);
report.GdRomSwapDiscCapabilities.Lba100000PqData = lba100000PqBuffer;
report.GdRomSwapDiscCapabilities.Lba100000PqSense = lba100000PqSenseBuffer;
@@ -1176,14 +1174,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba450000PqReadable = !_dev.ReadCd(out byte[] lba450000PqBuffer,
- out byte[] lba450000PqSenseBuffer,
- 450000, 2368, cluster,
- MmcSectorTypes.AllTypes, false,
- false, true,
- MmcHeaderCodes.AllHeaders, true,
- true, MmcErrorField.None,
- MmcSubchannel.Q16, _dev.Timeout,
- out _);
+ out byte[] lba450000PqSenseBuffer,
+ 450000, 2368, cluster,
+ MmcSectorTypes.AllTypes, false,
+ false, true,
+ MmcHeaderCodes.AllHeaders, true,
+ true, MmcErrorField.None,
+ MmcSubchannel.Q16, _dev.Timeout,
+ out _);
report.GdRomSwapDiscCapabilities.Lba450000PqData = lba450000PqBuffer;
report.GdRomSwapDiscCapabilities.Lba450000PqSense = lba450000PqSenseBuffer;
@@ -1209,14 +1207,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba400000PqReadable = !_dev.ReadCd(out byte[] lba400000PqBuffer,
- out byte[] lba400000PqSenseBuffer,
- 400000, 2368, cluster,
- MmcSectorTypes.AllTypes, false,
- false, true,
- MmcHeaderCodes.AllHeaders, true,
- true, MmcErrorField.None,
- MmcSubchannel.Q16, _dev.Timeout,
- out _);
+ out byte[] lba400000PqSenseBuffer,
+ 400000, 2368, cluster,
+ MmcSectorTypes.AllTypes, false,
+ false, true,
+ MmcHeaderCodes.AllHeaders, true,
+ true, MmcErrorField.None,
+ MmcSubchannel.Q16, _dev.Timeout,
+ out _);
report.GdRomSwapDiscCapabilities.Lba400000PqData = lba400000PqBuffer;
report.GdRomSwapDiscCapabilities.Lba400000PqSense = lba400000PqSenseBuffer;
@@ -1304,14 +1302,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba100000RwReadable = !_dev.ReadCd(out byte[] lba100000RwBuffer,
- out byte[] lba100000RwSenseBuffer,
- 100000, 2448, cluster,
- MmcSectorTypes.AllTypes, false,
- false, true,
- MmcHeaderCodes.AllHeaders, true,
- true, MmcErrorField.None,
- MmcSubchannel.Raw, _dev.Timeout,
- out _);
+ out byte[] lba100000RwSenseBuffer,
+ 100000, 2448, cluster,
+ MmcSectorTypes.AllTypes, false,
+ false, true,
+ MmcHeaderCodes.AllHeaders, true,
+ true, MmcErrorField.None,
+ MmcSubchannel.Raw, _dev.Timeout,
+ out _);
report.GdRomSwapDiscCapabilities.Lba100000RwData = lba100000RwBuffer;
report.GdRomSwapDiscCapabilities.Lba100000RwSense = lba100000RwSenseBuffer;
@@ -1368,14 +1366,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba450000RwReadable = !_dev.ReadCd(out byte[] lba450000RwBuffer,
- out byte[] lba450000RwSenseBuffer,
- 450000, 2448, cluster,
- MmcSectorTypes.AllTypes, false,
- false, true,
- MmcHeaderCodes.AllHeaders, true,
- true, MmcErrorField.None,
- MmcSubchannel.Raw, _dev.Timeout,
- out _);
+ out byte[] lba450000RwSenseBuffer,
+ 450000, 2448, cluster,
+ MmcSectorTypes.AllTypes, false,
+ false, true,
+ MmcHeaderCodes.AllHeaders, true,
+ true, MmcErrorField.None,
+ MmcSubchannel.Raw, _dev.Timeout,
+ out _);
report.GdRomSwapDiscCapabilities.Lba450000RwData = lba450000RwBuffer;
report.GdRomSwapDiscCapabilities.Lba450000RwSense = lba450000RwSenseBuffer;
@@ -1401,14 +1399,14 @@ public sealed partial class DeviceReport
while(true)
{
report.GdRomSwapDiscCapabilities.Lba400000RwReadable = !_dev.ReadCd(out byte[] lba400000RwBuffer,
- out byte[] lba400000RwSenseBuffer,
- 400000, 2448, cluster,
- MmcSectorTypes.AllTypes, false,
- false, true,
- MmcHeaderCodes.AllHeaders, true,
- true, MmcErrorField.None,
- MmcSubchannel.Raw, _dev.Timeout,
- out _);
+ out byte[] lba400000RwSenseBuffer,
+ 400000, 2448, cluster,
+ MmcSectorTypes.AllTypes, false,
+ false, true,
+ MmcHeaderCodes.AllHeaders, true,
+ true, MmcErrorField.None,
+ MmcSubchannel.Raw, _dev.Timeout,
+ out _);
report.GdRomSwapDiscCapabilities.Lba400000RwData = lba400000RwBuffer;
report.GdRomSwapDiscCapabilities.Lba400000RwSense = lba400000RwSenseBuffer;
@@ -1504,8 +1502,7 @@ public sealed partial class DeviceReport
pressedKey = new ConsoleKeyInfo();
- while(pressedKey.Key != ConsoleKey.Y &&
- pressedKey.Key != ConsoleKey.N)
+ while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N)
{
AaruConsole.Write(Localization.Core.Test_read_whole_high_density_area_proceed_Q);
@@ -1676,11 +1673,9 @@ public sealed partial class DeviceReport
? _dev.ReadCd(out buffer, out senseBuffer, lba, blockSize, cluster, MmcSectorTypes.Cdda, false,
false, false, MmcHeaderCodes.None, true, false, MmcErrorField.None, subchannel,
_dev.Timeout, out _)
- : _dev.ReadCd(out buffer, out senseBuffer, lba, blockSize,
- cluster, MmcSectorTypes.AllTypes, false, false,
- true, MmcHeaderCodes.AllHeaders, true, true,
- MmcErrorField.None, subchannel, _dev.Timeout,
- out _);
+ : _dev.ReadCd(out buffer, out senseBuffer, lba, blockSize, cluster, MmcSectorTypes.AllTypes,
+ false, false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None,
+ subchannel, _dev.Timeout, out _);
if(sense)
{
diff --git a/Aaru.Core/Devices/Report/MMC.cs b/Aaru.Core/Devices/Report/MMC.cs
index 64e86747f..6538f107e 100644
--- a/Aaru.Core/Devices/Report/MMC.cs
+++ b/Aaru.Core/Devices/Report/MMC.cs
@@ -602,13 +602,13 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity(out buffer, out senseBuffer, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mediaTest.SupportsReadCapacity = true;
mediaTest.Blocks = ((ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3]) &
- 0xFFFFFFFF) + 1;
+ 0xFFFFFFFF) +
+ 1;
mediaTest.BlockSize = (uint)((buffer[5] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + buffer[7]);
}
@@ -619,8 +619,7 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity16(out buffer, out buffer, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mediaTest.SupportsReadCapacity16 = true;
var temp = new byte[8];
@@ -640,8 +639,7 @@ public sealed partial class DeviceReport
0x00, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
@@ -654,8 +652,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense(out buffer, out senseBuffer, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
decMode ??= Modes.DecodeMode6(buffer, _dev.ScsiType);
@@ -906,8 +903,7 @@ public sealed partial class DeviceReport
break;
}
- if(mediaType.StartsWith("BD-R", StringComparison.Ordinal) &&
- mediaType != "BD-ROM")
+ if(mediaType.StartsWith("BD-R", StringComparison.Ordinal) && mediaType != "BD-ROM")
{
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -984,8 +980,7 @@ public sealed partial class DeviceReport
mediaTest.EmbossedPfiData = buffer;
}
- if(mediaType.StartsWith("DVD+R", StringComparison.Ordinal) ||
- mediaType == "DVD+MRW")
+ if(mediaType.StartsWith("DVD+R", StringComparison.Ordinal) || mediaType == "DVD+MRW")
{
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -1295,8 +1290,7 @@ public sealed partial class DeviceReport
mediaTest.ReadCdMsfFullData = buffer;
}
- if(mediaTest.SupportsReadCdRaw == true ||
- mediaType == "Audio CD")
+ if(mediaTest.SupportsReadCdRaw == true || mediaType == "Audio CD")
{
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -1339,7 +1333,10 @@ public sealed partial class DeviceReport
{
ctx.AddTask(Localization.Core.Trying_to_read_CD_Lead_In).IsIndeterminate();
- foreach(int i in new[] { -5000, -4000, -3000, -2000, -1000, -500, -250 })
+ foreach(int i in new[]
+ {
+ -5000, -4000, -3000, -2000, -1000, -500, -250
+ })
{
if(mediaType == "Audio CD")
{
@@ -1960,14 +1957,12 @@ public sealed partial class DeviceReport
}
}
- if(mediaTest.SupportsReadLong == true &&
- mediaTest.LongBlockSize == mediaTest.BlockSize)
+ if(mediaTest.SupportsReadLong == true && mediaTest.LongBlockSize == mediaTest.BlockSize)
{
// DVDs
sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 16, 37856, _dev.Timeout, out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mediaTest.ReadLong10Data = buffer;
mediaTest.SupportsReadLong = true;
@@ -2024,8 +2019,7 @@ public sealed partial class DeviceReport
{
ctx.AddTask(Localization.Core.Trying_MediaTek_READ_DRAM_command).IsIndeterminate();
- if(mediaType == "Audio CD" &&
- mediaTest.SupportsReadCd == true)
+ if(mediaType == "Audio CD" && mediaTest.SupportsReadCd == true)
{
_dev.ReadCd(out _, out _, 0, 2352, 1, MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None,
true, false, MmcErrorField.None, MmcSubchannel.None, _dev.Timeout, out _);
@@ -2092,8 +2086,7 @@ public sealed partial class DeviceReport
if(!(mediaTest.Blocks > 0))
return;
- if(mediaType == "Audio CD" &&
- mediaTest.SupportsReadCd == true)
+ if(mediaType == "Audio CD" && mediaTest.SupportsReadCd == true)
{
_dev.ReadCd(out _, out _, (uint)(mediaTest.Blocks + 1), 2352, 1, MmcSectorTypes.Cdda, false, false,
false, MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None,
@@ -2207,8 +2200,7 @@ public sealed partial class DeviceReport
FullTOC.TrackDataDescriptor secondSessionFirstTrack =
decodedToc.TrackDescriptors.FirstOrDefault(t => t is { SessionNumber: > 1, POINT: <= 99 });
- if(firstSessionLeadOutTrack.SessionNumber == 0 ||
- secondSessionFirstTrack.SessionNumber == 0)
+ if(firstSessionLeadOutTrack.SessionNumber == 0 || secondSessionFirstTrack.SessionNumber == 0)
{
AaruConsole.ErrorWriteLine(Localization.Core.
Could_not_find_second_session_Have_you_inserted_the_correct_type_of_disc);
@@ -2228,12 +2220,14 @@ public sealed partial class DeviceReport
// Skip Lead-Out pre-gap
var firstSessionLeadOutLba = (uint)(firstSessionLeadOutTrack.PMIN * 60 * 75 +
firstSessionLeadOutTrack.PSEC * 75 +
- firstSessionLeadOutTrack.PFRAME + 150);
+ firstSessionLeadOutTrack.PFRAME +
+ 150);
// Skip second session track pre-gap
var secondSessionLeadInLba = (uint)(secondSessionFirstTrack.PMIN * 60 * 75 +
secondSessionFirstTrack.PSEC * 75 +
- secondSessionFirstTrack.PFRAME - 300);
+ secondSessionFirstTrack.PFRAME -
+ 300);
Spectre.ProgressSingleSpinner(ctx =>
{
diff --git a/Aaru.Core/Devices/Report/SSC.cs b/Aaru.Core/Devices/Report/SSC.cs
index 039bc15a9..059266744 100644
--- a/Aaru.Core/Devices/Report/SSC.cs
+++ b/Aaru.Core/Devices/Report/SSC.cs
@@ -174,8 +174,7 @@ public sealed partial class DeviceReport
_dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
seqTest.ModeSense10Data = buffer;
@@ -187,8 +186,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense(out buffer, out _, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
decMode ??= Modes.DecodeMode6(buffer, _dev.ScsiType);
diff --git a/Aaru.Core/Devices/Report/Scsi.cs b/Aaru.Core/Devices/Report/Scsi.cs
index 02a175ce8..3d341b537 100644
--- a/Aaru.Core/Devices/Report/Scsi.cs
+++ b/Aaru.Core/Devices/Report/Scsi.cs
@@ -121,7 +121,8 @@ public sealed partial class DeviceReport
Spectre.ProgressSingleSpinner(ctx =>
{
ProgressTask task = ctx.AddTask(Localization.Core.Querying_SCSI_EVPD_pages,
- maxValue: evpdPages.Count(page => page != 0x80)).IsIndeterminate();
+ maxValue: evpdPages.Count(page => page != 0x80)).
+ IsIndeterminate();
foreach(byte page in evpdPages.Where(page => page != 0x80))
{
@@ -231,10 +232,10 @@ public sealed partial class DeviceReport
IsIndeterminate();
foreach(ScsiModeSensePageControl pageControl in new[]
- {
- ScsiModeSensePageControl.Default, ScsiModeSensePageControl.Current,
- ScsiModeSensePageControl.Changeable
- })
+ {
+ ScsiModeSensePageControl.Default, ScsiModeSensePageControl.Current,
+ ScsiModeSensePageControl.Changeable
+ })
{
var saveBuffer = false;
@@ -256,8 +257,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense10(out mode10Buffer, out _, false, false, pageControl, 0x3F, 0x00,
_dev.Timeout, out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
v2.SCSI.SupportsModeSense10 = true;
decMode ??= Modes.DecodeMode10(mode10Buffer, devType);
@@ -314,10 +314,10 @@ public sealed partial class DeviceReport
IsIndeterminate();
foreach(ScsiModeSensePageControl pageControl in new[]
- {
- ScsiModeSensePageControl.Default, ScsiModeSensePageControl.Current,
- ScsiModeSensePageControl.Changeable
- })
+ {
+ ScsiModeSensePageControl.Default, ScsiModeSensePageControl.Current,
+ ScsiModeSensePageControl.Changeable
+ })
{
var saveBuffer = false;
@@ -349,8 +349,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense6(out mode6Buffer, out _, false, pageControl, 0x00, 0x00,
_dev.Timeout, out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
v2.SCSI.SupportsModeSense6 = true;
decMode ??= Modes.DecodeMode6(mode6Buffer, devType);
@@ -453,8 +452,7 @@ public sealed partial class DeviceReport
modePages.Add(modePage);
- if(modePage.page == 0x2A &&
- modePage.subpage == 0x00)
+ if(modePage.page == 0x2A && modePage.subpage == 0x00)
cdromMode = page.PageResponse;
}
@@ -477,13 +475,13 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity(out buffer, out senseBuffer, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mediaTest.SupportsReadCapacity = true;
mediaTest.Blocks = ((ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3]) &
- 0xFFFFFFFF) + 1;
+ 0xFFFFFFFF) +
+ 1;
mediaTest.BlockSize = (uint)((buffer[4] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + buffer[7]);
}
@@ -494,8 +492,7 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity16(out buffer, out buffer, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
mediaTest.SupportsReadCapacity16 = true;
var temp = new byte[8];
@@ -515,8 +512,7 @@ public sealed partial class DeviceReport
0x00, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
mediaTest.ModeSense10Data = buffer;
@@ -528,8 +524,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense(out buffer, out senseBuffer, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
decMode ??= Modes.DecodeMode6(buffer, _dev.ScsiType);
@@ -660,22 +655,22 @@ public sealed partial class DeviceReport
case 512:
{
foreach(ushort testSize in new ushort[]
- {
- // Long sector sizes for floppies
- 514,
+ {
+ // Long sector sizes for floppies
+ 514,
- // Long sector sizes for SuperDisk
- 536, 558,
+ // Long sector sizes for SuperDisk
+ 536, 558,
- // Long sector sizes for 512-byte magneto-opticals
- 600, 610, 630
- })
+ // Long sector sizes for 512-byte magneto-opticals
+ 600, 610, 630
+ })
{
sense = mediaTest.SupportsReadLong16 == true
? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
out _)
- : _dev.ReadLong10(out buffer, out senseBuffer, false,
- false, 0, testSize, _dev.Timeout, out _);
+ : _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, testSize,
+ _dev.Timeout, out _);
if(sense || _dev.Error)
continue;
@@ -690,19 +685,19 @@ public sealed partial class DeviceReport
case 1024:
{
foreach(ushort testSize in new ushort[]
- {
- // Long sector sizes for floppies
- 1026,
+ {
+ // Long sector sizes for floppies
+ 1026,
- // Long sector sizes for 1024-byte magneto-opticals
- 1200
- })
+ // Long sector sizes for 1024-byte magneto-opticals
+ 1200
+ })
{
sense = mediaTest.SupportsReadLong16 == true
? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
out _)
- : _dev.ReadLong10(out buffer, out senseBuffer, false,
- false, 0, testSize, _dev.Timeout, out _);
+ : _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, testSize,
+ _dev.Timeout, out _);
if(sense || _dev.Error)
continue;
@@ -721,8 +716,7 @@ public sealed partial class DeviceReport
: _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, _dev.Timeout,
out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
mediaTest.LongBlockSize = 2380;
break;
@@ -734,8 +728,7 @@ public sealed partial class DeviceReport
: _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 4760, _dev.Timeout,
out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
mediaTest.LongBlockSize = 4760;
break;
@@ -747,8 +740,7 @@ public sealed partial class DeviceReport
: _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 9424, _dev.Timeout,
out _);
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
mediaTest.LongBlockSize = 9424;
break;
@@ -786,13 +778,13 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity(out buffer, out senseBuffer, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
capabilities.SupportsReadCapacity = true;
capabilities.Blocks = ((ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3]) &
- 0xFFFFFFFF) + 1;
+ 0xFFFFFFFF) +
+ 1;
capabilities.BlockSize = (uint)((buffer[4] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + buffer[7]);
}
@@ -803,8 +795,7 @@ public sealed partial class DeviceReport
sense = _dev.ReadCapacity16(out buffer, out buffer, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
capabilities.SupportsReadCapacity16 = true;
var temp = new byte[8];
@@ -824,8 +815,7 @@ public sealed partial class DeviceReport
0x00, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
capabilities.ModeSense10Data = buffer;
@@ -837,8 +827,7 @@ public sealed partial class DeviceReport
sense = _dev.ModeSense(out buffer, out senseBuffer, _dev.Timeout, out _);
});
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
decMode ??= Modes.DecodeMode6(buffer, _dev.ScsiType);
@@ -970,29 +959,30 @@ public sealed partial class DeviceReport
{
ctx.AddTask(capabilities.SupportsReadLong16 == true
? Localization.Core.Trying_SCSI_READ_LONG_16
- : Localization.Core.Trying_SCSI_READ_LONG_10).IsIndeterminate();
+ : Localization.Core.Trying_SCSI_READ_LONG_10).
+ IsIndeterminate();
switch(capabilities.BlockSize)
{
case 512:
{
foreach(ushort testSize in new ushort[]
- {
- // Long sector sizes for floppies
- 514,
+ {
+ // Long sector sizes for floppies
+ 514,
- // Long sector sizes for SuperDisk
- 536, 558,
+ // Long sector sizes for SuperDisk
+ 536, 558,
- // Long sector sizes for 512-byte magneto-opticals
- 600, 610, 630
- })
+ // Long sector sizes for 512-byte magneto-opticals
+ 600, 610, 630
+ })
{
sense = capabilities.SupportsReadLong16 == true
? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
out _)
- : _dev.ReadLong10(out buffer, out senseBuffer, false,
- false, 0, testSize, _dev.Timeout, out _);
+ : _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, testSize,
+ _dev.Timeout, out _);
if(sense || _dev.Error)
continue;
@@ -1008,19 +998,19 @@ public sealed partial class DeviceReport
case 1024:
{
foreach(ushort testSize in new ushort[]
- {
- // Long sector sizes for floppies
- 1026,
+ {
+ // Long sector sizes for floppies
+ 1026,
- // Long sector sizes for 1024-byte magneto-opticals
- 1200
- })
+ // Long sector sizes for 1024-byte magneto-opticals
+ 1200
+ })
{
sense = capabilities.SupportsReadLong16 == true
? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
out _)
- : _dev.ReadLong10(out buffer, out senseBuffer, false,
- false, 0, testSize, _dev.Timeout, out _);
+ : _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, testSize,
+ _dev.Timeout, out _);
if(sense || _dev.Error)
continue;
diff --git a/Aaru.Core/Devices/Scanning/ATA.cs b/Aaru.Core/Devices/Scanning/ATA.cs
index 5ad9f69db..5b0ea7c6c 100644
--- a/Aaru.Core/Devices/Scanning/ATA.cs
+++ b/Aaru.Core/Devices/Scanning/ATA.cs
@@ -56,8 +56,7 @@ public sealed partial class MediaScan
bool sense = _dev.AtaIdentify(out byte[] cmdBuf, out _);
- if(!sense &&
- Identify.Decode(cmdBuf).HasValue)
+ if(!sense && Identify.Decode(cmdBuf).HasValue)
{
// Initialize reader
var ataReader = new Reader(_dev, timeout, cmdBuf, null);
@@ -141,19 +140,15 @@ public sealed partial class MediaScan
if(results.Blocks - i < blocksToRead)
blocksToRead = (byte)(results.Blocks - i);
- if(currentSpeed > results.MaxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > results.MaxSpeed && currentSpeed > 0)
results.MaxSpeed = currentSpeed;
- if(currentSpeed < results.MinSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < results.MinSpeed && currentSpeed > 0)
results.MinSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, results.Blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)results.Blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, results.Blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)results.Blocks);
bool error = ataReader.ReadBlocks(out cmdBuf, i, blocksToRead, out duration, out _, out _);
@@ -241,12 +236,10 @@ public sealed partial class MediaScan
ataReader.Seek(seekPos, out seekCur);
- if(seekCur > results.SeekMax &&
- seekCur > 0)
+ if(seekCur > results.SeekMax && seekCur > 0)
results.SeekMax = seekCur;
- if(seekCur < results.SeekMin &&
- seekCur > 0)
+ if(seekCur < results.SeekMin && seekCur > 0)
results.SeekMin = seekCur;
results.SeekTotal += seekCur;
@@ -278,17 +271,16 @@ public sealed partial class MediaScan
if(_aborted)
break;
- if(currentSpeed > results.MaxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > results.MaxSpeed && currentSpeed > 0)
results.MaxSpeed = currentSpeed;
- if(currentSpeed < results.MinSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < results.MinSpeed && currentSpeed > 0)
results.MinSpeed = currentSpeed;
PulseProgress?.Invoke(string.Format(Localization.Core.Reading_cylinder_0_head_1_sector_2_3,
cy, hd, sc,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).
+ ByteSize.FromMegabytes(currentSpeed).
+ Per(_oneSecond).
Humanize()));
bool error = ataReader.ReadChs(out cmdBuf, cy, hd, sc, out duration, out _);
@@ -380,12 +372,10 @@ public sealed partial class MediaScan
ataReader.SeekChs(seekCy, seekHd, seekSc, out seekCur);
- if(seekCur > results.SeekMax &&
- seekCur > 0)
+ if(seekCur > results.SeekMax && seekCur > 0)
results.SeekMax = seekCur;
- if(seekCur < results.SeekMin &&
- seekCur > 0)
+ if(seekCur < results.SeekMin && seekCur > 0)
results.SeekMin = seekCur;
results.SeekTotal += seekCur;
diff --git a/Aaru.Core/Devices/Scanning/SCSI.cs b/Aaru.Core/Devices/Scanning/SCSI.cs
index 9145472e9..74d670a69 100644
--- a/Aaru.Core/Devices/Scanning/SCSI.cs
+++ b/Aaru.Core/Devices/Scanning/SCSI.cs
@@ -188,8 +188,7 @@ public sealed partial class MediaScan
results.Blocks = scsiReader.GetDeviceBlocks();
foundReadCommand = !scsiReader.FindReadCommand();
- if(!foundReadCommand &&
- _dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice)
+ if(!foundReadCommand && _dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice)
{
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium);
@@ -198,8 +197,7 @@ public sealed partial class MediaScan
blockSize = scsiReader.LogicalBlockSize;
- if(results.Blocks != 0 &&
- blockSize != 0)
+ if(results.Blocks != 0 && blockSize != 0)
{
results.Blocks++;
@@ -323,8 +321,7 @@ public sealed partial class MediaScan
if(_dev.Error || sense)
blocksToRead /= 2;
- if(!_dev.Error ||
- blocksToRead == 1)
+ if(!_dev.Error || blocksToRead == 1)
break;
}
}
@@ -358,19 +355,15 @@ public sealed partial class MediaScan
if(results.Blocks - i < blocksToRead)
blocksToRead = (uint)(results.Blocks - i);
- if(currentSpeed > results.MaxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > results.MaxSpeed && currentSpeed > 0)
results.MaxSpeed = currentSpeed;
- if(currentSpeed < results.MinSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < results.MinSpeed && currentSpeed > 0)
results.MinSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, results.Blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)results.Blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, results.Blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)results.Blocks);
if(readcd)
{
@@ -522,25 +515,20 @@ public sealed partial class MediaScan
if(results.Blocks - i < blocksToRead)
blocksToRead = (uint)(results.Blocks - i);
- if(currentSpeed > results.MaxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > results.MaxSpeed && currentSpeed > 0)
results.MaxSpeed = currentSpeed;
- if(currentSpeed < results.MinSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < results.MinSpeed && currentSpeed > 0)
results.MinSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, results.Blocks,
- ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)results.Blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, results.Blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)results.Blocks);
sense = scsiReader.ReadBlocks(out _, i, blocksToRead, out double cmdDuration, out _, out _);
results.ProcessingTime += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(!sense && !_dev.Error)
{
switch(cmdDuration)
{
@@ -642,12 +630,10 @@ public sealed partial class MediaScan
else
scsiReader.ReadBlock(out _, seekPos, out seekCur, out _, out _);
- if(seekCur > results.SeekMax &&
- seekCur > 0)
+ if(seekCur > results.SeekMax && seekCur > 0)
results.SeekMax = seekCur;
- if(seekCur < results.SeekMin &&
- seekCur > 0)
+ if(seekCur < results.SeekMin && seekCur > 0)
results.SeekMin = seekCur;
results.SeekTotal += seekCur;
diff --git a/Aaru.Core/Devices/Scanning/SecureDigital.cs b/Aaru.Core/Devices/Scanning/SecureDigital.cs
index 2d07a79bd..e5e7e3c66 100644
--- a/Aaru.Core/Devices/Scanning/SecureDigital.cs
+++ b/Aaru.Core/Devices/Scanning/SecureDigital.cs
@@ -128,8 +128,9 @@ public sealed partial class MediaScan
if(!sense)
{
- supportsCmd23 = Decoders.SecureDigital.Decoders.DecodeSCR(cmdBuf)?.CommandSupport.
- HasFlag(CommandSupport.SetBlockCount) ?? false;
+ supportsCmd23 = Decoders.SecureDigital.Decoders.DecodeSCR(cmdBuf)?.
+ CommandSupport.HasFlag(CommandSupport.SetBlockCount) ??
+ false;
}
}
@@ -177,8 +178,7 @@ public sealed partial class MediaScan
if(sense)
blocksToRead /= 2;
- if(!sense ||
- blocksToRead == 1)
+ if(!sense || blocksToRead == 1)
break;
}
@@ -241,19 +241,15 @@ public sealed partial class MediaScan
if(results.Blocks - i < blocksToRead)
blocksToRead = (byte)(results.Blocks - i);
- if(currentSpeed > results.MaxSpeed &&
- currentSpeed > 0)
+ if(currentSpeed > results.MaxSpeed && currentSpeed > 0)
results.MaxSpeed = currentSpeed;
- if(currentSpeed < results.MinSpeed &&
- currentSpeed > 0)
+ if(currentSpeed < results.MinSpeed && currentSpeed > 0)
results.MinSpeed = currentSpeed;
UpdateProgress?.
- Invoke(
- string.Format(Localization.Core.Reading_sector_0_of_1_2, i, results.Blocks,
- ByteSize.FromBytes(currentSpeed).Per(_oneSecond).Humanize()),
- (long)i, (long)results.Blocks);
+ Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, results.Blocks, ByteSize.FromBytes(currentSpeed).Per(_oneSecond).Humanize()),
+ (long)i, (long)results.Blocks);
bool error;
@@ -356,12 +352,10 @@ public sealed partial class MediaScan
_dev.ReadSingleBlock(out cmdBuf, out _, seekPos, blockSize, byteAddressed, timeout, out double seekCur);
- if(seekCur > results.SeekMax &&
- seekCur > 0)
+ if(seekCur > results.SeekMax && seekCur > 0)
results.SeekMax = seekCur;
- if(seekCur < results.SeekMin &&
- seekCur > 0)
+ if(seekCur < results.SeekMin && seekCur > 0)
results.SeekMin = seekCur;
results.SeekTotal += seekCur;
diff --git a/Aaru.Core/Entropy.cs b/Aaru.Core/Entropy.cs
index c1ea1b0e2..3be7d38ab 100644
--- a/Aaru.Core/Entropy.cs
+++ b/Aaru.Core/Entropy.cs
@@ -104,10 +104,8 @@ public sealed class Entropy
};
UpdateProgressEvent?.
- Invoke(
- string.Format(Localization.Core.Entropying_track_0_of_1, currentTrack.Sequence,
- inputTracks.Max(t => t.Sequence)),
- currentTrack.Sequence, inputTracks.Max(t => t.Sequence));
+ Invoke(string.Format(Localization.Core.Entropying_track_0_of_1, currentTrack.Sequence, inputTracks.Max(t => t.Sequence)),
+ currentTrack.Sequence, inputTracks.Max(t => t.Sequence));
var entTable = new ulong[256];
ulong trackSize = 0;
@@ -123,10 +121,8 @@ public sealed class Entropy
for(ulong i = 0; i < trackEntropy.Sectors; i++)
{
UpdateProgress2Event?.
- Invoke(
- string.Format(Localization.Core.Entropying_sector_0_of_track_1, i + 1,
- currentTrack.Sequence),
- (long)(i + 1), (long)currentTrack.EndSector);
+ Invoke(string.Format(Localization.Core.Entropying_sector_0_of_track_1, i + 1, currentTrack.Sequence),
+ (long)(i + 1), (long)currentTrack.EndSector);
ErrorNumber errno = opticalMediaImage.ReadSector(i, currentTrack.Sequence, out byte[] sector);
@@ -156,7 +152,8 @@ public sealed class Entropy
EndProgress2Event?.Invoke();
trackEntropy.Entropy += entTable.Select(l => l / (double)trackSize).
- Select(frequency => -(frequency * Math.Log(frequency, 2))).Sum();
+ Select(frequency => -(frequency * Math.Log(frequency, 2))).
+ Sum();
if(duplicatedSectors)
trackEntropy.UniqueSectors = uniqueSectorsPerTrack.Count;
@@ -233,7 +230,8 @@ public sealed class Entropy
EndProgressEvent?.Invoke();
entropy.Entropy += entTable.Select(l => l / (double)diskSize).
- Select(frequency => -(frequency * Math.Log(frequency, 2))).Sum();
+ Select(frequency => -(frequency * Math.Log(frequency, 2))).
+ Sum();
if(duplicatedSectors)
entropy.UniqueSectors = uniqueSectors.Count;
@@ -283,7 +281,8 @@ public sealed class Entropy
EndProgressEvent?.Invoke();
entropy.Entropy += entTable.Select(l => l / (double)data.Length).
- Select(frequency => -(frequency * Math.Log(frequency, 2))).Sum();
+ Select(frequency => -(frequency * Math.Log(frequency, 2))).
+ Sum();
return entropy;
}
diff --git a/Aaru.Core/Graphics/BlockMap.cs b/Aaru.Core/Graphics/BlockMap.cs
index 520109705..d171b26fd 100644
--- a/Aaru.Core/Graphics/BlockMap.cs
+++ b/Aaru.Core/Graphics/BlockMap.cs
@@ -61,8 +61,7 @@ public class BlockMap : IMediaGraph
_sectorsPerSquare = (int)((long)maxSectors / squares);
- while(_sectorsPerSquare > 0 &&
- _squareSize > 4)
+ while(_sectorsPerSquare > 0 && _squareSize > 4)
{
_squareSize--;
@@ -266,8 +265,8 @@ public class BlockMap : IMediaGraph
{
foreach(SKRect rect in sectors.Select(sector => GetSquareRectangle(_sectorsPerSquare == 0
? (int)sector
- : (int)
- (sector / (ulong)_sectorsPerSquare))))
+ : (int)(sector /
+ (ulong)_sectorsPerSquare))))
{
_canvas.DrawRect(rect, new SKPaint
{
diff --git a/Aaru.Core/Graphics/Spiral.cs b/Aaru.Core/Graphics/Spiral.cs
index 0d494f0ff..93726a4ad 100644
--- a/Aaru.Core/Graphics/Spiral.cs
+++ b/Aaru.Core/Graphics/Spiral.cs
@@ -103,8 +103,7 @@ public sealed class Spiral : IMediaGraph
/// Last sector that will be drawn into the spiral
public Spiral(int width, int height, DiscParameters parameters, ulong lastSector)
{
- if(parameters == _gdParameters ||
- parameters == _gdRecordableParameters)
+ if(parameters == _gdParameters || parameters == _gdRecordableParameters)
_gdrom = true;
// GD-ROM LD area ends at 29mm, HD area starts at 30mm radius
@@ -197,8 +196,7 @@ public sealed class Spiral : IMediaGraph
});
// If there's a recordable information area, get its points
- if(recordableAreaEndDiameter > 0 &&
- recordableAreaStartDiameter > 0)
+ if(recordableAreaEndDiameter > 0 && recordableAreaStartDiameter > 0)
{
_recordableInformationPoints = GetSpiralPoints(center, recordableAreaStartDiameter / 2,
recordableAreaEndDiameter / 2, _gdrom ? a : a * 1.5f);
diff --git a/Aaru.Core/ImageInfo.cs b/Aaru.Core/ImageInfo.cs
index 9e4e9d615..f651efee8 100644
--- a/Aaru.Core/ImageInfo.cs
+++ b/Aaru.Core/ImageInfo.cs
@@ -124,8 +124,7 @@ public static class ImageInfo
if(!string.IsNullOrWhiteSpace(imageFormat.Info.Comments))
AaruConsole.WriteLine(Localization.Core.Comments_0_WithMarkup, Markup.Escape(imageFormat.Info.Comments));
- if(imageFormat.Info.MediaSequence != 0 &&
- imageFormat.Info.LastMediaSequence != 0)
+ if(imageFormat.Info.MediaSequence != 0 && imageFormat.Info.LastMediaSequence != 0)
{
AaruConsole.WriteLine(Localization.Core.Media_is_number_0_on_a_set_of_1_medias,
imageFormat.Info.MediaSequence, imageFormat.Info.LastMediaSequence);
@@ -419,8 +418,7 @@ public static class ImageInfo
{
errno = imageFormat.ReadMediaTag(MediaTagType.CD_FullTOC, out byte[] toc);
- if(errno == ErrorNumber.NoError &&
- toc.Length > 0)
+ if(errno == ErrorNumber.NoError && toc.Length > 0)
{
ushort dataLen = Swapping.Swap(BitConverter.ToUInt16(toc, 0));
@@ -443,8 +441,7 @@ public static class ImageInfo
{
errno = imageFormat.ReadMediaTag(MediaTagType.CD_PMA, out byte[] pma);
- if(errno == ErrorNumber.NoError &&
- pma.Length > 0)
+ if(errno == ErrorNumber.NoError && pma.Length > 0)
{
ushort dataLen = Swapping.Swap(BitConverter.ToUInt16(pma, 0));
@@ -678,8 +675,7 @@ public static class ImageInfo
break;
default:
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.Found_unknown_tuple_ID_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Found_unknown_tuple_ID_0,
(byte)tuple.Code);
break;
diff --git a/Aaru.Core/Logging/ErrorLog.cs b/Aaru.Core/Logging/ErrorLog.cs
index 9b6ecaf40..169d4a683 100644
--- a/Aaru.Core/Logging/ErrorLog.cs
+++ b/Aaru.Core/Logging/ErrorLog.cs
@@ -430,9 +430,7 @@ public sealed class ErrorLog
_logSw.WriteLine(Localization.Core.SCSI_reading_LBA_0_operating_system_error_1, block, errno);
_logSw.Flush();
- if(senseBuffer is null ||
- senseBuffer.Length == 0 ||
- senseBuffer.All(s => s == 0))
+ if(senseBuffer is null || senseBuffer.Length == 0 || senseBuffer.All(s => s == 0))
return;
}
@@ -517,22 +515,16 @@ public sealed class ErrorLog
{
if(osError)
{
- _logSw.WriteLine(
- byteAddressed
- ? Localization.Core.SD_MMC_reading_LBA_0_byte_addressed_operating_system_error_1
- : Localization.Core.SD_MMC_reading_LBA_0_block_addressed_operating_system_error_1,
- block, errno);
+ _logSw.WriteLine(byteAddressed ? Localization.Core.SD_MMC_reading_LBA_0_byte_addressed_operating_system_error_1 : Localization.Core.SD_MMC_reading_LBA_0_block_addressed_operating_system_error_1,
+ block, errno);
_logSw.Flush();
return;
}
- _logSw.WriteLine(
- byteAddressed
- ? Localization.Core.SD_MMC_reading_LBA_0_byte_addressed_error_1
- : Localization.Core.SD_MMC_reading_LBA_0_block_addressed_error_1,
- block, string.Join(" - ", response.Select(r => $"0x{r:X8}")));
+ _logSw.WriteLine(byteAddressed ? Localization.Core.SD_MMC_reading_LBA_0_byte_addressed_error_1 : Localization.Core.SD_MMC_reading_LBA_0_block_addressed_error_1,
+ block, string.Join(" - ", response.Select(r => $"0x{r:X8}")));
throw new NotImplementedException();
}
diff --git a/Aaru.Core/Logging/IBGLog.cs b/Aaru.Core/Logging/IBGLog.cs
index aa4e553c9..2dabbaefc 100644
--- a/Aaru.Core/Logging/IBGLog.cs
+++ b/Aaru.Core/Logging/IBGLog.cs
@@ -249,8 +249,7 @@ sealed class IbgLog
if(_ibgSampleRate < 100)
return;
- if(_ibgIntSpeed > 0 &&
- !_ibgStartSet)
+ if(_ibgIntSpeed > 0 && !_ibgStartSet)
{
_ibgStartSpeed = _ibgIntSpeed / _ibgSnaps / _ibgDivider;
_ibgStartSet = true;
diff --git a/Aaru.Core/Logging/MHDDLog.cs b/Aaru.Core/Logging/MHDDLog.cs
index dc39a7288..d5df24bf7 100644
--- a/Aaru.Core/Logging/MHDDLog.cs
+++ b/Aaru.Core/Logging/MHDDLog.cs
@@ -59,8 +59,7 @@ sealed class MhddLog
internal MhddLog(string outputFile, Device dev, ulong blocks, ulong blockSize, ulong blocksToRead, bool @private,
uint mediaGraphDimensions = 0)
{
- if(dev == null ||
- string.IsNullOrEmpty(outputFile))
+ if(dev == null || string.IsNullOrEmpty(outputFile))
return;
if(mediaGraphDimensions > 0)
@@ -117,10 +116,16 @@ sealed class MhddLog
byte[] scanBlockSizeBytes = Encoding.ASCII.GetBytes(scanBlockSize);
byte[] verBytes = Encoding.ASCII.GetBytes(MHDD_VER);
- var pointer = (uint)(deviceBytes.Length + modeBytes.Length + fwBytes.Length + snBytes.Length +
- sectorsBytes.Length + sectorSizeBytes.Length + scanBlockSizeBytes.Length +
- verBytes.Length + 2 * 9 + // New lines
- 4); // Pointer
+ var pointer = (uint)(deviceBytes.Length +
+ modeBytes.Length +
+ fwBytes.Length +
+ snBytes.Length +
+ sectorsBytes.Length +
+ sectorSizeBytes.Length +
+ scanBlockSizeBytes.Length +
+ verBytes.Length +
+ 2 * 9 + // New lines
+ 4); // Pointer
var newLine = new byte[2];
newLine[0] = 0x0D;
diff --git a/Aaru.Core/Logging/SubchannelLog.cs b/Aaru.Core/Logging/SubchannelLog.cs
index bd1c96dab..b14161b23 100644
--- a/Aaru.Core/Logging/SubchannelLog.cs
+++ b/Aaru.Core/Logging/SubchannelLog.cs
@@ -188,8 +188,7 @@ public class SubchannelLog
for(var i = 0; i < 12; i++)
{
- if(p[i] == 0 ||
- p[i] == 0xFF)
+ if(p[i] == 0 || p[i] == 0xFF)
continue;
corruptedPause = true;
diff --git a/Aaru.Core/Media/CompactDisc.cs b/Aaru.Core/Media/CompactDisc.cs
index b22883bec..abe621053 100644
--- a/Aaru.Core/Media/CompactDisc.cs
+++ b/Aaru.Core/Media/CompactDisc.cs
@@ -80,8 +80,7 @@ public static class CompactDisc
sub = Subchannel.ConvertQToRaw(sub);
// If not desired to fix, or to save, the subchannel, just save as is (or none)
- if(!fixSubchannelPosition &&
- desiredSubchannel != MmcSubchannel.None)
+ if(!fixSubchannelPosition && desiredSubchannel != MmcSubchannel.None)
outputPlugin.WriteSectorsTag(sub, sectorAddress, length, SectorTagType.CdSectorSubchannel);
subLog?.WriteEntry(sub, supportedSubchannel == MmcSubchannel.Raw, (long)sectorAddress, length, false, false);
@@ -92,8 +91,7 @@ public static class CompactDisc
updateStatus, smallestPregapLbaPerTrack, dumping,
out newPregapSectors, sectorAddress);
- if(!fixSubchannelPosition ||
- desiredSubchannel == MmcSubchannel.None)
+ if(!fixSubchannelPosition || desiredSubchannel == MmcSubchannel.None)
return indexesChanged;
int prePos = int.MinValue;
@@ -121,8 +119,7 @@ public static class CompactDisc
// Check P and weight
for(int p = subPos; p < subPos + 12; p++)
{
- if(deSub[p] != 0 &&
- deSub[p] != 255)
+ if(deSub[p] != 0 && deSub[p] != 255)
pOk = false;
for(var w = 0; w < 8; w++)
@@ -192,10 +189,7 @@ public static class CompactDisc
}
// RW is not a known pattern or packet, fix it
- if(!rwOk &&
- !rwPacket &&
- !cdtextPacket &&
- fixSubchannel)
+ if(!rwOk && !rwPacket && !cdtextPacket && fixSubchannel)
{
for(int rw = subPos + 24; rw < subPos + 96; rw++)
deSub[rw] = 0;
@@ -209,10 +203,7 @@ public static class CompactDisc
int aPos;
// Fix Q
- if(!crcOk &&
- fixSubchannel &&
- subPos > 0 &&
- subPos < deSub.Length - 96)
+ if(!crcOk && fixSubchannel && subPos > 0 && subPos < deSub.Length - 96)
{
isrcs.TryGetValue(currentTrack, out string knownGoodIsrc);
@@ -258,9 +249,7 @@ public static class CompactDisc
}
}
- if(!pOk ||
- !crcOk ||
- !rwOk)
+ if(!pOk || !crcOk || !rwOk)
continue;
var aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
@@ -417,8 +406,7 @@ public static class CompactDisc
continue;
// Pregap
- if(q[2] == 0 &&
- trackNo > 1)
+ if(q[2] == 0 && trackNo > 1)
{
var pmin = (byte)(q[3] / 16 * 10 + (q[3] & 0x0F));
var psec = (byte)(q[4] / 16 * 10 + (q[4] & 0x0F));
@@ -443,9 +431,8 @@ public static class CompactDisc
tracks[i].StartSector -= (ulong)dif;
smallestPregapLbaPerTrack[trackNo] = qPos;
- if(i > 0 &&
- tracks[i - 1].EndSector >= tracks[i].StartSector)
- tracks[i - 1].EndSector = tracks[i].StartSector - 1;
+ if(i > 0 && tracks[i - 1].EndSector >= tracks[i].StartSector)
+ tracks[i - 1].EndSector = tracks[i].StartSector - 1;
dumpLog?.WriteLine(string.Format(Localization.Core.Pregap_for_track_0_set_to_1_sectors,
trackNo, tracks[i].Pregap));
@@ -468,9 +455,8 @@ public static class CompactDisc
tracks[i].Pregap = (ulong)qPos;
tracks[i].StartSector -= tracks[i].Pregap - oldPregap;
- if(i > 0 &&
- tracks[i - 1].EndSector >= tracks[i].StartSector)
- tracks[i - 1].EndSector = tracks[i].StartSector - 1;
+ if(i > 0 && tracks[i - 1].EndSector >= tracks[i].StartSector)
+ tracks[i - 1].EndSector = tracks[i].StartSector - 1;
dumpLog?.WriteLine(string.Format(Localization.Core.Pregap_for_track_0_set_to_1_sectors,
trackNo, tracks[i].Pregap));
@@ -495,12 +481,10 @@ public static class CompactDisc
int aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
// Do not set INDEX 1 to a value higher than what the TOC already said.
- if(q[2] == 1 &&
- aPos > (int)tracks[i].StartSector)
+ if(q[2] == 1 && aPos > (int)tracks[i].StartSector)
continue;
- if(tracks[i].Indexes.ContainsKey(q[2]) &&
- aPos >= tracks[i].Indexes[q[2]])
+ if(tracks[i].Indexes.ContainsKey(q[2]) && aPos >= tracks[i].Indexes[q[2]])
continue;
dumpLog?.WriteLine(string.Format(Localization.Core.Setting_index_0_for_track_1_to_LBA_2, q[2],
@@ -824,8 +808,7 @@ public static class CompactDisc
Array.Copy(cdTextPack1, 0, cdTextPack1ForCrc, 0, 16);
ushort calculatedCdtp1Crc = CRC16CCITTContext.Calculate(cdTextPack1ForCrc);
- if(cdTextPack1Crc != calculatedCdtp1Crc &&
- cdTextPack1Crc != 0)
+ if(cdTextPack1Crc != calculatedCdtp1Crc && cdTextPack1Crc != 0)
status = false;
}
@@ -836,8 +819,7 @@ public static class CompactDisc
Array.Copy(cdTextPack2, 0, cdTextPack2ForCrc, 0, 16);
ushort calculatedCdtp2Crc = CRC16CCITTContext.Calculate(cdTextPack2ForCrc);
- if(cdTextPack2Crc != calculatedCdtp2Crc &&
- cdTextPack2Crc != 0)
+ if(cdTextPack2Crc != calculatedCdtp2Crc && cdTextPack2Crc != 0)
status = false;
}
@@ -848,8 +830,7 @@ public static class CompactDisc
Array.Copy(cdTextPack3, 0, cdTextPack3ForCrc, 0, 16);
ushort calculatedCdtp3Crc = CRC16CCITTContext.Calculate(cdTextPack3ForCrc);
- if(cdTextPack3Crc != calculatedCdtp3Crc &&
- cdTextPack3Crc != 0)
+ if(cdTextPack3Crc != calculatedCdtp3Crc && cdTextPack3Crc != 0)
status = false;
}
@@ -861,8 +842,7 @@ public static class CompactDisc
Array.Copy(cdTextPack4, 0, cdTextPack4ForCrc, 0, 16);
ushort calculatedCdtp4Crc = CRC16CCITTContext.Calculate(cdTextPack4ForCrc);
- if(cdTextPack4Crc == calculatedCdtp4Crc ||
- cdTextPack4Crc == 0)
+ if(cdTextPack4Crc == calculatedCdtp4Crc || cdTextPack4Crc == 0)
return status;
return false;
@@ -1007,10 +987,7 @@ public static class CompactDisc
q[0] = (byte)oldAdr;
}
- if(preCrcOk &&
- nextCrcOk &&
- (nextQ[0] & 0xF0) == (preQ[0] & 0xF0) &&
- (q[0] & 0xF0) != (nextQ[0] & 0xF0))
+ if(preCrcOk && nextCrcOk && (nextQ[0] & 0xF0) == (preQ[0] & 0xF0) && (q[0] & 0xF0) != (nextQ[0] & 0xF0))
{
q[0] = (byte)((q[0] & 0x03) + (nextQ[0] & 0xF0));
@@ -1037,8 +1014,7 @@ public static class CompactDisc
if(preCrcOk && nextCrcOk)
{
- if(preQ[1] == nextQ[1] &&
- preQ[1] != q[1])
+ if(preQ[1] == nextQ[1] && preQ[1] != q[1])
{
q[1] = preQ[1];
fixedTno = true;
@@ -1053,8 +1029,7 @@ public static class CompactDisc
if(preCrcOk && nextCrcOk)
{
- if(preQ[2] == nextQ[2] &&
- preQ[2] != q[2])
+ if(preQ[2] == nextQ[2] && preQ[2] != q[2])
{
q[2] = preQ[2];
fixedIndex = true;
@@ -1145,9 +1120,7 @@ public static class CompactDisc
}
// Next is not pregap and we didn't fix relative position with previous
- if(nextQ[2] > 0 &&
- nextCrcOk &&
- !fixedRelPos)
+ if(nextQ[2] > 0 && nextCrcOk && !fixedRelPos)
{
rmin = (byte)(nextQ[3] / 16 * 10 + (nextQ[3] & 0x0F));
rsec = (byte)(nextQ[4] / 16 * 10 + (nextQ[4] & 0x0F));
@@ -1262,9 +1235,7 @@ public static class CompactDisc
}
// Next is not pregap and we didn't fix relative position with previous
- if(nextQ[2] > 0 &&
- nextCrcOk &&
- !fixedAbsPos)
+ if(nextQ[2] > 0 && nextCrcOk && !fixedAbsPos)
{
rmin = (byte)(nextQ[7] / 16 * 10 + (nextQ[7] & 0x0F));
rsec = (byte)(nextQ[8] / 16 * 10 + (nextQ[8] & 0x0F));
@@ -1350,12 +1321,7 @@ public static class CompactDisc
bool relOk = dPos == 1;
- if(q[0] != preQ[0] ||
- q[1] != preQ[1] ||
- q[2] != preQ[2] ||
- q[6] != 0 ||
- !absOk ||
- !relOk)
+ if(q[0] != preQ[0] || q[1] != preQ[1] || q[2] != preQ[2] || q[6] != 0 || !absOk || !relOk)
return false;
CRC16CCITTContext.Data(q, 10, out qCrc);
@@ -1388,12 +1354,7 @@ public static class CompactDisc
bool relOk = dPos == 1;
- if(q[0] != nextQ[0] ||
- q[1] != nextQ[1] ||
- q[2] != nextQ[2] ||
- q[6] != 0 ||
- !absOk ||
- !relOk)
+ if(q[0] != nextQ[0] || q[1] != nextQ[1] || q[2] != nextQ[2] || q[6] != 0 || !absOk || !relOk)
return false;
CRC16CCITTContext.Data(q, 10, out qCrc);
@@ -1488,9 +1449,7 @@ public static class CompactDisc
return true;
}
- if(!fixCrc ||
- !nextCrcOk ||
- !preCrcOk)
+ if(!fixCrc || !nextCrcOk || !preCrcOk)
return false;
CRC16CCITTContext.Data(q, 10, out qCrc);
@@ -1587,9 +1546,7 @@ public static class CompactDisc
return true;
}
- if(!fixCrc ||
- !nextCrcOk ||
- !preCrcOk)
+ if(!fixCrc || !nextCrcOk || !preCrcOk)
return false;
CRC16CCITTContext.Data(q, 10, out qCrc);
diff --git a/Aaru.Core/Media/Detection/MMC.cs b/Aaru.Core/Media/Detection/MMC.cs
index 16fb1638c..4c923bf66 100644
--- a/Aaru.Core/Media/Detection/MMC.cs
+++ b/Aaru.Core/Media/Detection/MMC.cs
@@ -80,10 +80,16 @@ public static class MMC
0x50, 0x6C, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x35, 0x00, 0x00, 0x00, 0x00
};
- static readonly byte[] _operaId = { 0x01, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x01 };
+ static readonly byte[] _operaId =
+ {
+ 0x01, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x01
+ };
// Only present on bootable CDs, but those make more than 99% of all available
- static readonly byte[] _fmTownsBootId = { 0x49, 0x50, 0x4C, 0x34, 0xEB, 0x55, 0x06 };
+ static readonly byte[] _fmTownsBootId =
+ {
+ 0x49, 0x50, 0x4C, 0x34, 0xEB, 0x55, 0x06
+ };
/// Present on first two seconds of second track, says "COPYRIGHT BANDAI"
static readonly byte[] _playdiaCopyright = "COPYRIGHT BANDAI"u8.ToArray();
@@ -125,7 +131,10 @@ public static class MMC
if(sector?.Length != 2352)
return false;
- byte[] syncMark = { 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00 };
+ byte[] syncMark =
+ {
+ 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
+ };
var testMark = new byte[12];
Array.Copy(sector, 0, testMark, 0, 12);
@@ -140,7 +149,10 @@ public static class MMC
if(sector?.Length != 2352)
return false;
- byte[] syncMark = { 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00 };
+ byte[] syncMark =
+ {
+ 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
+ };
var testMark = new byte[12];
@@ -196,12 +208,14 @@ public static class MMC
if(sector16?.Length != 2352)
return false;
- byte[] cdiMark = { 0x01, 0x43, 0x44, 0x2D };
+ byte[] cdiMark =
+ {
+ 0x01, 0x43, 0x44, 0x2D
+ };
bool isData = IsData(sector0);
- if(!isData ||
- sector0[0xF] != 2 && sector0[0xF] != 1)
+ if(!isData || sector0[0xF] != 2 && sector0[0xF] != 1)
return false;
var testMark = new byte[4];
@@ -212,8 +226,7 @@ public static class MMC
static bool IsVideoNowColor(byte[] videoFrame)
{
- if(videoFrame is null ||
- videoFrame.Length < _videoNowColorFrameMarker.Length)
+ if(videoFrame is null || videoFrame.Length < _videoNowColorFrameMarker.Length)
return false;
var buffer = new byte[_videoNowColorFrameMarker.Length];
@@ -447,8 +460,7 @@ public static class MMC
break;
case 0x20:
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.TOC_says_disc_type_is_CD_ROM_XA);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.TOC_says_disc_type_is_CD_ROM_XA);
mediaType = MediaType.CDROMXA;
@@ -457,7 +469,7 @@ public static class MMC
}
foreach(FullTOC.TrackDataDescriptor track in
- decodedToc.Value.TrackDescriptors.Where(t => t.POINT is > 0 and <= 0x99))
+ decodedToc.Value.TrackDescriptors.Where(t => t.POINT is > 0 and <= 0x99))
{
if(track.TNO == 1 &&
((TocControl)(track.CONTROL & 0x0D) == TocControl.DataTrack ||
@@ -467,8 +479,11 @@ public static class MMC
if((TocControl)(track.CONTROL & 0x0D) == TocControl.DataTrack ||
(TocControl)(track.CONTROL & 0x0D) == TocControl.DataTrackIncremental)
{
- var startAddress = (uint)(track.PHOUR * 3600 * 75 + track.PMIN * 60 * 75 +
- track.PSEC * 75 + track.PFRAME - 150);
+ var startAddress = (uint)(track.PHOUR * 3600 * 75 +
+ track.PMIN * 60 * 75 +
+ track.PSEC * 75 +
+ track.PFRAME -
+ 150);
if(startAddress < startOfFirstDataTrack)
startOfFirstDataTrack = startAddress;
@@ -504,19 +519,14 @@ public static class MMC
break;
}
- if(hasDataTrack &&
- !hasAudioTrack &&
- sessions == 1)
+ if(hasDataTrack && !hasAudioTrack && sessions == 1)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.Disc_has_only_data_in_a_session_CD_ROM);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Disc_has_only_data_in_a_session_CD_ROM);
mediaType = MediaType.CDROM;
}
- if(hasVideoTrack &&
- !hasDataTrack &&
- sessions == 1)
+ if(hasVideoTrack && !hasDataTrack && sessions == 1)
{
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Disc_has_video_tracks_CD_Video);
@@ -534,7 +544,9 @@ public static class MMC
TocControl.DataTrackIncremental)).
Select(track => (uint)(track.PHOUR * 3600 * 75 +
track.PMIN * 60 * 75 +
- track.PSEC * 75 + track.PFRAME - 150) +
+ track.PSEC * 75 +
+ track.PFRAME -
+ 150) +
16))
{
sense = dev.ReadCd(out cmdBuf, out _, startAddress, 2352, 1, MmcSectorTypes.AllTypes, false, false,
@@ -559,8 +571,7 @@ public static class MMC
cmdBuf[15] != 0x02)
continue;
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.Disc_has_a_mode_two_data_track_CD_ROM_XA);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Disc_has_a_mode_two_data_track_CD_ROM_XA);
mediaType = MediaType.CDROMXA;
@@ -578,14 +589,14 @@ public static class MMC
var firstSectorSecondSessionFirstTrack = (uint)(secondSessionFirstTrackTrack.PHOUR * 3600 * 75 +
secondSessionFirstTrackTrack.PMIN * 60 * 75 +
secondSessionFirstTrackTrack.PSEC * 75 +
- secondSessionFirstTrackTrack.PFRAME - 150);
+ secondSessionFirstTrackTrack.PFRAME -
+ 150);
sense = dev.ReadCd(out cmdBuf, out _, firstSectorSecondSessionFirstTrack, 2352, 1, MmcSectorTypes.AllTypes,
false, false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None,
MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
firstTrackSecondSession = cmdBuf;
else
{
@@ -593,8 +604,7 @@ public static class MMC
false, false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None,
MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
firstTrackSecondSession = cmdBuf;
}
@@ -602,8 +612,7 @@ public static class MMC
MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true, true,
MmcErrorField.None, MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
firstTrackSecondSessionAudio = cmdBuf;
else
{
@@ -611,8 +620,7 @@ public static class MMC
MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true, false,
MmcErrorField.None, MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
firstTrackSecondSessionAudio = cmdBuf;
}
}
@@ -648,8 +656,11 @@ public static class MMC
if(firstTrack?.POINT is >= 1 and < 0xA0)
{
- var firstTrackSector = (uint)(firstTrack.Value.PHOUR * 3600 * 75 + firstTrack.Value.PMIN * 60 * 75 +
- firstTrack.Value.PSEC * 75 + firstTrack.Value.PFRAME - 150);
+ var firstTrackSector = (uint)(firstTrack.Value.PHOUR * 3600 * 75 +
+ firstTrack.Value.PMIN * 60 * 75 +
+ firstTrack.Value.PSEC * 75 +
+ firstTrack.Value.PFRAME -
+ 150);
// Check for hidden data before start of track 1
if(firstTrackSector > 0)
@@ -658,8 +669,7 @@ public static class MMC
MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!dev.Error &&
- !sense)
+ if(!dev.Error && !sense)
{
hiddenTrack = true;
@@ -671,8 +681,7 @@ public static class MMC
false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None,
MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- IsCdi(sector0, sector16))
+ if(!sense && IsCdi(sector0, sector16))
{
mediaType = MediaType.CDIREADY;
@@ -756,8 +765,7 @@ public static class MMC
MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
sector0 = new byte[2048];
Array.Copy(cmdBuf, 16, sector0, 0, 2048);
@@ -766,8 +774,7 @@ public static class MMC
MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
sector1 = new byte[2048];
Array.Copy(cmdBuf, 16, sector1, 0, 2048);
@@ -777,8 +784,7 @@ public static class MMC
MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
playdia1 = new byte[2048];
Array.Copy(cmdBuf, 24, playdia1, 0, 2048);
@@ -788,8 +794,7 @@ public static class MMC
MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
playdia2 = new byte[2048];
Array.Copy(cmdBuf, 24, playdia2, 0, 2048);
@@ -801,8 +806,7 @@ public static class MMC
false, false, true, MmcHeaderCodes.AllHeaders, true, true,
MmcErrorField.None, MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
firstDataSectorNotZero = new byte[2048];
Array.Copy(cmdBuf, 16, firstDataSectorNotZero, 0, 2048);
@@ -812,8 +816,7 @@ public static class MMC
MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true,
true, MmcErrorField.None, MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
secondDataSectorNotZero = new byte[2048];
Array.Copy(cmdBuf, 16, secondDataSectorNotZero, 0, 2048);
@@ -843,8 +846,7 @@ public static class MMC
MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
sector0 = new byte[2048];
Array.Copy(cmdBuf, 0, sector0, 0, 2048);
@@ -853,8 +855,7 @@ public static class MMC
MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
sector1 = new byte[2048];
Array.Copy(cmdBuf, 1, sector0, 0, 2048);
@@ -864,8 +865,7 @@ public static class MMC
MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
playdia1 = new byte[2048];
Array.Copy(cmdBuf, 0, playdia1, 0, 2048);
@@ -875,8 +875,7 @@ public static class MMC
MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
playdia2 = new byte[2048];
Array.Copy(cmdBuf, 0, playdia2, 0, 2048);
@@ -888,8 +887,7 @@ public static class MMC
false, false, false, MmcHeaderCodes.None, true, false,
MmcErrorField.None, MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
firstDataSectorNotZero = new byte[2048];
Array.Copy(cmdBuf, 0, firstDataSectorNotZero, 0, 2048);
@@ -899,8 +897,7 @@ public static class MMC
MmcSectorTypes.Mode2, false, false, false, MmcHeaderCodes.None, true,
false, MmcErrorField.None, MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
secondDataSectorNotZero = new byte[2048];
Array.Copy(cmdBuf, 0, secondDataSectorNotZero, 0, 2048);
@@ -930,8 +927,7 @@ public static class MMC
MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
sector0 = cmdBuf;
@@ -939,16 +935,14 @@ public static class MMC
MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
sector1 = cmdBuf;
sense = dev.ReadCd(out cmdBuf, out _, 0, 2048, 12, MmcSectorTypes.Mode1, false, false,
false, MmcHeaderCodes.None, true, false, MmcErrorField.None,
MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
ps2BootSectors = cmdBuf;
if(startOfFirstDataTrack != uint.MaxValue)
@@ -957,16 +951,14 @@ public static class MMC
MmcSectorTypes.Mode1, false, false, false, MmcHeaderCodes.None, true,
false, MmcErrorField.None, MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
firstDataSectorNotZero = cmdBuf;
sense = dev.ReadCd(out cmdBuf, out _, startOfFirstDataTrack + 1, 2048, 1,
MmcSectorTypes.Mode1, false, false, false, MmcHeaderCodes.None, true,
false, MmcErrorField.None, MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
secondDataSectorNotZero = cmdBuf;
}
}
@@ -997,24 +989,20 @@ public static class MMC
sense = dev.Read16(out cmdBuf, out _, 0, false, false, false, 0, 2048, 0, 1, false, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
sector0 = cmdBuf;
sense = dev.Read16(out cmdBuf, out _, 0, false, false, false, 1, 2048, 0, 1, false, dev.Timeout,
out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
sector1 = cmdBuf;
sense = dev.Read16(out cmdBuf, out _, 0, false, false, false, 0, 2048, 0, 12, false, dev.Timeout,
out _);
- if(!sense &&
- !dev.Error &&
- cmdBuf.Length == 0x6000)
+ if(!sense && !dev.Error && cmdBuf.Length == 0x6000)
ps2BootSectors = cmdBuf;
}
else
@@ -1022,24 +1010,20 @@ public static class MMC
sense = dev.Read12(out cmdBuf, out _, 0, false, false, false, false, 0, 2048, 0, 1, false,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
sector0 = cmdBuf;
sense = dev.Read12(out cmdBuf, out _, 0, false, false, false, false, 1, 2048, 0, 1, false,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
sector1 = cmdBuf;
sense = dev.Read12(out cmdBuf, out _, 0, false, false, false, false, 0, 2048, 0, 12, false,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error &&
- cmdBuf.Length == 0x6000)
+ if(!sense && !dev.Error && cmdBuf.Length == 0x6000)
ps2BootSectors = cmdBuf;
}
else
@@ -1047,46 +1031,38 @@ public static class MMC
sense = dev.Read10(out cmdBuf, out _, 0, false, false, false, false, 0, 2048, 0, 1, dev.Timeout,
out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
sector0 = cmdBuf;
sense = dev.Read10(out cmdBuf, out _, 0, false, false, false, false, 1, 2048, 0, 1,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
sector1 = cmdBuf;
sense = dev.Read10(out cmdBuf, out _, 0, false, false, false, false, 0, 2048, 0, 12,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error &&
- cmdBuf.Length == 0x6000)
+ if(!sense && !dev.Error && cmdBuf.Length == 0x6000)
ps2BootSectors = cmdBuf;
}
else
{
sense = dev.Read6(out cmdBuf, out _, 0, 2048, 1, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
sector0 = cmdBuf;
sense = dev.Read6(out cmdBuf, out _, 1, 2048, 1, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
sector1 = cmdBuf;
sense = dev.Read6(out cmdBuf, out _, 0, 2048, 12, dev.Timeout, out _);
- if(!sense &&
- !dev.Error &&
- cmdBuf.Length == 0x6000)
+ if(!sense && !dev.Error && cmdBuf.Length == 0x6000)
ps2BootSectors = cmdBuf;
}
}
@@ -1207,8 +1183,7 @@ public static class MMC
break;
// If it is PVD or end of descriptor chain, break
- if(isoSector[0] == 1 ||
- isoSector[0] == 255)
+ if(isoSector[0] == 1 || isoSector[0] == 255)
break;
isoSectorPosition++;
@@ -1226,8 +1201,7 @@ public static class MMC
var rootStart = BitConverter.ToUInt32(isoSector, 158);
var rootLength = BitConverter.ToUInt32(isoSector, 166);
- if(rootStart == 0 ||
- rootLength == 0)
+ if(rootStart == 0 || rootLength == 0)
return;
rootLength /= 2048;
@@ -1273,8 +1247,7 @@ public static class MMC
if(name.EndsWith(";1", StringComparison.InvariantCulture))
name = name[..^2];
- if(name == "PHOTO_CD" &&
- (isoSector[rootPos + 25] & 0x02) == 0x02)
+ if(name == "PHOTO_CD" && (isoSector[rootPos + 25] & 0x02) == 0x02)
{
pcdStart = BitConverter.ToUInt32(isoSector, rootPos + 2);
pcdLength = BitConverter.ToUInt32(isoSector, rootPos + 10) / 2048;
@@ -1443,8 +1416,7 @@ public static class MMC
string ps2BootSectorsHash = Sha256Context.Data(ps2BootSectors, out _);
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.PlayStation_2_boot_sectors_SHA256_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.PlayStation_2_boot_sectors_SHA256_0,
ps2BootSectorsHash);
if(ps2BootSectorsHash is PS2_PAL_HASH or PS2_NTSC_HASH or PS2_JAPANESE_HASH)
@@ -1482,8 +1454,7 @@ public static class MMC
}
}
- if(playdia1 != null &&
- playdia2 != null)
+ if(playdia1 != null && playdia2 != null)
{
var pd1 = new byte[_playdiaCopyright.Length];
var pd2 = new byte[_playdiaCopyright.Length];
@@ -1491,8 +1462,7 @@ public static class MMC
Array.Copy(playdia1, 38, pd1, 0, pd1.Length);
Array.Copy(playdia2, 0, pd2, 0, pd1.Length);
- if(_playdiaCopyright.SequenceEqual(pd1) &&
- _playdiaCopyright.SequenceEqual(pd2))
+ if(_playdiaCopyright.SequenceEqual(pd1) && _playdiaCopyright.SequenceEqual(pd2))
{
mediaType = MediaType.Playdia;
@@ -1674,8 +1644,7 @@ public static class MMC
break;
// If it is PVD or end of descriptor chain, break
- if(isoSector[0] == 1 ||
- isoSector[0] == 255)
+ if(isoSector[0] == 1 || isoSector[0] == 255)
break;
isoSectorPosition++;
@@ -1693,8 +1662,7 @@ public static class MMC
var rootStart = BitConverter.ToUInt32(isoSector, 158);
var rootLength = BitConverter.ToUInt32(isoSector, 166);
- if(rootStart == 0 ||
- rootLength == 0)
+ if(rootStart == 0 || rootLength == 0)
return;
rootLength /= 2048;
@@ -1851,8 +1819,7 @@ public static class MMC
string line = sr.ReadLine();
// End of file
- if(line is null ||
- line.Length == 0)
+ if(line is null || line.Length == 0)
{
if(lineNumber == 0)
correctNeoGeoCd = false;
@@ -1906,8 +1873,7 @@ public static class MMC
}
// Second part must be a single digit
- if(split[1].Length != 1 ||
- !byte.TryParse(split[1], out _))
+ if(split[1].Length != 1 || !byte.TryParse(split[1], out _))
{
correctNeoGeoCd = false;
@@ -2173,8 +2139,7 @@ public static class MMC
string line = sr.ReadLine();
// End of file
- if(line is null ||
- line.Length == 0)
+ if(line is null || line.Length == 0)
break;
line = line.Replace(" ", "");
@@ -2206,8 +2171,7 @@ public static class MMC
break;
}
- if(ps1BootFile != null &&
- rootEntries.Contains(ps1BootFile.ToUpperInvariant()))
+ if(ps1BootFile != null && rootEntries.Contains(ps1BootFile.ToUpperInvariant()))
{
mediaType = MediaType.PS1CD;
@@ -2215,8 +2179,7 @@ public static class MMC
Localization.Core.Found_correct_SYSTEM_CNF_file_in_root_PS1);
}
- if(ps2BootFile != null &&
- rootEntries.Contains(ps2BootFile.ToUpperInvariant()))
+ if(ps2BootFile != null && rootEntries.Contains(ps2BootFile.ToUpperInvariant()))
{
mediaType = MediaType.PS2CD;
@@ -2248,8 +2211,7 @@ public static class MMC
string ps2BootSectorsHash = Sha256Context.Data(ps2BootSectors, out _);
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.PlayStation_2_boot_sectors_SHA256_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.PlayStation_2_boot_sectors_SHA256_0,
ps2BootSectorsHash);
if(ps2BootSectorsHash is PS2_PAL_HASH or PS2_NTSC_HASH or PS2_JAPANESE_HASH)
@@ -2290,8 +2252,7 @@ public static class MMC
tmp = new byte[_ps4Id.Length];
Array.Copy(sector1, 512, tmp, 0, tmp.Length);
- if(tmp.SequenceEqual(_ps4Id) &&
- mediaType == MediaType.BDROM)
+ if(tmp.SequenceEqual(_ps4Id) && mediaType == MediaType.BDROM)
{
mediaType = MediaType.PS4BD;
@@ -2300,8 +2261,7 @@ public static class MMC
}
}
- if(blurayDi is { Units.Length: > 0 } &&
- blurayDi?.Units[0].DiscTypeIdentifier != null)
+ if(blurayDi is { Units.Length: > 0 } && blurayDi?.Units[0].DiscTypeIdentifier != null)
{
string blurayType = StringHandlers.CToString(blurayDi?.Units[0].DiscTypeIdentifier);
diff --git a/Aaru.Core/Media/Info/CompactDisc.cs b/Aaru.Core/Media/Info/CompactDisc.cs
index 5ce57099e..611dee3cb 100644
--- a/Aaru.Core/Media/Info/CompactDisc.cs
+++ b/Aaru.Core/Media/Info/CompactDisc.cs
@@ -92,7 +92,10 @@ public static class CompactDisc
if(dataTrack != null)
{
// Build sync
- sectorSync = new byte[] { 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00 };
+ sectorSync = new byte[]
+ {
+ 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
+ };
tmpBuf = new byte[sectorSync.Length];
@@ -107,8 +110,7 @@ public static class CompactDisc
sense = dev.PlextorReadCdDa(out cmdBuf, out _, wantedLba, sectorSize, 3, PlextorSubchannel.None,
dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
supportsPlextorReadCdDa = true;
@@ -144,7 +146,8 @@ public static class CompactDisc
}
if(!offsetFound &&
- (debug || dbDev?.ATAPI?.RemovableMedias?.Any(d => d.CanReadCdScrambled == true) == true ||
+ (debug ||
+ dbDev?.ATAPI?.RemovableMedias?.Any(d => d.CanReadCdScrambled == true) == true ||
dbDev?.SCSI?.RemovableMedias?.Any(d => d.CanReadCdScrambled == true) == true ||
dbDev?.SCSI?.MultiMediaDevice?.TestedMedia?.Any(d => d.CanReadCdScrambled == true) == true ||
dev.Manufacturer.Equals("hl-dt-st", StringComparison.InvariantCultureIgnoreCase)))
@@ -153,8 +156,7 @@ public static class CompactDisc
false, false, MmcHeaderCodes.None, true, false, MmcErrorField.None,
MmcSubchannel.None, dev.Timeout, out _);
- if(!sense &&
- !dev.Error)
+ if(!sense && !dev.Error)
{
// Clear cache
for(var i = 0; i < 63; i++)
@@ -212,8 +214,7 @@ public static class CompactDisc
for(var i = 1; i < tracks.Length; i++)
{
- if(tracks[i - 1].Type == TrackType.Audio ||
- tracks[i].Type != TrackType.Audio)
+ if(tracks[i - 1].Type == TrackType.Audio || tracks[i].Type != TrackType.Audio)
continue;
dataTrack = tracks[i - 1];
@@ -222,8 +223,7 @@ public static class CompactDisc
break;
}
- if(dataTrack is null ||
- audioTrack is null)
+ if(dataTrack is null || audioTrack is null)
return;
// Found them
diff --git a/Aaru.Core/Media/Info/ScsiInfo.cs b/Aaru.Core/Media/Info/ScsiInfo.cs
index 683bb557e..0ae451981 100644
--- a/Aaru.Core/Media/Info/ScsiInfo.cs
+++ b/Aaru.Core/Media/Info/ScsiInfo.cs
@@ -62,8 +62,7 @@ public sealed class ScsiInfo
/// Device
public ScsiInfo(Device dev)
{
- if(dev.Type != DeviceType.SCSI &&
- dev.Type != DeviceType.ATAPI)
+ if(dev.Type != DeviceType.SCSI && dev.Type != DeviceType.ATAPI)
return;
MediaType = MediaType.Unknown;
@@ -210,11 +209,9 @@ public sealed class ScsiInfo
if(!sense)
ReadCapacity16 = cmdBuf;
- if(ReadCapacity == null ||
- Blocks is 0xFFFFFFFF or 0)
+ if(ReadCapacity == null || Blocks is 0xFFFFFFFF or 0)
{
- if(ReadCapacity16 == null &&
- Blocks == 0)
+ if(ReadCapacity16 == null && Blocks == 0)
{
if(dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice)
{
@@ -234,8 +231,7 @@ public sealed class ScsiInfo
}
}
- if(Blocks != 0 &&
- BlockSize != 0)
+ if(Blocks != 0 && BlockSize != 0)
Blocks++;
break;
@@ -248,8 +244,7 @@ public sealed class ScsiInfo
{
sense = dev.ReportDensitySupport(out medBuf, out senseBuf, true, dev.Timeout, out _);
- if(!sense &&
- !seqBuf.SequenceEqual(medBuf))
+ if(!sense && !seqBuf.SequenceEqual(medBuf))
{
DensitySupport = seqBuf;
DensitySupportHeader = Decoders.SCSI.SSC.DensitySupport.DecodeDensity(seqBuf);
@@ -262,8 +257,7 @@ public sealed class ScsiInfo
{
sense = dev.ReportDensitySupport(out medBuf, out senseBuf, true, true, dev.Timeout, out _);
- if(!sense &&
- !seqBuf.SequenceEqual(medBuf))
+ if(!sense && !seqBuf.SequenceEqual(medBuf))
{
MediaTypeSupport = medBuf;
MediaTypeSupportHeader = Decoders.SCSI.SSC.DensitySupport.DecodeMediumType(seqBuf);
@@ -304,11 +298,9 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME, "READ GET CONFIGURATION:\n{0}",
- Sense.PrettifySense(senseBuf));
+ AaruConsole.DebugWriteLine(MODULE_NAME, "READ GET CONFIGURATION:\n{0}", Sense.PrettifySense(senseBuf));
- if(dev.IsUsb &&
- scsiMediumType is 0x40 or 0x41 or 0x42)
+ if(dev.IsUsb && scsiMediumType is 0x40 or 0x41 or 0x42)
MediaType = MediaType.FlashDrive;
}
else
@@ -316,8 +308,7 @@ public sealed class ScsiInfo
MmcConfiguration = cmdBuf;
Features.SeparatedFeatures ftr = Features.Separate(cmdBuf);
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.GET_CONFIGURATION_current_profile_is_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.GET_CONFIGURATION_current_profile_is_0,
ftr.CurrentProfile);
switch(ftr.CurrentProfile)
@@ -455,8 +446,7 @@ public sealed class ScsiInfo
}
}
- if(MediaType == MediaType.PD650 &&
- Blocks == 1281856)
+ if(MediaType == MediaType.PD650 && Blocks == 1281856)
MediaType = MediaType.PD650_WORM;
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
@@ -476,8 +466,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_DISC_STRUCTURE_Write_Protection_Status_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_DISC_STRUCTURE_Write_Protection_Status_0,
Sense.PrettifySense(senseBuf));
}
else
@@ -496,10 +485,9 @@ public sealed class ScsiInfo
if(MediaType is MediaType.DVDDownload or MediaType.DVDPR or MediaType.DVDPRDL or MediaType.DVDPRW
or MediaType.DVDPRWDL or MediaType.DVDR or MediaType.DVDRAM or MediaType.DVDRDL
- or MediaType.DVDROM
- or MediaType.DVDRW or MediaType.DVDRWDL or MediaType.HDDVDR or MediaType.HDDVDRAM
- or MediaType.HDDVDRDL
- or MediaType.HDDVDROM or MediaType.HDDVDRW or MediaType.HDDVDRWDL)
+ or MediaType.DVDROM or MediaType.DVDRW or MediaType.DVDRWDL or MediaType.HDDVDR
+ or MediaType.HDDVDRAM or MediaType.HDDVDRDL or MediaType.HDDVDROM or MediaType.HDDVDRW
+ or MediaType.HDDVDRWDL)
{
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout, out _);
@@ -614,8 +602,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_DISC_STRUCTURE_DVD_AACS_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_DISC_STRUCTURE_DVD_AACS_0,
Sense.PrettifySense(senseBuf));
}
else
@@ -645,8 +632,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_DISC_STRUCTURE_Medium_Status_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_DISC_STRUCTURE_Medium_Status_0,
Sense.PrettifySense(senseBuf));
}
else
@@ -779,8 +765,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_DISC_STRUCTURE_Pre_Recorded_Info_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_DISC_STRUCTURE_Pre_Recorded_Info_0,
Sense.PrettifySense(senseBuf));
}
else
@@ -807,8 +792,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_DISC_STRUCTURE_DVD_R_Media_ID_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_DISC_STRUCTURE_DVD_R_Media_ID_0,
Sense.PrettifySense(senseBuf));
}
else
@@ -820,8 +804,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_DISC_STRUCTURE_DVD_R_PFI_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_DISC_STRUCTURE_DVD_R_PFI_0,
Sense.PrettifySense(senseBuf));
}
else
@@ -876,8 +859,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_DISC_STRUCTURE_HD_DVD_CMI_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_DISC_STRUCTURE_HD_DVD_CMI_0,
Sense.PrettifySense(senseBuf));
}
else
@@ -911,8 +893,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_DISC_STRUCTURE_Last_RMD_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_DISC_STRUCTURE_Last_RMD_0,
Sense.PrettifySense(senseBuf));
}
else
@@ -932,8 +913,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_DISC_STRUCTURE_Layer_Capacity_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_DISC_STRUCTURE_Layer_Capacity_0,
Sense.PrettifySense(senseBuf));
}
else
@@ -1093,8 +1073,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- "READ DISC STRUCTURE: Spare Area Information\n{0}",
+ AaruConsole.DebugWriteLine(MODULE_NAME, "READ DISC STRUCTURE: Spare Area Information\n{0}",
Sense.PrettifySense(senseBuf));
}
else
@@ -1105,8 +1084,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_DISC_STRUCTURE_Raw_DFL_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_DISC_STRUCTURE_Raw_DFL_0,
Sense.PrettifySense(senseBuf));
}
else
@@ -1192,8 +1170,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_TOC_PMA_ATIP_Session_Info_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_TOC_PMA_ATIP_Session_Info_0,
Sense.PrettifySense(senseBuf));
}
else if(cmdBuf.Length > 4)
@@ -1212,8 +1189,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_TOC_PMA_ATIP_Raw_TOC_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_TOC_PMA_ATIP_Raw_TOC_0,
Sense.PrettifySense(senseBuf));
}
else if(cmdBuf.Length > 4)
@@ -1237,8 +1213,7 @@ public sealed class ScsiInfo
if(sense)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.READ_TOC_PMA_ATIP_CD_TEXT_0,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.READ_TOC_PMA_ATIP_CD_TEXT_0,
Sense.PrettifySense(senseBuf));
}
else if(cmdBuf.Length > 4)
@@ -1249,9 +1224,7 @@ public sealed class ScsiInfo
sense = dev.ReadMcn(out string mcn, out _, out _, dev.Timeout, out _);
- if(!sense &&
- mcn != null &&
- mcn != "0000000000000")
+ if(!sense && mcn != null && mcn != "0000000000000")
Mcn = mcn;
Isrcs = new Dictionary();
@@ -1260,9 +1233,7 @@ public sealed class ScsiInfo
{
sense = dev.ReadIsrc(i, out string isrc, out _, out _, dev.Timeout, out _);
- if(!sense &&
- isrc != null &&
- isrc != "000000000000")
+ if(!sense && isrc != null && isrc != "000000000000")
Isrcs.Add(i, isrc);
}
@@ -1277,8 +1248,7 @@ public sealed class ScsiInfo
#region Nintendo
- if(MediaType == MediaType.Unknown &&
- Blocks > 0)
+ if(MediaType == MediaType.Unknown && Blocks > 0)
{
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout, out _);
@@ -1367,8 +1337,7 @@ public sealed class ScsiInfo
DecodedXboxSecuritySector = SS.Decode(cmdBuf);
// Get video partition size
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.Getting_video_partition_size);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Getting_video_partition_size);
sense = dev.KreonLock(out senseBuf, dev.Timeout, out _);
@@ -1401,11 +1370,12 @@ public sealed class ScsiInfo
break;
}
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.Video_partition_total_size_0_sectors, totalSize);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Video_partition_total_size_0_sectors,
+ totalSize);
ulong l0Video = PFI.Decode(cmdBuf, MediaType).Value.Layer0EndPSN -
- PFI.Decode(cmdBuf, MediaType).Value.DataAreaStartPSN + 1;
+ PFI.Decode(cmdBuf, MediaType).Value.DataAreaStartPSN +
+ 1;
ulong l1Video = totalSize - l0Video + 1;
@@ -1431,10 +1401,11 @@ public sealed class ScsiInfo
ulong gameSize =
((ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + cmdBuf[3]) &
- 0xFFFFFFFF) + 1;
+ 0xFFFFFFFF) +
+ 1;
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.Game_partition_total_size_0_sectors, gameSize);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Game_partition_total_size_0_sectors,
+ gameSize);
// Get middle zone size
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Getting_middle_zone_size);
@@ -1469,12 +1440,15 @@ public sealed class ScsiInfo
break;
}
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.Unlocked_total_size_0_sectors, totalSize);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Unlocked_total_size_0_sectors,
+ totalSize);
- ulong middleZone =
- totalSize - (PFI.Decode(cmdBuf, MediaType).Value.Layer0EndPSN -
- PFI.Decode(cmdBuf, MediaType).Value.DataAreaStartPSN + 1) - gameSize + 1;
+ ulong middleZone = totalSize -
+ (PFI.Decode(cmdBuf, MediaType).Value.Layer0EndPSN -
+ PFI.Decode(cmdBuf, MediaType).Value.DataAreaStartPSN +
+ 1) -
+ gameSize +
+ 1;
totalSize = l0Video + l1Video + middleZone * 2 + gameSize;
ulong layerBreak = l0Video + middleZone + gameSize / 2;
@@ -1503,13 +1477,10 @@ public sealed class ScsiInfo
break;
}
- if(MediaType == MediaType.Unknown &&
- dev.IsUsb &&
- containsFloppyPage)
+ if(MediaType == MediaType.Unknown && dev.IsUsb && containsFloppyPage)
MediaType = MediaType.FlashDrive;
- if(MediaType == MediaType.Unknown &&
- !dev.IsRemovable)
+ if(MediaType == MediaType.Unknown && !dev.IsRemovable)
MediaType = MediaType.GENERIC_HDD;
if(DeviceInfo.ScsiType != PeripheralDeviceTypes.MultiMediaDevice ||
diff --git a/Aaru.Core/Options.cs b/Aaru.Core/Options.cs
index ed034fec4..9355477fa 100644
--- a/Aaru.Core/Options.cs
+++ b/Aaru.Core/Options.cs
@@ -88,8 +88,7 @@ public static class Options
sb = new StringBuilder();
inValue = false;
- if(string.IsNullOrEmpty(name) ||
- string.IsNullOrEmpty(value))
+ if(string.IsNullOrEmpty(name) || string.IsNullOrEmpty(value))
continue;
if(parsed.ContainsKey(name))
@@ -191,8 +190,7 @@ public static class Options
value = sb.ToString();
- if(string.IsNullOrEmpty(name) ||
- string.IsNullOrEmpty(value))
+ if(string.IsNullOrEmpty(name) || string.IsNullOrEmpty(value))
return parsed;
if(parsed.ContainsKey(name))
diff --git a/Aaru.Core/Partitions.cs b/Aaru.Core/Partitions.cs
index dedd7c2dc..014ff682c 100644
--- a/Aaru.Core/Partitions.cs
+++ b/Aaru.Core/Partitions.cs
@@ -206,8 +206,10 @@ public static class Partitions
}
}
- Partition[] childArray = childPartitions.OrderBy(part => part.Start).ThenBy(part => part.Length).
- ThenBy(part => part.Scheme).ToArray();
+ Partition[] childArray = childPartitions.OrderBy(part => part.Start).
+ ThenBy(part => part.Length).
+ ThenBy(part => part.Scheme).
+ ToArray();
for(long i = 0; i < childArray.LongLength; i++)
childArray[i].Sequence = (ulong)i;
@@ -219,8 +221,7 @@ public static class Partitions
/// List of partitions
public static void AddSchemesToStats(List partitions)
{
- if(partitions == null ||
- partitions.Count == 0)
+ if(partitions == null || partitions.Count == 0)
return;
List schemes = new();
diff --git a/Aaru.Core/PluginBase.cs b/Aaru.Core/PluginBase.cs
index 5f4c480fc..eaccd4915 100644
--- a/Aaru.Core/PluginBase.cs
+++ b/Aaru.Core/PluginBase.cs
@@ -112,15 +112,13 @@ public sealed class PluginBase
{
foreach(Type type in pluginRegister.GetAllFilesystemPlugins() ?? Enumerable.Empty())
{
- if(Activator.CreateInstance(type) is IFilesystem plugin &&
- !Filesystems.ContainsKey(plugin.Name.ToLower()))
+ if(Activator.CreateInstance(type) is IFilesystem plugin && !Filesystems.ContainsKey(plugin.Name.ToLower()))
Filesystems.Add(plugin.Name.ToLower(), type);
}
foreach(Type type in pluginRegister.GetAllFilterPlugins() ?? Enumerable.Empty())
{
- if(Activator.CreateInstance(type) is IFilter plugin &&
- !Filters.ContainsKey(plugin.Name.ToLower()))
+ if(Activator.CreateInstance(type) is IFilter plugin && !Filters.ContainsKey(plugin.Name.ToLower()))
Filters.Add(plugin.Name.ToLower(), type);
}
@@ -133,15 +131,13 @@ public sealed class PluginBase
foreach(Type type in pluginRegister.GetAllMediaImagePlugins() ?? Enumerable.Empty())
{
- if(Activator.CreateInstance(type) is IMediaImage plugin &&
- !MediaImages.ContainsKey(plugin.Name.ToLower()))
+ if(Activator.CreateInstance(type) is IMediaImage plugin && !MediaImages.ContainsKey(plugin.Name.ToLower()))
MediaImages.Add(plugin.Name.ToLower(), type);
}
foreach(Type type in pluginRegister.GetAllPartitionPlugins() ?? Enumerable.Empty())
{
- if(Activator.CreateInstance(type) is IPartition plugin &&
- !Partitions.ContainsKey(plugin.Name.ToLower()))
+ if(Activator.CreateInstance(type) is IPartition plugin && !Partitions.ContainsKey(plugin.Name.ToLower()))
Partitions.Add(plugin.Name.ToLower(), type);
}
@@ -168,8 +164,7 @@ public sealed class PluginBase
foreach(Type type in pluginRegister.GetAllArchivePlugins() ?? Enumerable.Empty())
{
- if(Activator.CreateInstance(type) is IArchive plugin &&
- !Archives.ContainsKey(plugin.Name.ToLower()))
+ if(Activator.CreateInstance(type) is IArchive plugin && !Archives.ContainsKey(plugin.Name.ToLower()))
Archives.Add(plugin.Name.ToLower(), type);
}
diff --git a/Aaru.Core/PrintScsiModePages.cs b/Aaru.Core/PrintScsiModePages.cs
index 7e7a9a152..17e769a12 100644
--- a/Aaru.Core/PrintScsiModePages.cs
+++ b/Aaru.Core/PrintScsiModePages.cs
@@ -59,8 +59,7 @@ public static class PrintScsiModePages
{
case 0x00:
{
- if(devType == PeripheralDeviceTypes.MultiMediaDevice &&
- page.Subpage == 0)
+ if(devType == PeripheralDeviceTypes.MultiMediaDevice && page.Subpage == 0)
AaruConsole.WriteLine(Modes.PrettifyModePage_00_SFF(page.PageResponse));
else
{
diff --git a/Aaru.Core/Remote.cs b/Aaru.Core/Remote.cs
index b5d72f6c8..70f04e688 100644
--- a/Aaru.Core/Remote.cs
+++ b/Aaru.Core/Remote.cs
@@ -79,7 +79,8 @@ public static class Remote
HttpResponseMessage response = httpClient.
PostAsync("/api/uploadreportv2",
new StringContent(json, Encoding.UTF8,
- "application/json")).GetAwaiter().
+ "application/json")).
+ GetAwaiter().
GetResult();
if(!response.IsSuccessStatusCode)
@@ -121,8 +122,7 @@ public static class Remote
mctx.Database.EnsureCreated();
mctx.Database.
- ExecuteSqlRaw(
- "CREATE TABLE IF NOT EXISTS \"__EFMigrationsHistory\" (\"MigrationId\" TEXT PRIMARY KEY, \"ProductVersion\" TEXT)");
+ ExecuteSqlRaw("CREATE TABLE IF NOT EXISTS \"__EFMigrationsHistory\" (\"MigrationId\" TEXT PRIMARY KEY, \"ProductVersion\" TEXT)");
foreach(string migration in mctx.Database.GetPendingMigrations())
{
@@ -198,7 +198,9 @@ public static class Remote
if(create)
{
- AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
+ AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()).
Start(ctx =>
{
@@ -214,7 +216,9 @@ public static class Remote
AaruConsole.WriteLine(Localization.Core.Added_0_usb_vendors, sync.UsbVendors.Count);
- AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
+ AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()).
Start(ctx =>
{
@@ -232,7 +236,9 @@ public static class Remote
AaruConsole.WriteLine(Localization.Core.Added_0_usb_products, sync.UsbProducts.Count);
- AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
+ AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()).
Start(ctx =>
{
@@ -252,7 +258,9 @@ public static class Remote
AaruConsole.WriteLine(Localization.Core.Added_0_CompactDisc_read_offsets, sync.Offsets.Count);
- AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
+ AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()).
Start(ctx =>
{
@@ -273,7 +281,9 @@ public static class Remote
AaruConsole.WriteLine(Localization.Core.Added_0_known_devices, sync.Devices.Count);
- AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
+ AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()).
Start(ctx =>
{
@@ -321,7 +331,9 @@ public static class Remote
long modifiedDevices = 0;
long modifiedNesHeaders = 0;
- AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
+ AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()).
Start(ctx =>
{
@@ -352,7 +364,9 @@ public static class Remote
AaruConsole.WriteLine(Localization.Core.Added_0_usb_vendors, addedVendors);
AaruConsole.WriteLine(Localization.Core.Modified_0_USB_vendors, modifiedVendors);
- AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
+ AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()).
Start(ctx =>
{
@@ -387,7 +401,9 @@ public static class Remote
AaruConsole.WriteLine(Localization.Core.Added_0_usb_products, addedProducts);
AaruConsole.WriteLine(Localization.Core.Modified_0_USB_products, modifiedProducts);
- AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
+ AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()).
Start(ctx =>
{
@@ -425,7 +441,9 @@ public static class Remote
AaruConsole.WriteLine(Localization.Core.Added_0_CompactDisc_read_offsets, addedOffsets);
AaruConsole.WriteLine(Localization.Core.Modified_0_CompactDisc_read_offsets, modifiedOffsets);
- AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
+ AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()).
Start(ctx =>
{
@@ -469,7 +487,9 @@ public static class Remote
AaruConsole.WriteLine(Localization.Core.Added_0_known_devices, addedDevices);
AaruConsole.WriteLine(Localization.Core.Modified_0_known_devices, modifiedDevices);
- AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
+ AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()).
Start(ctx =>
{
diff --git a/Aaru.Core/Sidecar/AudioMedia.cs b/Aaru.Core/Sidecar/AudioMedia.cs
index 0a37ea915..a8603ba82 100644
--- a/Aaru.Core/Sidecar/AudioMedia.cs
+++ b/Aaru.Core/Sidecar/AudioMedia.cs
@@ -74,8 +74,7 @@ public sealed partial class Sidecar
}
};
- if(image.Info.MediaSequence != 0 &&
- image.Info.LastMediaSequence != 0)
+ if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0)
{
sidecar.AudioMedias[0].Sequence.MediaSequence = (uint)image.Info.MediaSequence;
sidecar.AudioMedias[0].Sequence.TotalMedia = (uint)image.Info.LastMediaSequence;
diff --git a/Aaru.Core/Sidecar/BlockMedia.cs b/Aaru.Core/Sidecar/BlockMedia.cs
index 62d1300ec..d5cb7f500 100644
--- a/Aaru.Core/Sidecar/BlockMedia.cs
+++ b/Aaru.Core/Sidecar/BlockMedia.cs
@@ -90,8 +90,7 @@ public sealed partial class Sidecar
}
};
- if(image.Info.MediaSequence != 0 &&
- image.Info.LastMediaSequence != 0)
+ if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0)
{
sidecar.BlockMedias[0].Sequence.MediaSequence = (uint)image.Info.MediaSequence;
sidecar.BlockMedias[0].Sequence.TotalMedia = (uint)image.Info.LastMediaSequence;
@@ -570,7 +569,7 @@ public sealed partial class Sidecar
List filesInPartition = new();
foreach(CommonTypes.Structs.TapeFile tapeFile in
- tapeImage.Files.Where(f => f.Partition == tapePartition.Number))
+ tapeImage.Files.Where(f => f.Partition == tapePartition.Number))
{
var thisFile = new TapeFile
{
@@ -827,8 +826,7 @@ public sealed partial class Sidecar
UpdateStatus(Localization.Core.Saving_metadata);
- if(image.Info.Cylinders > 0 &&
- image.Info is { Heads: > 0, SectorsPerTrack: > 0 })
+ if(image.Info.Cylinders > 0 && image.Info is { Heads: > 0, SectorsPerTrack: > 0 })
{
sidecar.BlockMedias[0].Cylinders = image.Info.Cylinders;
sidecar.BlockMedias[0].Heads = (ushort)image.Info.Heads;
@@ -1005,8 +1003,7 @@ public sealed partial class Sidecar
var scpFilter = new ZZZNoFilter();
scpFilter.Open(scpFilePath);
- if(image.Info.Heads <= 2 &&
- scpImage.Identify(scpFilter))
+ if(image.Info.Heads <= 2 && scpImage.Identify(scpFilter))
{
try
{
@@ -1053,8 +1050,10 @@ public sealed partial class Sidecar
if(scpImage.ScpTracks.TryGetValue(t, out SuperCardPro.TrackHeader scpTrack))
{
var trackContents =
- new byte[scpTrack.Entries.Last().dataOffset + scpTrack.Entries.Last().trackLength -
- scpImage.Header.offsets[t] + 1];
+ new byte[scpTrack.Entries.Last().dataOffset +
+ scpTrack.Entries.Last().trackLength -
+ scpImage.Header.offsets[t] +
+ 1];
scpStream.Position = scpImage.Header.offsets[t];
scpStream.EnsureRead(trackContents, 0, trackContents.Length);
@@ -1066,14 +1065,14 @@ public sealed partial class Sidecar
}
sidecar.BlockMedias[0].Track = scpBlockTrackTypes.OrderBy(t => t.Cylinder).
- ThenBy(t => t.Head).ToList();
+ ThenBy(t => t.Head).
+ ToList();
}
else
{
AaruConsole.
- ErrorWriteLine(
- Localization.Core.SCP_image_do_not_same_number_tracks_0_disk_image_1_ignoring,
- scpImage.Header.end + 1, image.Info.Cylinders);
+ ErrorWriteLine(Localization.Core.SCP_image_do_not_same_number_tracks_0_disk_image_1_ignoring,
+ scpImage.Header.end + 1, image.Info.Cylinders);
}
}
else
@@ -1121,8 +1120,7 @@ public sealed partial class Sidecar
var kfFilter = new ZZZNoFilter();
kfFilter.Open(kfFile);
- if(image.Info.Heads <= 2 &&
- kfImage.Identify(kfFilter))
+ if(image.Info.Heads <= 2 && kfImage.Identify(kfFilter))
{
try
{
@@ -1180,22 +1178,21 @@ public sealed partial class Sidecar
}
sidecar.BlockMedias[0].Track = kfBlockTrackTypes.OrderBy(t => t.Cylinder).
- ThenBy(t => t.Head).ToList();
+ ThenBy(t => t.Head).
+ ToList();
}
else
{
AaruConsole.
- ErrorWriteLine(
- Localization.Core.KryoFlux_image_do_not_same_number_tracks_0_disk_image_1_ignoring,
- kfImage.Info.Cylinders, image.Info.Cylinders);
+ ErrorWriteLine(Localization.Core.KryoFlux_image_do_not_same_number_tracks_0_disk_image_1_ignoring,
+ kfImage.Info.Cylinders, image.Info.Cylinders);
}
}
else
{
AaruConsole.
- ErrorWriteLine(
- Localization.Core.KryoFlux_image_do_not_same_number_heads_0_disk_image_1_ignoring,
- kfImage.Info.Heads, image.Info.Heads);
+ ErrorWriteLine(Localization.Core.KryoFlux_image_do_not_same_number_heads_0_disk_image_1_ignoring,
+ kfImage.Info.Heads, image.Info.Heads);
}
}
}
diff --git a/Aaru.Core/Sidecar/Files.cs b/Aaru.Core/Sidecar/Files.cs
index 40a786546..afb1d0aaa 100644
--- a/Aaru.Core/Sidecar/Files.cs
+++ b/Aaru.Core/Sidecar/Files.cs
@@ -55,8 +55,7 @@ public sealed partial class Sidecar
List directories = new();
List files = new();
- while(filesystem.ReadDir(node, out string dirent) == ErrorNumber.NoError &&
- dirent is not null)
+ while(filesystem.ReadDir(node, out string dirent) == ErrorNumber.NoError && dirent is not null)
{
ret = filesystem.Stat(dirent, out FileEntryInfo stat);
@@ -115,8 +114,7 @@ public sealed partial class Sidecar
List directories = new();
List files = new();
- while(filesystem.ReadDir(node, out string dirent) == ErrorNumber.NoError &&
- dirent is not null)
+ while(filesystem.ReadDir(node, out string dirent) == ErrorNumber.NoError && dirent is not null)
{
ret = filesystem.Stat(path + "/" + filename + "/" + dirent, out FileEntryInfo entryStat);
diff --git a/Aaru.Core/Sidecar/OpticalDisc.cs b/Aaru.Core/Sidecar/OpticalDisc.cs
index 273151f1d..2dabf6a04 100644
--- a/Aaru.Core/Sidecar/OpticalDisc.cs
+++ b/Aaru.Core/Sidecar/OpticalDisc.cs
@@ -86,8 +86,7 @@ public sealed partial class Sidecar
}
};
- if(image.Info.MediaSequence != 0 &&
- image.Info.LastMediaSequence != 0)
+ if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0)
{
sidecar.OpticalDiscs[0].Sequence.MediaSequence = (uint)image.Info.MediaSequence;
sidecar.OpticalDiscs[0].Sequence.TotalMedia = (uint)image.Info.LastMediaSequence;
@@ -183,16 +182,13 @@ public sealed partial class Sidecar
_ => dskType
};
- if(dskType == MediaType.DVDR &&
- pfi.Value.PartVersion >= 6)
+ if(dskType == MediaType.DVDR && pfi.Value.PartVersion >= 6)
dskType = MediaType.DVDRDL;
- if(dskType == MediaType.DVDRW &&
- pfi.Value.PartVersion >= 15)
+ if(dskType == MediaType.DVDRW && pfi.Value.PartVersion >= 15)
dskType = MediaType.DVDRWDL;
- if(dskType == MediaType.GOD &&
- pfi.Value.DiscSize == DVDSize.OneTwenty)
+ if(dskType == MediaType.GOD && pfi.Value.DiscSize == DVDSize.OneTwenty)
dskType = MediaType.WOD;
sidecar.OpticalDiscs[0].Dimensions = new Dimensions();
@@ -246,8 +242,7 @@ public sealed partial class Sidecar
trksLst = new List();
}
- if(sidecar.OpticalDiscs[0].Dimensions == null &&
- image.Info.MediaType != MediaType.Unknown)
+ if(sidecar.OpticalDiscs[0].Dimensions == null && image.Info.MediaType != MediaType.Unknown)
sidecar.OpticalDiscs[0].Dimensions = Dimensions.FromMediaType(image.Info.MediaType);
if(_aborted)
@@ -299,8 +294,7 @@ public sealed partial class Sidecar
xmlTrk.StartSector = trk.StartSector;
xmlTrk.EndSector = trk.EndSector;
- if(trk.Indexes?.TryGetValue(0, out int idx0) == true &&
- idx0 >= 0)
+ if(trk.Indexes?.TryGetValue(0, out int idx0) == true && idx0 >= 0)
xmlTrk.StartSector = (ulong)idx0;
switch(sidecar.OpticalDiscs[0].DiscType)
@@ -513,8 +507,7 @@ public sealed partial class Sidecar
// For fast debugging, skip checksum
//skipChecksum:
- var trkPartitions =
- partitions.Where(p => p.Start >= trk.StartSector && p.End <= trk.EndSector).ToList();
+ var trkPartitions = partitions.Where(p => p.Start >= trk.StartSector && p.End <= trk.EndSector).ToList();
xmlTrk.FileSystemInformation = new List();
@@ -663,11 +656,13 @@ public sealed partial class Sidecar
if(trk.Indexes?.Count > 0)
{
- xmlTrk.Indexes = trk.Indexes?.OrderBy(i => i.Key).Select(i => new TrackIndex
- {
- Index = i.Key,
- Value = i.Value
- }).ToList();
+ xmlTrk.Indexes = trk.Indexes?.OrderBy(i => i.Key).
+ Select(i => new TrackIndex
+ {
+ Index = i.Key,
+ Value = i.Value
+ }).
+ ToList();
}
trksLst.Add(xmlTrk);
@@ -679,10 +674,10 @@ public sealed partial class Sidecar
sidecar.OpticalDiscs[0].Track = trksLst;
// All XGD3 all have the same number of blocks
- if(dskType == MediaType.XGD2 &&
- sidecar.OpticalDiscs[0].Track.Count == 1)
+ if(dskType == MediaType.XGD2 && sidecar.OpticalDiscs[0].Track.Count == 1)
{
- ulong blocks = sidecar.OpticalDiscs[0].Track[0].EndSector - sidecar.OpticalDiscs[0].Track[0].StartSector +
+ ulong blocks = sidecar.OpticalDiscs[0].Track[0].EndSector -
+ sidecar.OpticalDiscs[0].Track[0].StartSector +
1;
if(blocks is 25063 or 4229664 or 4246304) // Wxripper unlock
diff --git a/Aaru.Core/Spectre.cs b/Aaru.Core/Spectre.cs
index 2a6306ec2..66b1903a8 100644
--- a/Aaru.Core/Spectre.cs
+++ b/Aaru.Core/Spectre.cs
@@ -8,6 +8,9 @@ public static class Spectre
{
/// Initializes a progress bar with a single spinner
/// Action to execute in the progress bar
- public static void ProgressSingleSpinner(Action action) => AnsiConsole.Progress().AutoClear(true).
- HideCompleted(true).Columns(new TaskDescriptionColumn(), new SpinnerColumn()).Start(action);
+ public static void ProgressSingleSpinner(Action action) => AnsiConsole.Progress().
+ AutoClear(true).
+ HideCompleted(true).
+ Columns(new TaskDescriptionColumn(), new SpinnerColumn()).
+ Start(action);
}
\ No newline at end of file
diff --git a/Aaru.Core/Statistics.cs b/Aaru.Core/Statistics.cs
index 1f9130573..a14eac227 100644
--- a/Aaru.Core/Statistics.cs
+++ b/Aaru.Core/Statistics.cs
@@ -160,7 +160,8 @@ public static class Statistics
{
dto.Filesystems = new List();
- foreach(string nvs in ctx.Filesystems.Where(c => !c.Synchronized).Select(c => c.Name).
+ foreach(string nvs in ctx.Filesystems.Where(c => !c.Synchronized).
+ Select(c => c.Name).
Distinct())
{
dto.Filesystems.Add(new NameValueStats
@@ -189,7 +190,8 @@ public static class Statistics
{
dto.MediaFormats = new List();
- foreach(string nvs in ctx.MediaFormats.Where(c => !c.Synchronized).Select(c => c.Name).
+ foreach(string nvs in ctx.MediaFormats.Where(c => !c.Synchronized).
+ Select(c => c.Name).
Distinct())
{
dto.MediaFormats.Add(new NameValueStats
@@ -277,19 +279,22 @@ public static class Statistics
{
dto.OperatingSystems = new List();
- foreach(string osName in ctx.OperatingSystems.Where(c => !c.Synchronized).Select(c => c.Name).
+ foreach(string osName in ctx.OperatingSystems.Where(c => !c.Synchronized).
+ Select(c => c.Name).
Distinct())
{
foreach(string osVersion in ctx.OperatingSystems.
Where(c => !c.Synchronized && c.Name == osName).
- Select(c => c.Version).Distinct())
+ Select(c => c.Version).
+ Distinct())
{
dto.OperatingSystems.Add(new OsStats
{
name = osName,
version = osVersion,
- Value = ctx.OperatingSystems.LongCount(c => !c.Synchronized && c.Name == osName &&
- c.Version == osVersion)
+ Value = ctx.OperatingSystems.LongCount(c => !c.Synchronized &&
+ c.Name == osName &&
+ c.Version == osVersion)
});
}
}
@@ -300,12 +305,14 @@ public static class Statistics
dto.RemoteApplications = new List();
foreach(string remoteAppName in ctx.RemoteApplications.Where(c => !c.Synchronized).
- Select(c => c.Name).Distinct())
+ Select(c => c.Name).
+ Distinct())
{
foreach(string remoteAppVersion in ctx.RemoteApplications.
Where(c => !c.Synchronized &&
c.Name == remoteAppName).
- Select(c => c.Version).Distinct())
+ Select(c => c.Version).
+ Distinct())
{
dto.RemoteApplications.Add(new OsStats
{
@@ -323,7 +330,8 @@ public static class Statistics
{
dto.RemoteArchitectures = new List();
- foreach(string nvs in ctx.RemoteArchitectures.Where(c => !c.Synchronized).Select(c => c.Name).
+ foreach(string nvs in ctx.RemoteArchitectures.Where(c => !c.Synchronized).
+ Select(c => c.Name).
Distinct())
{
dto.RemoteArchitectures.Add(new NameValueStats
@@ -339,18 +347,21 @@ public static class Statistics
dto.RemoteOperatingSystems = new List();
foreach(string remoteOsName in ctx.RemoteOperatingSystems.Where(c => !c.Synchronized).
- Select(c => c.Name).Distinct())
+ Select(c => c.Name).
+ Distinct())
{
foreach(string remoteOsVersion in ctx.RemoteOperatingSystems.
Where(c => !c.Synchronized && c.Name == remoteOsName).
- Select(c => c.Version).Distinct())
+ Select(c => c.Version).
+ Distinct())
{
dto.RemoteOperatingSystems.Add(new OsStats
{
- name = remoteOsName,
+ name = remoteOsName,
version = remoteOsVersion,
Value = ctx.RemoteOperatingSystems.LongCount(c => !c.Synchronized &&
- c.Name == remoteOsName && c.Version == remoteOsVersion)
+ c.Name == remoteOsName &&
+ c.Version == remoteOsVersion)
});
}
}
@@ -410,11 +421,13 @@ public static class Statistics
if(ctx.Filesystems.Any(c => !c.Synchronized))
{
- foreach(string nvs in ctx.Filesystems.Where(c => !c.Synchronized).Select(c => c.Name).
+ foreach(string nvs in ctx.Filesystems.Where(c => !c.Synchronized).
+ Select(c => c.Name).
Distinct())
{
Filesystem existing =
- ctx.Filesystems.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ?? new Filesystem
+ ctx.Filesystems.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ??
+ new Filesystem
{
Name = nvs,
Synchronized = true
@@ -447,11 +460,13 @@ public static class Statistics
if(ctx.MediaFormats.Any(c => !c.Synchronized))
{
- foreach(string nvs in ctx.MediaFormats.Where(c => !c.Synchronized).Select(c => c.Name).
+ foreach(string nvs in ctx.MediaFormats.Where(c => !c.Synchronized).
+ Select(c => c.Name).
Distinct())
{
MediaFormat existing =
- ctx.MediaFormats.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ?? new MediaFormat
+ ctx.MediaFormats.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ??
+ new MediaFormat
{
Name = nvs,
Synchronized = true
@@ -469,12 +484,12 @@ public static class Statistics
{
foreach(string nvs in ctx.Partitions.Where(c => !c.Synchronized).Select(c => c.Name).Distinct())
{
- Partition existing =
- ctx.Partitions.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ?? new Partition
- {
- Name = nvs,
- Synchronized = true
- };
+ Partition existing = ctx.Partitions.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ??
+ new Partition
+ {
+ Name = nvs,
+ Synchronized = true
+ };
existing.Count += (ulong)ctx.Partitions.LongCount(c => !c.Synchronized && c.Name == nvs);
@@ -520,7 +535,8 @@ public static class Statistics
ctx.Medias.Update(existing);
- ctx.Medias.RemoveRange(ctx.Medias.Where(c => !c.Synchronized && c.Type == media &&
+ ctx.Medias.RemoveRange(ctx.Medias.Where(c => !c.Synchronized &&
+ c.Type == media &&
c.Real));
}
@@ -542,7 +558,8 @@ public static class Statistics
ctx.Medias.Update(existing);
- ctx.Medias.RemoveRange(ctx.Medias.Where(c => !c.Synchronized && c.Type == media &&
+ ctx.Medias.RemoveRange(ctx.Medias.Where(c => !c.Synchronized &&
+ c.Type == media &&
!c.Real));
}
}
@@ -559,16 +576,19 @@ public static class Statistics
if(ctx.OperatingSystems.Any(c => !c.Synchronized))
{
- foreach(string osName in ctx.OperatingSystems.Where(c => !c.Synchronized).Select(c => c.Name).
+ foreach(string osName in ctx.OperatingSystems.Where(c => !c.Synchronized).
+ Select(c => c.Name).
Distinct())
{
foreach(string osVersion in ctx.OperatingSystems.
Where(c => !c.Synchronized && c.Name == osName).
- Select(c => c.Version).Distinct())
+ Select(c => c.Version).
+ Distinct())
{
OperatingSystem existing =
- ctx.OperatingSystems.FirstOrDefault(c => c.Synchronized && c.Name == osName &&
- c.Version == osVersion) ??
+ ctx.OperatingSystems.FirstOrDefault(c => c.Synchronized &&
+ c.Name == osName &&
+ c.Version == osVersion) ??
new OperatingSystem
{
Synchronized = true,
@@ -577,14 +597,15 @@ public static class Statistics
};
existing.Count +=
- (ulong)ctx.OperatingSystems.LongCount(c => !c.Synchronized && c.Name == osName &&
- c.Version == osVersion);
+ (ulong)ctx.OperatingSystems.LongCount(c => !c.Synchronized &&
+ c.Name == osName &&
+ c.Version == osVersion);
ctx.OperatingSystems.Update(existing);
ctx.OperatingSystems.RemoveRange(ctx.OperatingSystems.Where(c => !c.Synchronized &&
- c.Name == osName &&
- c.Version == osVersion));
+ c.Name == osName &&
+ c.Version == osVersion));
}
}
}
@@ -592,12 +613,14 @@ public static class Statistics
if(ctx.RemoteApplications.Any(c => !c.Synchronized))
{
foreach(string remoteAppName in ctx.RemoteApplications.Where(c => !c.Synchronized).
- Select(c => c.Name).Distinct())
+ Select(c => c.Name).
+ Distinct())
{
foreach(string remoteAppVersion in ctx.RemoteApplications.
Where(c => !c.Synchronized &&
c.Name == remoteAppName).
- Select(c => c.Version).Distinct())
+ Select(c => c.Version).
+ Distinct())
{
RemoteApplication existing =
ctx.RemoteApplications.FirstOrDefault(c => c.Synchronized &&
@@ -618,15 +641,16 @@ public static class Statistics
ctx.RemoteApplications.Update(existing);
ctx.RemoteApplications.RemoveRange(ctx.RemoteApplications.Where(c => !c.Synchronized &&
- c.Name == remoteAppName &&
- c.Version == remoteAppVersion));
+ c.Name == remoteAppName &&
+ c.Version == remoteAppVersion));
}
}
}
if(ctx.RemoteArchitectures.Any(c => !c.Synchronized))
{
- foreach(string nvs in ctx.RemoteArchitectures.Where(c => !c.Synchronized).Select(c => c.Name).
+ foreach(string nvs in ctx.RemoteArchitectures.Where(c => !c.Synchronized).
+ Select(c => c.Name).
Distinct())
{
RemoteArchitecture existing =
@@ -643,16 +667,18 @@ public static class Statistics
ctx.RemoteArchitectures.Update(existing);
ctx.RemoteArchitectures.RemoveRange(ctx.RemoteArchitectures.Where(c => !c.Synchronized &&
- c.Name == nvs));
+ c.Name == nvs));
}
}
foreach(string remoteOsName in ctx.RemoteOperatingSystems.Where(c => !c.Synchronized).
- Select(c => c.Name).Distinct())
+ Select(c => c.Name).
+ Distinct())
{
foreach(string remoteOsVersion in ctx.RemoteOperatingSystems.
Where(c => !c.Synchronized && c.Name == remoteOsName).
- Select(c => c.Version).Distinct())
+ Select(c => c.Version).
+ Distinct())
{
RemoteOperatingSystem existing =
ctx.RemoteOperatingSystems.FirstOrDefault(c => c.Synchronized &&
@@ -673,9 +699,9 @@ public static class Statistics
ctx.RemoteOperatingSystems.Update(existing);
ctx.RemoteOperatingSystems.RemoveRange(ctx.RemoteOperatingSystems.Where(c =>
- !c.Synchronized &&
- c.Name == remoteOsName &&
- c.Version == remoteOsVersion));
+ !c.Synchronized &&
+ c.Name == remoteOsName &&
+ c.Version == remoteOsVersion));
}
}
@@ -876,8 +902,10 @@ public static class Statistics
using var ctx = AaruContext.Create(Settings.Settings.LocalDbPath);
- if(ctx.SeenDevices.Any(d => d.Manufacturer == dev.Manufacturer && d.Model == dev.Model &&
- d.Revision == dev.FirmwareRevision && d.Bus == deviceBus))
+ if(ctx.SeenDevices.Any(d => d.Manufacturer == dev.Manufacturer &&
+ d.Model == dev.Model &&
+ d.Revision == dev.FirmwareRevision &&
+ d.Bus == deviceBus))
return;
ctx.SeenDevices.Add(new DeviceStat
diff --git a/Aaru.Database/Context.cs b/Aaru.Database/Context.cs
index 393291509..7e5562fcd 100644
--- a/Aaru.Database/Context.cs
+++ b/Aaru.Database/Context.cs
@@ -120,136 +120,208 @@ public sealed class AaruContext : DbContext
base.OnModelCreating(modelBuilder);
modelBuilder.Entity("Aaru.CommonTypes.Metadata.Ata",
- b => b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", "ReadCapabilities").WithMany().
- HasForeignKey("ReadCapabilitiesId").OnDelete(DeleteBehavior.SetNull));
+ b => b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", "ReadCapabilities").
+ WithMany().
+ HasForeignKey("ReadCapabilitiesId").
+ OnDelete(DeleteBehavior.SetNull));
modelBuilder.Entity("Aaru.CommonTypes.Metadata.BlockDescriptor",
- b => b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", null).WithMany("BlockDescriptors").
- HasForeignKey("ScsiModeId").OnDelete(DeleteBehavior.Cascade));
+ b => b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", null).
+ WithMany("BlockDescriptors").
+ HasForeignKey("ScsiModeId").
+ OnDelete(DeleteBehavior.Cascade));
modelBuilder.Entity("Aaru.CommonTypes.Metadata.DensityCode",
- b => b.HasOne("Aaru.CommonTypes.Metadata.SscSupportedMedia", null).WithMany("DensityCodes").
- HasForeignKey("SscSupportedMediaId").OnDelete(DeleteBehavior.Cascade));
+ b => b.HasOne("Aaru.CommonTypes.Metadata.SscSupportedMedia", null).
+ WithMany("DensityCodes").
+ HasForeignKey("SscSupportedMediaId").
+ OnDelete(DeleteBehavior.Cascade));
modelBuilder.Entity("Aaru.CommonTypes.Metadata.Mmc",
- b => b.HasOne("Aaru.CommonTypes.Metadata.MmcFeatures", "Features").WithMany().
- HasForeignKey("FeaturesId").OnDelete(DeleteBehavior.SetNull));
+ b => b.HasOne("Aaru.CommonTypes.Metadata.MmcFeatures", "Features").
+ WithMany().
+ HasForeignKey("FeaturesId").
+ OnDelete(DeleteBehavior.SetNull));
modelBuilder.Entity("Aaru.CommonTypes.Metadata.Scsi", b =>
{
- b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", "ModeSense").WithMany().HasForeignKey("ModeSenseId").
+ b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", "ModeSense").
+ WithMany().
+ HasForeignKey("ModeSenseId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Mmc", "MultiMediaDevice").WithMany().
- HasForeignKey("MultiMediaDeviceId").OnDelete(DeleteBehavior.SetNull);
+ b.HasOne("Aaru.CommonTypes.Metadata.Mmc", "MultiMediaDevice").
+ WithMany().
+ HasForeignKey("MultiMediaDeviceId").
+ OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", "ReadCapabilities").WithMany().
- HasForeignKey("ReadCapabilitiesId").OnDelete(DeleteBehavior.SetNull);
+ b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", "ReadCapabilities").
+ WithMany().
+ HasForeignKey("ReadCapabilitiesId").
+ OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Ssc", "SequentialDevice").WithMany().
- HasForeignKey("SequentialDeviceId").OnDelete(DeleteBehavior.SetNull);
+ b.HasOne("Aaru.CommonTypes.Metadata.Ssc", "SequentialDevice").
+ WithMany().
+ HasForeignKey("SequentialDeviceId").
+ OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Aaru.CommonTypes.Metadata.ScsiPage", b =>
{
- b.HasOne("Aaru.CommonTypes.Metadata.Scsi", null).WithMany("EVPDPages").HasForeignKey("ScsiId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Scsi", null).
+ WithMany("EVPDPages").
+ HasForeignKey("ScsiId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", null).WithMany("ModePages").HasForeignKey("ScsiModeId").
+ b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", null).
+ WithMany("ModePages").
+ HasForeignKey("ScsiModeId").
OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Aaru.CommonTypes.Metadata.SscSupportedMedia", b =>
{
- b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null).WithMany("SupportedMediaTypes").HasForeignKey("SscId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null).
+ WithMany("SupportedMediaTypes").
+ HasForeignKey("SscId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.TestedSequentialMedia", null).WithMany("SupportedMediaTypes").
- HasForeignKey("TestedSequentialMediaId").OnDelete(DeleteBehavior.SetNull);
+ b.HasOne("Aaru.CommonTypes.Metadata.TestedSequentialMedia", null).
+ WithMany("SupportedMediaTypes").
+ HasForeignKey("TestedSequentialMediaId").
+ OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Aaru.CommonTypes.Metadata.SupportedDensity", b =>
{
- b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null).WithMany("SupportedDensities").HasForeignKey("SscId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null).
+ WithMany("SupportedDensities").
+ HasForeignKey("SscId").
OnDelete(DeleteBehavior.Cascade);
- b.HasOne("Aaru.CommonTypes.Metadata.TestedSequentialMedia", null).WithMany("SupportedDensities").
- HasForeignKey("TestedSequentialMediaId").OnDelete(DeleteBehavior.Cascade);
+ b.HasOne("Aaru.CommonTypes.Metadata.TestedSequentialMedia", null).
+ WithMany("SupportedDensities").
+ HasForeignKey("TestedSequentialMediaId").
+ OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedMedia", b =>
{
- b.HasOne("Aaru.CommonTypes.Metadata.Ata", null).WithMany("RemovableMedias").HasForeignKey("AtaId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Ata", null).
+ WithMany("RemovableMedias").
+ HasForeignKey("AtaId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Chs", "CHS").WithMany().HasForeignKey("CHSId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Chs", "CHS").
+ WithMany().
+ HasForeignKey("CHSId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Chs", "CurrentCHS").WithMany().HasForeignKey("CurrentCHSId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Chs", "CurrentCHS").
+ WithMany().
+ HasForeignKey("CurrentCHSId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Mmc", null).WithMany("TestedMedia").HasForeignKey("MmcId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Mmc", null).
+ WithMany("TestedMedia").
+ HasForeignKey("MmcId").
OnDelete(DeleteBehavior.Cascade);
- b.HasOne("Aaru.CommonTypes.Metadata.Scsi", null).WithMany("RemovableMedias").HasForeignKey("ScsiId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Scsi", null).
+ WithMany("RemovableMedias").
+ HasForeignKey("ScsiId").
OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedSequentialMedia",
- b => b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null).WithMany("TestedMedia").
- HasForeignKey("SscId").OnDelete(DeleteBehavior.SetNull));
+ b => b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null).
+ WithMany("TestedMedia").
+ HasForeignKey("SscId").
+ OnDelete(DeleteBehavior.SetNull));
modelBuilder.Entity("Aaru.Database.Models.Device", b =>
{
- b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATA").WithMany().HasForeignKey("ATAId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATA").
+ WithMany().
+ HasForeignKey("ATAId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATAPI").WithMany().HasForeignKey("ATAPIId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATAPI").
+ WithMany().
+ HasForeignKey("ATAPIId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.FireWire", "FireWire").WithMany().HasForeignKey("FireWireId").
+ b.HasOne("Aaru.CommonTypes.Metadata.FireWire", "FireWire").
+ WithMany().
+ HasForeignKey("FireWireId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "MultiMediaCard").WithMany().HasForeignKey("MultiMediaCardId").
+ b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "MultiMediaCard").
+ WithMany().
+ HasForeignKey("MultiMediaCardId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Pcmcia", "PCMCIA").WithMany().HasForeignKey("PCMCIAId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Pcmcia", "PCMCIA").
+ WithMany().
+ HasForeignKey("PCMCIAId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Scsi", "SCSI").WithMany().HasForeignKey("SCSIId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Scsi", "SCSI").
+ WithMany().
+ HasForeignKey("SCSIId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "SecureDigital").WithMany().HasForeignKey("SecureDigitalId").
+ b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "SecureDigital").
+ WithMany().
+ HasForeignKey("SecureDigitalId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Usb", "USB").WithMany().HasForeignKey("USBId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Usb", "USB").
+ WithMany().
+ HasForeignKey("USBId").
OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Aaru.Database.Models.Report", b =>
{
- b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATA").WithMany().HasForeignKey("ATAId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATA").
+ WithMany().
+ HasForeignKey("ATAId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATAPI").WithMany().HasForeignKey("ATAPIId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATAPI").
+ WithMany().
+ HasForeignKey("ATAPIId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.FireWire", "FireWire").WithMany().HasForeignKey("FireWireId").
+ b.HasOne("Aaru.CommonTypes.Metadata.FireWire", "FireWire").
+ WithMany().
+ HasForeignKey("FireWireId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "MultiMediaCard").WithMany().HasForeignKey("MultiMediaCardId").
+ b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "MultiMediaCard").
+ WithMany().
+ HasForeignKey("MultiMediaCardId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Pcmcia", "PCMCIA").WithMany().HasForeignKey("PCMCIAId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Pcmcia", "PCMCIA").
+ WithMany().
+ HasForeignKey("PCMCIAId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Scsi", "SCSI").WithMany().HasForeignKey("SCSIId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Scsi", "SCSI").
+ WithMany().
+ HasForeignKey("SCSIId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "SecureDigital").WithMany().HasForeignKey("SecureDigitalId").
+ b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "SecureDigital").
+ WithMany().
+ HasForeignKey("SecureDigitalId").
OnDelete(DeleteBehavior.SetNull);
- b.HasOne("Aaru.CommonTypes.Metadata.Usb", "USB").WithMany().HasForeignKey("USBId").
+ b.HasOne("Aaru.CommonTypes.Metadata.Usb", "USB").
+ WithMany().
+ HasForeignKey("USBId").
OnDelete(DeleteBehavior.SetNull);
});
diff --git a/Aaru.Decoders b/Aaru.Decoders
index d3efb5822..acbc11af9 160000
--- a/Aaru.Decoders
+++ b/Aaru.Decoders
@@ -1 +1 @@
-Subproject commit d3efb58222c5e73047663d0142511e657a1c743d
+Subproject commit acbc11af95f09d28f277650cad868dea5d8c8050
diff --git a/Aaru.Decryption b/Aaru.Decryption
index 9f529da3c..7786e94ee 160000
--- a/Aaru.Decryption
+++ b/Aaru.Decryption
@@ -1 +1 @@
-Subproject commit 9f529da3c6527de8363b55e21f99cd504c2f2e1b
+Subproject commit 7786e94ee52c8f65802f1fc071db994ab1b88c60
diff --git a/Aaru.Devices/Device/AtaCommands/Ata48.cs b/Aaru.Devices/Device/AtaCommands/Ata48.cs
index 1e88c78b7..8abdd2c58 100644
--- a/Aaru.Devices/Device/AtaCommands/Ata48.cs
+++ b/Aaru.Devices/Device/AtaCommands/Ata48.cs
@@ -63,12 +63,14 @@ public partial class Device
if((statusRegisters.Status & 0x23) == 0)
{
- lba = (ulong)((statusRegisters.LbaHighCurrent << 16) + (statusRegisters.LbaMidCurrent << 8) +
+ lba = (ulong)((statusRegisters.LbaHighCurrent << 16) +
+ (statusRegisters.LbaMidCurrent << 8) +
statusRegisters.LbaLowCurrent);
lba <<= 24;
- lba += (ulong)((statusRegisters.LbaHighPrevious << 16) + (statusRegisters.LbaMidPrevious << 8) +
+ lba += (ulong)((statusRegisters.LbaHighPrevious << 16) +
+ (statusRegisters.LbaMidPrevious << 8) +
statusRegisters.LbaLowPrevious);
}
@@ -246,12 +248,14 @@ public partial class Device
if((statusRegisters.Status & 0x23) == 0)
{
- lba = (ulong)((statusRegisters.LbaHighCurrent << 16) + (statusRegisters.LbaMidCurrent << 8) +
+ lba = (ulong)((statusRegisters.LbaHighCurrent << 16) +
+ (statusRegisters.LbaMidCurrent << 8) +
statusRegisters.LbaLowCurrent);
lba <<= 24;
- lba += (ulong)((statusRegisters.LbaHighPrevious << 16) + (statusRegisters.LbaMidPrevious << 8) +
+ lba += (ulong)((statusRegisters.LbaHighPrevious << 16) +
+ (statusRegisters.LbaMidPrevious << 8) +
statusRegisters.LbaLowPrevious);
}
diff --git a/Aaru.Devices/Device/Constructor.cs b/Aaru.Devices/Device/Constructor.cs
index 793ac3524..66fd3d855 100644
--- a/Aaru.Devices/Device/Constructor.cs
+++ b/Aaru.Devices/Device/Constructor.cs
@@ -225,8 +225,7 @@ public partial class Device
Features.SeparatedFeatures features = Features.Separate(featureBuffer);
- if(features.Descriptors?.Length != 1 ||
- features.Descriptors[0].Code != 0x0108)
+ if(features.Descriptors?.Length != 1 || features.Descriptors[0].Code != 0x0108)
return dev;
Feature_0108? serialFeature = Features.Decode_0108(features.Descriptors[0].Data);
diff --git a/Aaru.Devices/Device/List.cs b/Aaru.Devices/Device/List.cs
index d32c1f677..4d1d531f6 100644
--- a/Aaru.Devices/Device/List.cs
+++ b/Aaru.Devices/Device/List.cs
@@ -116,8 +116,7 @@ public partial class Device
{
var aaruUri = new Uri(aaruRemote);
- if(aaruUri.Scheme != "aaru" &&
- aaruUri.Scheme != "dic")
+ if(aaruUri.Scheme != "aaru" && aaruUri.Scheme != "dic")
{
AaruConsole.ErrorWriteLine(Localization.Invalid_remote_URI);
diff --git a/Aaru.Devices/Device/ScsiCommands/Kreon.cs b/Aaru.Devices/Device/ScsiCommands/Kreon.cs
index 50a540a75..5aa5a12ee 100644
--- a/Aaru.Devices/Device/ScsiCommands/Kreon.cs
+++ b/Aaru.Devices/Device/ScsiCommands/Kreon.cs
@@ -144,10 +144,7 @@ public partial class Device
if(sense)
return true;
- if(buffer[0] != 0xA5 ||
- buffer[1] != 0x5A ||
- buffer[2] != 0x5A ||
- buffer[3] != 0xA5)
+ if(buffer[0] != 0xA5 || buffer[1] != 0x5A || buffer[2] != 0x5A || buffer[3] != 0xA5)
return true;
for(var i = 4; i < 26; i += 2)
diff --git a/Aaru.Devices/Device/ScsiCommands/MMC.cs b/Aaru.Devices/Device/ScsiCommands/MMC.cs
index d7ee4c9ed..f7d2c0717 100644
--- a/Aaru.Devices/Device/ScsiCommands/MMC.cs
+++ b/Aaru.Devices/Device/ScsiCommands/MMC.cs
@@ -683,11 +683,10 @@ public partial class Device
Error = LastError != 0;
AaruConsole.DebugWriteLine(SCSI_MODULE_NAME,
- Localization.READ_READ_SUB_CHANNEL_MCN_Sense_1_Last_Error_2_took_0_ms,
- duration, sense, LastError);
+ Localization.READ_READ_SUB_CHANNEL_MCN_Sense_1_Last_Error_2_took_0_ms, duration,
+ sense, LastError);
- if(!sense &&
- (buffer[8] & 0x80) == 0x80)
+ if(!sense && (buffer[8] & 0x80) == 0x80)
mcn = Encoding.ASCII.GetString(buffer, 9, 13);
return sense;
@@ -729,8 +728,7 @@ public partial class Device
READ_READ_SUB_CHANNEL_ISRC_Track_Number_1_Sense_2_Last_Error_3_took_0_ms,
duration, trackNumber, sense, LastError);
- if(!sense &&
- (buffer[8] & 0x80) == 0x80)
+ if(!sense && (buffer[8] & 0x80) == 0x80)
isrc = Encoding.ASCII.GetString(buffer, 9, 12);
return sense;
diff --git a/Aaru.Devices/Device/ScsiCommands/Optical.cs b/Aaru.Devices/Device/ScsiCommands/Optical.cs
index 81a7ea09f..c023e1754 100644
--- a/Aaru.Devices/Device/ScsiCommands/Optical.cs
+++ b/Aaru.Devices/Device/ScsiCommands/Optical.cs
@@ -90,8 +90,7 @@ public partial class Device
cdb[4] = (byte)((lba & 0xFF00) >> 8);
cdb[5] = (byte)(lba & 0xFF);
- if(requested > 0 ||
- scanLength > 1)
+ if(requested > 0 || scanLength > 1)
{
buffer = new byte[8];
buffer[0] = (byte)((requested & 0xFF000000) >> 24);
diff --git a/Aaru.Devices/Device/ScsiCommands/SPC.cs b/Aaru.Devices/Device/ScsiCommands/SPC.cs
index 008fbc016..f7ea7bdb4 100644
--- a/Aaru.Devices/Device/ScsiCommands/SPC.cs
+++ b/Aaru.Devices/Device/ScsiCommands/SPC.cs
@@ -74,7 +74,10 @@ public partial class Device
buffer = new byte[36];
senseBuffer = new byte[64];
- byte[] cdb = { (byte)ScsiCommands.Inquiry, 0, 0, 0, 36, 0 };
+ byte[] cdb =
+ {
+ (byte)ScsiCommands.Inquiry, 0, 0, 0, 36, 0
+ };
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
out bool sense);
@@ -86,7 +89,10 @@ public partial class Device
var pagesLength = (byte)(buffer[4] + 5);
- cdb = new byte[] { (byte)ScsiCommands.Inquiry, 0, 0, 0, pagesLength, 0 };
+ cdb = new byte[]
+ {
+ (byte)ScsiCommands.Inquiry, 0, 0, 0, pagesLength, 0
+ };
buffer = new byte[pagesLength];
senseBuffer = new byte[64];
@@ -145,7 +151,10 @@ public partial class Device
buffer = new byte[36];
senseBuffer = new byte[64];
- byte[] cdb = { (byte)ScsiCommands.Inquiry, 1, page, 0, 36, 0 };
+ byte[] cdb =
+ {
+ (byte)ScsiCommands.Inquiry, 1, page, 0, 36, 0
+ };
LastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration,
out bool sense);
@@ -161,7 +170,10 @@ public partial class Device
var pagesLength = (byte)(buffer[3] + 4);
- cdb = new byte[] { (byte)ScsiCommands.Inquiry, 1, page, 0, pagesLength, 0 };
+ cdb = new byte[]
+ {
+ (byte)ScsiCommands.Inquiry, 1, page, 0, pagesLength, 0
+ };
buffer = new byte[pagesLength];
senseBuffer = new byte[64];
@@ -185,7 +197,10 @@ public partial class Device
{
senseBuffer = new byte[64];
- byte[] cdb = { (byte)ScsiCommands.TestUnitReady, 0, 0, 0, 0, 0 };
+ byte[] cdb =
+ {
+ (byte)ScsiCommands.TestUnitReady, 0, 0, 0, 0, 0
+ };
byte[] buffer = Array.Empty();
diff --git a/Aaru.Devices/Device/ScsiCommands/SSC.cs b/Aaru.Devices/Device/ScsiCommands/SSC.cs
index 7456e7bbf..9feb2d709 100644
--- a/Aaru.Devices/Device/ScsiCommands/SSC.cs
+++ b/Aaru.Devices/Device/ScsiCommands/SSC.cs
@@ -376,7 +376,8 @@ public partial class Device
/// Duration.
public bool Read16(out byte[] buffer, out byte[] senseBuffer, ulong objectId, uint blocks, uint blockSize,
uint timeout, out double duration) => Read16(out buffer, out senseBuffer, false, true, 0,
- objectId, blocks, blockSize, timeout, out duration);
+ objectId, blocks, blockSize, timeout,
+ out duration);
/// Reads a number of fixed-length blocks starting at specified block from the specified partition
/// Buffer.
diff --git a/Aaru.Devices/Device/ScsiCommands/SyQuest.cs b/Aaru.Devices/Device/ScsiCommands/SyQuest.cs
index 4b02a55ce..ef2a7ffb4 100644
--- a/Aaru.Devices/Device/ScsiCommands/SyQuest.cs
+++ b/Aaru.Devices/Device/ScsiCommands/SyQuest.cs
@@ -91,8 +91,7 @@ public partial class Device
if(readLong)
cdb[5] += 0x40;
- if(!inhibitDma &&
- !readLong)
+ if(!inhibitDma && !readLong)
buffer = transferLength == 0 ? new byte[256 * blockSize] : new byte[transferLength * blockSize];
else if(readLong)
{
@@ -172,8 +171,7 @@ public partial class Device
if(readLong)
cdb[9] += 0x40;
- if(!inhibitDma &&
- !readLong)
+ if(!inhibitDma && !readLong)
buffer = new byte[transferLength * blockSize];
else if(readLong)
{
diff --git a/Aaru.Devices/Linux/Command.cs b/Aaru.Devices/Linux/Command.cs
index d8bfe71ee..187da79b8 100644
--- a/Aaru.Devices/Linux/Command.cs
+++ b/Aaru.Devices/Linux/Command.cs
@@ -153,8 +153,7 @@ partial class Device
cdb[0] = (byte)ScsiCommands.AtaPassThrough16;
cdb[1] = (byte)((byte)protocol << 1 & 0x1E);
- if(transferRegister != AtaTransferRegister.NoTransfer &&
- protocol != AtaProtocol.NonData)
+ if(transferRegister != AtaTransferRegister.NoTransfer && protocol != AtaProtocol.NonData)
{
switch(protocol)
{
@@ -188,8 +187,7 @@ partial class Device
int error = SendScsiCommand(cdb, ref buffer, out byte[] senseBuffer, timeout,
AtaProtocolToScsiDirection(protocol), out duration, out sense);
- if(senseBuffer.Length < 22 ||
- senseBuffer[8] != 0x09 && senseBuffer[9] != 0x0C)
+ if(senseBuffer.Length < 22 || senseBuffer[8] != 0x09 && senseBuffer[9] != 0x0C)
return error;
errorRegisters.Error = senseBuffer[11];
@@ -226,8 +224,7 @@ partial class Device
cdb[0] = (byte)ScsiCommands.AtaPassThrough16;
cdb[1] = (byte)((byte)protocol << 1 & 0x1E);
- if(transferRegister != AtaTransferRegister.NoTransfer &&
- protocol != AtaProtocol.NonData)
+ if(transferRegister != AtaTransferRegister.NoTransfer && protocol != AtaProtocol.NonData)
{
switch(protocol)
{
@@ -261,8 +258,7 @@ partial class Device
int error = SendScsiCommand(cdb, ref buffer, out byte[] senseBuffer, timeout,
AtaProtocolToScsiDirection(protocol), out duration, out sense);
- if(senseBuffer.Length < 22 ||
- senseBuffer[8] != 0x09 && senseBuffer[9] != 0x0C)
+ if(senseBuffer.Length < 22 || senseBuffer[8] != 0x09 && senseBuffer[9] != 0x0C)
return error;
errorRegisters.Error = senseBuffer[11];
@@ -300,8 +296,7 @@ partial class Device
cdb[1] = (byte)((byte)protocol << 1 & 0x1E);
cdb[1] |= 0x01;
- if(transferRegister != AtaTransferRegister.NoTransfer &&
- protocol != AtaProtocol.NonData)
+ if(transferRegister != AtaTransferRegister.NoTransfer && protocol != AtaProtocol.NonData)
{
switch(protocol)
{
@@ -340,8 +335,7 @@ partial class Device
int error = SendScsiCommand(cdb, ref buffer, out byte[] senseBuffer, timeout,
AtaProtocolToScsiDirection(protocol), out duration, out sense);
- if(senseBuffer.Length < 22 ||
- senseBuffer[8] != 0x09 && senseBuffer[9] != 0x0C)
+ if(senseBuffer.Length < 22 || senseBuffer[8] != 0x09 && senseBuffer[9] != 0x0C)
return error;
errorRegisters.Error = senseBuffer[11];
@@ -612,8 +606,7 @@ partial class Device
int error = Marshal.GetLastWin32Error();
- if(error != 13 &&
- error != 30)
+ if(error != 13 && error != 30)
{
LastError = Marshal.GetLastWin32Error();
Error = true;
diff --git a/Aaru.Devices/Linux/Device.cs b/Aaru.Devices/Linux/Device.cs
index 74e9e78c7..c310209b4 100644
--- a/Aaru.Devices/Linux/Device.cs
+++ b/Aaru.Devices/Linux/Device.cs
@@ -382,8 +382,7 @@ partial class Device : Devices.Device
string possibleDir = Path.Combine(resolvedLink, "pcmcia_socket", subdirs[0]);
- if(!File.Exists(possibleDir + "/card_type") ||
- !File.Exists(possibleDir + "/cis"))
+ if(!File.Exists(possibleDir + "/card_type") || !File.Exists(possibleDir + "/cis"))
continue;
var cisFs = new FileStream(possibleDir + "/cis", FileMode.Open, FileAccess.Read);
diff --git a/Aaru.Devices/Linux/ListDevices.cs b/Aaru.Devices/Linux/ListDevices.cs
index e09fc0046..321b14af0 100644
--- a/Aaru.Devices/Linux/ListDevices.cs
+++ b/Aaru.Devices/Linux/ListDevices.cs
@@ -91,8 +91,7 @@ static class ListDevices
StreamReader sr;
- if(File.Exists(Path.Combine(sysdevs[i], "device/vendor")) &&
- string.IsNullOrEmpty(devices[i].Vendor))
+ if(File.Exists(Path.Combine(sysdevs[i], "device/vendor")) && string.IsNullOrEmpty(devices[i].Vendor))
{
sr = new StreamReader(Path.Combine(sysdevs[i], "device/vendor"), Encoding.ASCII);
devices[i].Vendor = sr.ReadLine()?.Trim();
@@ -109,15 +108,13 @@ static class ListDevices
else if(devices[i].Path.StartsWith("/dev/loop", StringComparison.CurrentCulture))
devices[i].Model = "Linux";
- if(File.Exists(Path.Combine(sysdevs[i], "device/serial")) &&
- string.IsNullOrEmpty(devices[i].Serial))
+ if(File.Exists(Path.Combine(sysdevs[i], "device/serial")) && string.IsNullOrEmpty(devices[i].Serial))
{
sr = new StreamReader(Path.Combine(sysdevs[i], "device/serial"), Encoding.ASCII);
devices[i].Serial = sr.ReadLine()?.Trim();
}
- if(string.IsNullOrEmpty(devices[i].Vendor) ||
- devices[i].Vendor == "ATA")
+ if(string.IsNullOrEmpty(devices[i].Vendor) || devices[i].Vendor == "ATA")
{
if(devices[i].Model != null)
{
diff --git a/Aaru.Devices/Remote/Command.cs b/Aaru.Devices/Remote/Command.cs
index ffc7542bc..3ed3a192e 100644
--- a/Aaru.Devices/Remote/Command.cs
+++ b/Aaru.Devices/Remote/Command.cs
@@ -180,8 +180,7 @@ public partial class Device
ref command.buffer, out command.response, out double cmdDuration,
out bool cmdSense, timeout);
- if(error == 0 &&
- singleError != 0)
+ if(error == 0 && singleError != 0)
error = singleError;
duration += cmdDuration;
diff --git a/Aaru.Devices/Remote/Remote.cs b/Aaru.Devices/Remote/Remote.cs
index 5d35ba6c5..fa74cbaa6 100644
--- a/Aaru.Devices/Remote/Remote.cs
+++ b/Aaru.Devices/Remote/Remote.cs
@@ -62,8 +62,7 @@ public class Remote : IDisposable
/// Network error.
public Remote(Uri uri)
{
- if(uri.Scheme != "aaru" &&
- uri.Scheme != "dic")
+ if(uri.Scheme != "aaru" && uri.Scheme != "dic")
throw new ArgumentException(Localization.Invalid_remote_protocol, nameof(uri.Scheme));
_host = uri.DnsSafeHost;
@@ -102,8 +101,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -253,8 +251,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -347,8 +344,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -360,9 +356,8 @@ public class Remote : IDisposable
if(hdr.packetType != AaruPacketType.Nop)
{
AaruConsole.
- ErrorWriteLine(
- Localization.Remote_ListDevices_Expected_List_Devices_Response_Packet_got_packet_type_0,
- hdr.packetType);
+ ErrorWriteLine(Localization.Remote_ListDevices_Expected_List_Devices_Response_Packet_got_packet_type_0,
+ hdr.packetType);
return Array.Empty();
}
@@ -470,8 +465,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
lastError = -1;
@@ -590,8 +584,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -700,8 +693,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -809,8 +801,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -919,8 +910,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -1035,8 +1025,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -1117,8 +1106,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -1197,8 +1185,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -1327,8 +1314,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -1421,8 +1407,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -1504,8 +1489,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -1635,17 +1619,17 @@ public class Remote : IDisposable
int off = tmp.Length;
foreach(AaruCmdSdhci cmd in commands.Select(command => new AaruCmdSdhci
- {
- application = command.isApplication,
- argument = command.argument,
- block_size = command.blockSize,
- blocks = command.blocks,
- buf_len = (uint)(command.buffer?.Length ?? 0),
- command = command.command,
- flags = command.flags,
- timeout = timeout,
- write = command.write
- }))
+ {
+ application = command.isApplication,
+ argument = command.argument,
+ block_size = command.blockSize,
+ blocks = command.blocks,
+ buf_len = (uint)(command.buffer?.Length ?? 0),
+ command = command.command,
+ flags = command.flags,
+ timeout = timeout,
+ write = command.write
+ }))
{
tmp = Marshal.StructureToByteArrayLittleEndian(cmd);
Array.Copy(tmp, 0, buf, off, tmp.Length);
@@ -1654,7 +1638,7 @@ public class Remote : IDisposable
}
foreach(Devices.Device.MmcSingleCommand command in
- commands.Where(command => (command.buffer?.Length ?? 0) != 0))
+ commands.Where(command => (command.buffer?.Length ?? 0) != 0))
{
Array.Copy(command.buffer, 0, buf, off, command.buffer.Length);
@@ -1683,8 +1667,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -1731,8 +1714,7 @@ public class Remote : IDisposable
command.response = cmdRes.response;
duration += cmdRes.duration;
- if(cmdRes.error_no != 0 &&
- error == 0)
+ if(cmdRes.error_no != 0 && error == 0)
error = (int)cmdRes.error_no;
if(cmdRes.sense != 0)
@@ -1827,8 +1809,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
@@ -1931,8 +1912,7 @@ public class Remote : IDisposable
AaruPacketHeader hdr = Marshal.ByteArrayToStructureLittleEndian(hdrBuf);
- if(hdr.remote_id != Consts.REMOTE_ID ||
- hdr.packet_id != Consts.PACKET_ID)
+ if(hdr.remote_id != Consts.REMOTE_ID || hdr.packet_id != Consts.PACKET_ID)
{
AaruConsole.ErrorWriteLine(Localization.Received_data_is_not_an_Aaru_Remote_Packet);
diff --git a/Aaru.Devices/Windows/Command.cs b/Aaru.Devices/Windows/Command.cs
index 033f1950b..381778121 100644
--- a/Aaru.Devices/Windows/Command.cs
+++ b/Aaru.Devices/Windows/Command.cs
@@ -525,35 +525,28 @@ partial class Device
commandDescriptor.responseType = 0;
- if(flags.HasFlag(MmcFlags.ResponseR1) ||
- flags.HasFlag(MmcFlags.ResponseSpiR1))
+ if(flags.HasFlag(MmcFlags.ResponseR1) || flags.HasFlag(MmcFlags.ResponseSpiR1))
commandDescriptor.responseType = SdResponseType.R1;
- if(flags.HasFlag(MmcFlags.ResponseR1B) ||
- flags.HasFlag(MmcFlags.ResponseSpiR1B))
+ if(flags.HasFlag(MmcFlags.ResponseR1B) || flags.HasFlag(MmcFlags.ResponseSpiR1B))
commandDescriptor.responseType = SdResponseType.R1b;
- if(flags.HasFlag(MmcFlags.ResponseR2) ||
- flags.HasFlag(MmcFlags.ResponseSpiR2))
+ if(flags.HasFlag(MmcFlags.ResponseR2) || flags.HasFlag(MmcFlags.ResponseSpiR2))
commandDescriptor.responseType = SdResponseType.R2;
- if(flags.HasFlag(MmcFlags.ResponseR3) ||
- flags.HasFlag(MmcFlags.ResponseSpiR3))
+ if(flags.HasFlag(MmcFlags.ResponseR3) || flags.HasFlag(MmcFlags.ResponseSpiR3))
commandDescriptor.responseType = SdResponseType.R3;
- if(flags.HasFlag(MmcFlags.ResponseR4) ||
- flags.HasFlag(MmcFlags.ResponseSpiR4))
+ if(flags.HasFlag(MmcFlags.ResponseR4) || flags.HasFlag(MmcFlags.ResponseSpiR4))
commandDescriptor.responseType = SdResponseType.R4;
- if(flags.HasFlag(MmcFlags.ResponseR5) ||
- flags.HasFlag(MmcFlags.ResponseSpiR5))
+ if(flags.HasFlag(MmcFlags.ResponseR5) || flags.HasFlag(MmcFlags.ResponseSpiR5))
commandDescriptor.responseType = SdResponseType.R5;
if(flags.HasFlag(MmcFlags.ResponseR6))
commandDescriptor.responseType = SdResponseType.R6;
- var commandB =
- new byte[commandData.size + commandData.protocolArgumentSize + commandData.deviceDataBufferSize];
+ var commandB = new byte[commandData.size + commandData.protocolArgumentSize + commandData.deviceDataBufferSize];
Array.Copy(buffer, 0, commandB, commandData.size + commandData.protocolArgumentSize, buffer.Length);
IntPtr hBuf = Marshal.AllocHGlobal(commandB.Length);
@@ -611,8 +604,7 @@ partial class Device
command.argument, command.blockSize, command.blocks, ref command.buffer,
out command.response, out double cmdDuration, out bool cmdSense, timeout);
- if(error == 0 &&
- singleError != 0)
+ if(error == 0 && singleError != 0)
error = singleError;
duration += cmdDuration;
diff --git a/Aaru.Devices/Windows/Device.cs b/Aaru.Devices/Windows/Device.cs
index 7d01cabb1..990c26a39 100644
--- a/Aaru.Devices/Windows/Device.cs
+++ b/Aaru.Devices/Windows/Device.cs
@@ -112,8 +112,7 @@ partial class Device : Devices.Device
Marshal.Copy(descriptorPtr, descriptorB, 0, 1000);
- if(!hasError &&
- error == 0)
+ if(!hasError && error == 0)
{
var descriptor = new StorageDeviceDescriptor
{
@@ -235,12 +234,9 @@ partial class Device : Devices.Device
sdBuffer = new byte[4];
dev.LastError =
- dev.SendMmcCommand(
- dev._cachedScr != null
- ? (MmcCommands)SecureDigitalCommands.SendOperatingCondition
- : MmcCommands.SendOpCond,
- false, true, MmcFlags.ResponseSpiR3 | MmcFlags.ResponseR3 | MmcFlags.CommandBcr, 0,
- 4, 1, ref sdBuffer, out _, out _, out sense);
+ dev.SendMmcCommand(dev._cachedScr != null ? (MmcCommands)SecureDigitalCommands.SendOperatingCondition : MmcCommands.SendOpCond,
+ false, true, MmcFlags.ResponseSpiR3 | MmcFlags.ResponseR3 | MmcFlags.CommandBcr, 0,
+ 4, 1, ref sdBuffer, out _, out _, out sense);
if(!sense)
{
@@ -292,10 +288,10 @@ partial class Device : Devices.Device
// I have to search for USB disks, floppies and CD-ROMs as separate device types
foreach(string devGuid in new[]
- {
- Usb.GUID_DEVINTERFACE_FLOPPY, Usb.GUID_DEVINTERFACE_CDROM, Usb.GUID_DEVINTERFACE_DISK,
- Usb.GUID_DEVINTERFACE_TAPE
- })
+ {
+ Usb.GUID_DEVINTERFACE_FLOPPY, Usb.GUID_DEVINTERFACE_CDROM, Usb.GUID_DEVINTERFACE_DISK,
+ Usb.GUID_DEVINTERFACE_TAPE
+ })
{
usbDevice = Usb.FindDrivePath(devicePath, devGuid);
diff --git a/Aaru.Devices/Windows/ListDevices.cs b/Aaru.Devices/Windows/ListDevices.cs
index 9516d2d7d..ad5f59eb6 100644
--- a/Aaru.Devices/Windows/ListDevices.cs
+++ b/Aaru.Devices/Windows/ListDevices.cs
@@ -104,8 +104,7 @@ static class ListDevices
string physId = devId;
// TODO: This can be done better
- if(devId.Length == 2 &&
- devId[1] == ':')
+ if(devId.Length == 2 && devId[1] == ':')
physId = "\\\\?\\" + devId;
SafeFileHandle fd = Extern.CreateFile(physId, 0, FileShare.Read | FileShare.Write, IntPtr.Zero,
@@ -182,8 +181,7 @@ static class ListDevices
info.Serial = HexStringToString(info.Serial).Trim();
}
- if(string.IsNullOrEmpty(info.Vendor) ||
- info.Vendor == "ATA")
+ if(string.IsNullOrEmpty(info.Vendor) || info.Vendor == "ATA")
{
string[] pieces = info.Model?.Split(' ');
diff --git a/Aaru.Dto b/Aaru.Dto
index 3e28fad2a..6c69fe747 160000
--- a/Aaru.Dto
+++ b/Aaru.Dto
@@ -1 +1 @@
-Subproject commit 3e28fad2a6d32fab3a38fdc444cbe214b6e8c809
+Subproject commit 6c69fe747a99ce4b023cdd0922a26820a6751660
diff --git a/Aaru.Filesystems/AODOS/Info.cs b/Aaru.Filesystems/AODOS/Info.cs
index 3ff68299c..a6baa4037 100644
--- a/Aaru.Filesystems/AODOS/Info.cs
+++ b/Aaru.Filesystems/AODOS/Info.cs
@@ -60,8 +60,7 @@ public sealed partial class AODOS
return false;
// Does AO-DOS support any other kind of disk?
- if(imagePlugin.Info.Sectors != 800 &&
- imagePlugin.Info.Sectors != 1600)
+ if(imagePlugin.Info.Sectors != 800 && imagePlugin.Info.Sectors != 1600)
return false;
ErrorNumber errno = imagePlugin.ReadSector(0, out byte[] sector);
diff --git a/Aaru.Filesystems/APFS/Info.cs b/Aaru.Filesystems/APFS/Info.cs
index d78255af2..7f9e6156c 100644
--- a/Aaru.Filesystems/APFS/Info.cs
+++ b/Aaru.Filesystems/APFS/Info.cs
@@ -103,7 +103,8 @@ public sealed partial class APFS
sbInformation.AppendFormat(Localization._0_bytes_per_block, nxSb.blockSize).AppendLine();
sbInformation.AppendFormat(Localization.Container_has_0_bytes_in_1_blocks,
- nxSb.containerBlocks * nxSb.blockSize, nxSb.containerBlocks).AppendLine();
+ nxSb.containerBlocks * nxSb.blockSize, nxSb.containerBlocks).
+ AppendLine();
information = sbInformation.ToString();
diff --git a/Aaru.Filesystems/Acorn/Info.cs b/Aaru.Filesystems/Acorn/Info.cs
index 23830fbb8..3ed120a19 100644
--- a/Aaru.Filesystems/Acorn/Info.cs
+++ b/Aaru.Filesystems/Acorn/Info.cs
@@ -82,9 +82,7 @@ public sealed partial class AcornADFS
AaruConsole.DebugWriteLine(MODULE_NAME, "oldChk0 = {0}", oldChk0);
// According to documentation map1 MUST start on sector 1. On ADFS-D it starts at 0x100, not on sector 1 (0x400)
- if(oldMap0.checksum == oldChk0 &&
- oldMap1.checksum != oldChk1 &&
- sector.Length >= 512)
+ if(oldMap0.checksum == oldChk0 && oldMap1.checksum != oldChk1 && sector.Length >= 512)
{
errno = imagePlugin.ReadSector(0, out sector);
@@ -215,8 +213,7 @@ public sealed partial class AcornADFS
AaruConsole.DebugWriteLine(MODULE_NAME, "bootChk = {0}", bootChk);
AaruConsole.DebugWriteLine(MODULE_NAME, "bBlock.checksum = {0}", bootSector[0x1FF]);
- if(newChk == sector[0] &&
- newChk != 0)
+ if(newChk == sector[0] && newChk != 0)
{
NewMap nmap = Marshal.ByteArrayToStructureLittleEndian(sector);
drSb = nmap.discRecord;
@@ -240,8 +237,7 @@ public sealed partial class AcornADFS
if(drSb.log2secsize is < 8 or > 10)
return false;
- if(drSb.idlen < drSb.log2secsize + 3 ||
- drSb.idlen > 19)
+ if(drSb.idlen < drSb.log2secsize + 3 || drSb.idlen > 19)
return false;
if(drSb.disc_size_high >> drSb.log2secsize != 0)
@@ -295,9 +291,7 @@ public sealed partial class AcornADFS
OldMapSector1 oldMap1 = Marshal.ByteArrayToStructureLittleEndian(sector);
// According to documentation map1 MUST start on sector 1. On ADFS-D it starts at 0x100, not on sector 1 (0x400)
- if(oldMap0.checksum == oldChk0 &&
- oldMap1.checksum != oldChk1 &&
- sector.Length >= 512)
+ if(oldMap0.checksum == oldChk0 && oldMap1.checksum != oldChk1 && sector.Length >= 512)
{
errno = imagePlugin.ReadSector(0, out sector);
@@ -355,8 +349,7 @@ public sealed partial class AcornADFS
OldDirectory oldRoot = Marshal.ByteArrayToStructureLittleEndian(sector);
- if(oldRoot.header.magic == OLD_DIR_MAGIC &&
- oldRoot.tail.magic == OLD_DIR_MAGIC)
+ if(oldRoot.header.magic == OLD_DIR_MAGIC && oldRoot.tail.magic == OLD_DIR_MAGIC)
namebytes = oldRoot.tail.name;
else
{
@@ -384,8 +377,7 @@ public sealed partial class AcornADFS
oldRoot = Marshal.ByteArrayToStructureLittleEndian(sector);
- if(oldRoot.header.magic == OLD_DIR_MAGIC &&
- oldRoot.tail.magic == OLD_DIR_MAGIC)
+ if(oldRoot.header.magic == OLD_DIR_MAGIC && oldRoot.tail.magic == OLD_DIR_MAGIC)
namebytes = oldRoot.tail.name;
else
{
@@ -406,8 +398,7 @@ public sealed partial class AcornADFS
NewDirectory newRoot = Marshal.ByteArrayToStructureLittleEndian(sector);
- if(newRoot.header.magic == NEW_DIR_MAGIC &&
- newRoot.tail.magic == NEW_DIR_MAGIC)
+ if(newRoot.header.magic == NEW_DIR_MAGIC && newRoot.tail.magic == NEW_DIR_MAGIC)
namebytes = newRoot.tail.title;
}
}
@@ -467,8 +458,7 @@ public sealed partial class AcornADFS
AaruConsole.DebugWriteLine(MODULE_NAME, "bootChk = {0}", bootChk);
AaruConsole.DebugWriteLine(MODULE_NAME, "bBlock.checksum = {0}", bootSector[0x1FF]);
- if(newChk == sector[0] &&
- newChk != 0)
+ if(newChk == sector[0] && newChk != 0)
{
NewMap nmap = Marshal.ByteArrayToStructureLittleEndian(sector);
drSb = nmap.discRecord;
@@ -509,8 +499,7 @@ public sealed partial class AcornADFS
if(drSb.log2secsize is < 8 or > 10)
return;
- if(drSb.idlen < drSb.log2secsize + 3 ||
- drSb.idlen > 19)
+ if(drSb.idlen < drSb.log2secsize + 3 || drSb.idlen > 19)
return;
if(drSb.disc_size_high >> drSb.log2secsize != 0)
diff --git a/Aaru.Filesystems/AmigaDOS/Info.cs b/Aaru.Filesystems/AmigaDOS/Info.cs
index e7fafc46d..24f72ae77 100644
--- a/Aaru.Filesystems/AmigaDOS/Info.cs
+++ b/Aaru.Filesystems/AmigaDOS/Info.cs
@@ -80,8 +80,7 @@ public sealed partial class AmigaDOSPlugin
}
// Not FFS or MuFS?
- if((bblk.diskType & FFS_MASK) != FFS_MASK &&
- (bblk.diskType & MUFS_MASK) != MUFS_MASK)
+ if((bblk.diskType & FFS_MASK) != FFS_MASK && (bblk.diskType & MUFS_MASK) != MUFS_MASK)
return false;
// Clear checksum on sector
@@ -158,8 +157,7 @@ public sealed partial class AmigaDOSPlugin
rblk.sec_type = BigEndianBitConverter.ToUInt32(sector, sector.Length - 4);
AaruConsole.DebugWriteLine(MODULE_NAME, "rblk.sec_type = {0}", rblk.sec_type);
- if(rblk.sec_type == SUBTYPE_ROOT &&
- rblk.checksum == rsum)
+ if(rblk.sec_type == SUBTYPE_ROOT && rblk.checksum == rsum)
return true;
}
@@ -256,8 +254,7 @@ public sealed partial class AmigaDOSPlugin
rootBlk.sec_type = BigEndianBitConverter.ToUInt32(rootBlockSector, rootBlockSector.Length - 4);
AaruConsole.DebugWriteLine(MODULE_NAME, "rootBlk.sec_type = {0}", rootBlk.sec_type);
- if(rootBlk.sec_type != SUBTYPE_ROOT ||
- rootBlk.checksum != rsum)
+ if(rootBlk.sec_type != SUBTYPE_ROOT || rootBlk.checksum != rsum)
continue;
errno = imagePlugin.ReadSectors(rootPtr, sectorsPerBlock, out rootBlockSector);
@@ -339,15 +336,13 @@ public sealed partial class AmigaDOSPlugin
if(rootBlk.bitmapFlag == 0xFFFFFFFF)
sbInformation.AppendLine(Localization.Volume_bitmap_is_valid);
- if(rootBlk.bitmapExtensionBlock != 0x00000000 &&
- rootBlk.bitmapExtensionBlock != 0xFFFFFFFF)
+ if(rootBlk.bitmapExtensionBlock != 0x00000000 && rootBlk.bitmapExtensionBlock != 0xFFFFFFFF)
{
sbInformation.AppendFormat(Localization.Bitmap_extension_at_block_0, rootBlk.bitmapExtensionBlock).
AppendLine();
}
- if((bootBlk.diskType & 0xFF) == 4 ||
- (bootBlk.diskType & 0xFF) == 5)
+ if((bootBlk.diskType & 0xFF) == 4 || (bootBlk.diskType & 0xFF) == 5)
sbInformation.AppendFormat(Localization.Directory_cache_starts_at_block_0, rootBlk.extension).AppendLine();
ulong blocks = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / blockSize;
diff --git a/Aaru.Filesystems/AppleCommon/Info.cs b/Aaru.Filesystems/AppleCommon/Info.cs
index 86bc77d68..6440c08f4 100644
--- a/Aaru.Filesystems/AppleCommon/Info.cs
+++ b/Aaru.Filesystems/AppleCommon/Info.cs
@@ -37,8 +37,7 @@ static partial class AppleCommon
{
internal static string GetBootBlockInformation(byte[] bbSector, Encoding encoding)
{
- if(bbSector is null ||
- bbSector.Length < 0x100)
+ if(bbSector is null || bbSector.Length < 0x100)
return null;
BootBlock bb = Marshal.ByteArrayToStructureBigEndian(bbSector);
@@ -60,9 +59,9 @@ static partial class AppleCommon
if((bb.bbVersion & 0x2000) > 0)
{
sb.
- AppendFormat(
- Localization.System_heap_will_be_extended_by_0_bytes_and_a_1_fraction_of_the_available_RAM,
- bb.bbSysHeapExtra, bb.bbSysHeapFract).AppendLine();
+ AppendFormat(Localization.System_heap_will_be_extended_by_0_bytes_and_a_1_fraction_of_the_available_RAM,
+ bb.bbSysHeapExtra, bb.bbSysHeapFract).
+ AppendLine();
}
}
}
@@ -94,10 +93,12 @@ static partial class AppleCommon
AppendLine();
sb.AppendFormat(Localization.Startup_screen_filename_0,
- StringHandlers.PascalToString(bb.bbScreenName, encoding)).AppendLine();
+ StringHandlers.PascalToString(bb.bbScreenName, encoding)).
+ AppendLine();
sb.AppendFormat(Localization.First_program_to_execute_at_boot_0,
- StringHandlers.PascalToString(bb.bbHelloName, encoding)).AppendLine();
+ StringHandlers.PascalToString(bb.bbHelloName, encoding)).
+ AppendLine();
sb.AppendFormat(Localization.Clipboard_filename_0, StringHandlers.PascalToString(bb.bbScrapName, encoding)).
AppendLine();
diff --git a/Aaru.Filesystems/AppleDOS/AppleDOS.cs b/Aaru.Filesystems/AppleDOS/AppleDOS.cs
index 7dd2e2020..988d961b3 100644
--- a/Aaru.Filesystems/AppleDOS/AppleDOS.cs
+++ b/Aaru.Filesystems/AppleDOS/AppleDOS.cs
@@ -78,7 +78,9 @@ public sealed partial class AppleDOS : IReadOnlyFilesystem
static Dictionary GetDefaultOptions() => new()
{
- { "debug", false.ToString() }
+ {
+ "debug", false.ToString()
+ }
};
#region Caches
diff --git a/Aaru.Filesystems/AppleDOS/Dir.cs b/Aaru.Filesystems/AppleDOS/Dir.cs
index 4e14da449..e0080f7fa 100644
--- a/Aaru.Filesystems/AppleDOS/Dir.cs
+++ b/Aaru.Filesystems/AppleDOS/Dir.cs
@@ -60,8 +60,7 @@ public sealed partial class AppleDOS
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(!string.IsNullOrEmpty(path) &&
- string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
+ if(!string.IsNullOrEmpty(path) && string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
return ErrorNumber.NotSupported;
var contents = _catalogCache.Keys.ToList();
@@ -130,8 +129,7 @@ public sealed partial class AppleDOS
_fileTypeCache = new Dictionary();
_lockedFiles = new List();
- if(lba == 0 ||
- lba > _device.Info.Sectors)
+ if(lba == 0 || lba > _device.Info.Sectors)
return ErrorNumber.InvalidArgument;
while(lba != 0)
@@ -167,8 +165,7 @@ public sealed partial class AppleDOS
_catalogCache.TryAdd(filename, ts);
_fileTypeCache.TryAdd(filename, (byte)(entry.typeAndFlags & 0x7F));
- if((entry.typeAndFlags & 0x80) == 0x80 &&
- !_lockedFiles.Contains(filename))
+ if((entry.typeAndFlags & 0x80) == 0x80 && !_lockedFiles.Contains(filename))
_lockedFiles.Add(filename);
}
diff --git a/Aaru.Filesystems/AppleDOS/File.cs b/Aaru.Filesystems/AppleDOS/File.cs
index 9ea012c73..6b9629ac2 100644
--- a/Aaru.Filesystems/AppleDOS/File.cs
+++ b/Aaru.Filesystems/AppleDOS/File.cs
@@ -50,7 +50,10 @@ public sealed partial class AppleDOS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -66,9 +69,10 @@ public sealed partial class AppleDOS
if(_lockedFiles.Contains(filename))
attributes |= FileAttributes.ReadOnly;
- if(_debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0))
+ if(_debug &&
+ (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0))
attributes |= FileAttributes.System;
return ErrorNumber.NoError;
@@ -81,7 +85,10 @@ public sealed partial class AppleDOS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -92,9 +99,10 @@ public sealed partial class AppleDOS
if(filename.Length > 30)
return ErrorNumber.NameTooLong;
- if(_debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0))
+ if(_debug &&
+ (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0))
{
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0)
file = _catalogBlocks;
@@ -150,8 +158,7 @@ public sealed partial class AppleDOS
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(buffer is null ||
- buffer.Length < length)
+ if(buffer is null || buffer.Length < length)
return ErrorNumber.InvalidArgument;
if(node is not AppleDosFileNode mynode)
@@ -177,7 +184,10 @@ public sealed partial class AppleDOS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -195,9 +205,10 @@ public sealed partial class AppleDOS
_fileSizeCache.TryGetValue(filename, out int fileSize);
GetAttributes(path, out FileAttributes attrs);
- if(_debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0))
+ if(_debug &&
+ (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0))
{
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0)
stat.Length = _catalogBlocks.Length;
@@ -225,7 +236,10 @@ public sealed partial class AppleDOS
ErrorNumber CacheFile(string path)
{
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
diff --git a/Aaru.Filesystems/AppleDOS/Info.cs b/Aaru.Filesystems/AppleDOS/Info.cs
index abb828388..3a48592ca 100644
--- a/Aaru.Filesystems/AppleDOS/Info.cs
+++ b/Aaru.Filesystems/AppleDOS/Info.cs
@@ -42,12 +42,10 @@ public sealed partial class AppleDOS
///
public bool Identify(IMediaImage imagePlugin, Partition partition)
{
- if(imagePlugin.Info.Sectors != 455 &&
- imagePlugin.Info.Sectors != 560)
+ if(imagePlugin.Info.Sectors != 455 && imagePlugin.Info.Sectors != 560)
return false;
- if(partition.Start > 0 ||
- imagePlugin.Info.SectorSize != 256)
+ if(partition.Start > 0 || imagePlugin.Info.SectorSize != 256)
return false;
int spt = imagePlugin.Info.Sectors == 455 ? 13 : 16;
@@ -59,8 +57,10 @@ public sealed partial class AppleDOS
_vtoc = Marshal.ByteArrayToStructureLittleEndian(vtocB);
- return _vtoc.catalogSector < spt && _vtoc.maxTrackSectorPairsPerSector <= 122 && _vtoc.sectorsPerTrack == spt &&
- _vtoc.bytesPerSector == 256;
+ return _vtoc.catalogSector < spt &&
+ _vtoc.maxTrackSectorPairsPerSector <= 122 &&
+ _vtoc.sectorsPerTrack == spt &&
+ _vtoc.bytesPerSector == 256;
}
///
diff --git a/Aaru.Filesystems/AppleDOS/Super.cs b/Aaru.Filesystems/AppleDOS/Super.cs
index c4e1637b5..6a5f3c2c4 100644
--- a/Aaru.Filesystems/AppleDOS/Super.cs
+++ b/Aaru.Filesystems/AppleDOS/Super.cs
@@ -51,8 +51,7 @@ public sealed partial class AppleDOS
_start = partition.Start;
_encoding = encoding ?? new Apple2();
- if(_device.Info.Sectors != 455 &&
- _device.Info.Sectors != 560)
+ if(_device.Info.Sectors != 455 && _device.Info.Sectors != 560)
{
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Incorrect_device_size);
diff --git a/Aaru.Filesystems/AppleDOS/Xattr.cs b/Aaru.Filesystems/AppleDOS/Xattr.cs
index 30c86f16f..bd3d7d994 100644
--- a/Aaru.Filesystems/AppleDOS/Xattr.cs
+++ b/Aaru.Filesystems/AppleDOS/Xattr.cs
@@ -48,7 +48,10 @@ public sealed partial class AppleDOS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -60,9 +63,10 @@ public sealed partial class AppleDOS
xattrs = new List();
- if(_debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0)) {}
+ if(_debug &&
+ (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0)) {}
else
{
if(!_catalogCache.ContainsKey(filename))
@@ -83,7 +87,10 @@ public sealed partial class AppleDOS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -93,9 +100,10 @@ public sealed partial class AppleDOS
if(filename.Length > 30)
return ErrorNumber.NameTooLong;
- if(_debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0))
+ if(_debug &&
+ (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0))
return ErrorNumber.NoSuchExtendedAttribute;
if(!_catalogCache.ContainsKey(filename))
@@ -112,8 +120,7 @@ public sealed partial class AppleDOS
return ErrorNumber.NoError;
}
- if(string.Compare(xattr, "com.apple.dos.tracksectorlist", StringComparison.InvariantCulture) != 0 ||
- !_debug)
+ if(string.Compare(xattr, "com.apple.dos.tracksectorlist", StringComparison.InvariantCulture) != 0 || !_debug)
return ErrorNumber.NoSuchExtendedAttribute;
if(!_extentCache.TryGetValue(filename, out byte[] ts))
diff --git a/Aaru.Filesystems/AppleHFS/Info.cs b/Aaru.Filesystems/AppleHFS/Info.cs
index 3abdffbca..9d325443f 100644
--- a/Aaru.Filesystems/AppleHFS/Info.cs
+++ b/Aaru.Filesystems/AppleHFS/Info.cs
@@ -60,8 +60,10 @@ public sealed partial class AppleHFS
if(errno != ErrorNumber.NoError)
return false;
- foreach(int offset in new[] { 0, 0x200, 0x400, 0x600, 0x800, 0xA00 }.Where(
- offset => mdbSector.Length >= offset + 0x7C + 2))
+ foreach(int offset in new[]
+ {
+ 0, 0x200, 0x400, 0x600, 0x800, 0xA00
+ }.Where(offset => mdbSector.Length >= offset + 0x7C + 2))
{
drSigWord = BigEndianBitConverter.ToUInt16(mdbSector, offset);
@@ -120,7 +122,10 @@ public sealed partial class AppleHFS
if(errno != ErrorNumber.NoError)
return;
- foreach(int offset in new[] { 0, 0x200, 0x400, 0x600, 0x800, 0xA00 })
+ foreach(int offset in new[]
+ {
+ 0, 0x200, 0x400, 0x600, 0x800, 0xA00
+ })
{
drSigWord = BigEndianBitConverter.ToUInt16(tmpSector, offset);
@@ -239,8 +244,7 @@ public sealed partial class AppleHFS
sb.AppendFormat(Localization.CNID_of_bootable_Mac_OS_8_or_9_directory_0, mdb.drFndrInfo3).AppendLine();
sb.AppendFormat(Localization.CNID_of_bootable_Mac_OS_X_directory_0, mdb.drFndrInfo5).AppendLine();
- if(mdb.drFndrInfo6 != 0 &&
- mdb.drFndrInfo7 != 0)
+ if(mdb.drFndrInfo6 != 0 && mdb.drFndrInfo7 != 0)
sb.AppendFormat(Localization.Mac_OS_X_Volume_ID_0_1, mdb.drFndrInfo6, mdb.drFndrInfo7).AppendLine();
if(mdb.drEmbedSigWord == AppleCommon.HFSP_MAGIC)
@@ -264,9 +268,7 @@ public sealed partial class AppleHFS
sb.AppendLine();
sb.AppendLine(bootBlockInfo);
}
- else if(mdb.drFndrInfo0 != 0 ||
- mdb.drFndrInfo3 != 0 ||
- mdb.drFndrInfo5 != 0)
+ else if(mdb.drFndrInfo0 != 0 || mdb.drFndrInfo3 != 0 || mdb.drFndrInfo5 != 0)
sb.AppendLine(Localization.Volume_is_bootable);
else
sb.AppendLine(Localization.Volume_is_not_bootable);
@@ -278,8 +280,8 @@ public sealed partial class AppleHFS
if(mdb.drVolBkUp > 0)
metadata.BackupDate = DateHandlers.MacToDateTime(mdb.drVolBkUp);
- metadata.Bootable = bootBlockInfo != null || mdb.drFndrInfo0 != 0 || mdb.drFndrInfo3 != 0 ||
- mdb.drFndrInfo5 != 0;
+ metadata.Bootable =
+ bootBlockInfo != null || mdb.drFndrInfo0 != 0 || mdb.drFndrInfo3 != 0 || mdb.drFndrInfo5 != 0;
metadata.Clusters = mdb.drNmAlBlks;
metadata.ClusterSize = mdb.drAlBlkSiz;
@@ -297,8 +299,7 @@ public sealed partial class AppleHFS
metadata.Type = FS_TYPE;
metadata.VolumeName = StringHandlers.PascalToString(mdb.drVN, encoding);
- if(mdb.drFndrInfo6 != 0 &&
- mdb.drFndrInfo7 != 0)
+ if(mdb.drFndrInfo6 != 0 && mdb.drFndrInfo7 != 0)
metadata.VolumeSerial = $"{mdb.drFndrInfo6:X8}{mdb.drFndrInfo7:X8}";
}
diff --git a/Aaru.Filesystems/AppleHFSPlus/Info.cs b/Aaru.Filesystems/AppleHFSPlus/Info.cs
index 00c901d53..b6788e6cb 100644
--- a/Aaru.Filesystems/AppleHFSPlus/Info.cs
+++ b/Aaru.Filesystems/AppleHFSPlus/Info.cs
@@ -158,8 +158,7 @@ public sealed partial class AppleHFSPlus
vh.signature = BigEndianBitConverter.ToUInt16(vhSector, 0x400);
- if(vh.signature != AppleCommon.HFSP_MAGIC &&
- vh.signature != AppleCommon.HFSX_MAGIC)
+ if(vh.signature != AppleCommon.HFSP_MAGIC && vh.signature != AppleCommon.HFSX_MAGIC)
return;
var sb = new StringBuilder();
@@ -214,7 +213,8 @@ public sealed partial class AppleHFSPlus
sb.AppendLine(Localization.Volume_is_locked_by_software);
sb.AppendFormat(Localization.Implementation_that_last_mounted_the_volume_0,
- Encoding.ASCII.GetString(vh.lastMountedVersion)).AppendLine();
+ Encoding.ASCII.GetString(vh.lastMountedVersion)).
+ AppendLine();
if((vh.attributes & 0x2000) == 0x2000)
sb.AppendFormat(Localization.Journal_starts_at_allocation_block_0, vh.journalInfoBlock).AppendLine();
@@ -262,8 +262,7 @@ public sealed partial class AppleHFSPlus
sb.AppendFormat(Localization.CNID_of_bootable_Mac_OS_8_or_9_directory_0, vh.drFndrInfo3).AppendLine();
sb.AppendFormat(Localization.CNID_of_bootable_Mac_OS_X_directory_0, vh.drFndrInfo5).AppendLine();
- if(vh.drFndrInfo6 != 0 &&
- vh.drFndrInfo7 != 0)
+ if(vh.drFndrInfo6 != 0 && vh.drFndrInfo7 != 0)
sb.AppendFormat(Localization.Mac_OS_X_Volume_ID_0_1, vh.drFndrInfo6, vh.drFndrInfo7).AppendLine();
metadata = new FileSystem();
@@ -292,8 +291,7 @@ public sealed partial class AppleHFSPlus
_ => metadata.Type
};
- if(vh.drFndrInfo6 != 0 &&
- vh.drFndrInfo7 != 0)
+ if(vh.drFndrInfo6 != 0 && vh.drFndrInfo7 != 0)
metadata.VolumeSerial = $"{vh.drFndrInfo6:X8}{vh.drFndrInfo7:X8}";
metadata.SystemIdentifier = Encoding.ASCII.GetString(vh.lastMountedVersion);
diff --git a/Aaru.Filesystems/AppleMFS/AppleMFS.cs b/Aaru.Filesystems/AppleMFS/AppleMFS.cs
index e2a4f9c9a..5ba4a1586 100644
--- a/Aaru.Filesystems/AppleMFS/AppleMFS.cs
+++ b/Aaru.Filesystems/AppleMFS/AppleMFS.cs
@@ -86,6 +86,8 @@ public sealed partial class AppleMFS : IReadOnlyFilesystem
static Dictionary GetDefaultOptions() => new()
{
- { "debug", false.ToString() }
+ {
+ "debug", false.ToString()
+ }
};
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/AppleMFS/Dir.cs b/Aaru.Filesystems/AppleMFS/Dir.cs
index bc97fd382..07d134568 100644
--- a/Aaru.Filesystems/AppleMFS/Dir.cs
+++ b/Aaru.Filesystems/AppleMFS/Dir.cs
@@ -49,8 +49,7 @@ public sealed partial class AppleMFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(!string.IsNullOrEmpty(path) &&
- string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
+ if(!string.IsNullOrEmpty(path) && string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
return ErrorNumber.NotSupported;
var contents = _idToFilename.Select(kvp => kvp.Value).ToList();
@@ -147,7 +146,8 @@ public sealed partial class AppleMFS
entry.flNam = new byte[_directoryBlocks[offset + 50] + 1];
Array.Copy(_directoryBlocks, offset + 50, entry.flNam, 0, entry.flNam.Length);
- string lowerFilename = StringHandlers.PascalToString(entry.flNam, _encoding).ToLowerInvariant().
+ string lowerFilename = StringHandlers.PascalToString(entry.flNam, _encoding).
+ ToLowerInvariant().
Replace('/', ':');
if(entry.flFlags.HasFlag(FileFlags.Used) &&
diff --git a/Aaru.Filesystems/AppleMFS/File.cs b/Aaru.Filesystems/AppleMFS/File.cs
index 0cb5dde49..aa86e47b3 100644
--- a/Aaru.Filesystems/AppleMFS/File.cs
+++ b/Aaru.Filesystems/AppleMFS/File.cs
@@ -50,7 +50,10 @@ public sealed partial class AppleMFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -174,8 +177,7 @@ public sealed partial class AppleMFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(buffer is null ||
- buffer.Length < length)
+ if(buffer is null || buffer.Length < length)
return ErrorNumber.InvalidArgument;
if(node is not AppleMfsFileNode mynode)
@@ -201,7 +203,10 @@ public sealed partial class AppleMFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -225,8 +230,7 @@ public sealed partial class AppleMFS
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0)
{
- stat.Blocks = _directoryBlocks.Length / stat.BlockSize +
- _directoryBlocks.Length % stat.BlockSize;
+ stat.Blocks = _directoryBlocks.Length / stat.BlockSize + _directoryBlocks.Length % stat.BlockSize;
stat.Length = _directoryBlocks.Length;
}
@@ -236,8 +240,7 @@ public sealed partial class AppleMFS
stat.Length = _blockMapBytes.Length;
}
- else if(string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 &&
- _bootBlocks != null)
+ else if(string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 && _bootBlocks != null)
{
stat.Blocks = _bootBlocks.Length / stat.BlockSize + _bootBlocks.Length % stat.BlockSize;
stat.Length = _bootBlocks.Length;
@@ -297,7 +300,10 @@ public sealed partial class AppleMFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -341,14 +347,14 @@ public sealed partial class AppleMFS
{
byte[] sectors;
- ErrorNumber errno =
- tags
- ? _device.
- ReadSectorsTag((ulong)((nextBlock - 2) * _sectorsPerBlock) + _volMdb.drAlBlSt + _partitionStart,
- (uint)_sectorsPerBlock, SectorTagType.AppleSectorTag, out sectors)
- : _device.
- ReadSectors((ulong)((nextBlock - 2) * _sectorsPerBlock) + _volMdb.drAlBlSt + _partitionStart,
- (uint)_sectorsPerBlock, out sectors);
+ ErrorNumber errno = tags
+ ? _device.
+ ReadSectorsTag((ulong)((nextBlock - 2) * _sectorsPerBlock) + _volMdb.drAlBlSt + _partitionStart,
+ (uint)_sectorsPerBlock, SectorTagType.AppleSectorTag,
+ out sectors)
+ : _device.
+ ReadSectors((ulong)((nextBlock - 2) * _sectorsPerBlock) + _volMdb.drAlBlSt + _partitionStart,
+ (uint)_sectorsPerBlock, out sectors);
if(errno != ErrorNumber.NoError)
return errno;
diff --git a/Aaru.Filesystems/AppleMFS/Xattr.cs b/Aaru.Filesystems/AppleMFS/Xattr.cs
index af30a60e6..8a9e5320c 100644
--- a/Aaru.Filesystems/AppleMFS/Xattr.cs
+++ b/Aaru.Filesystems/AppleMFS/Xattr.cs
@@ -51,7 +51,10 @@ public sealed partial class AppleMFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -90,9 +93,7 @@ public sealed partial class AppleMFS
xattrs.Add("com.apple.FinderInfo");
- if(_debug &&
- _device.Info.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag) &&
- entry.flLgLen > 0)
+ if(_debug && _device.Info.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag) && entry.flLgLen > 0)
xattrs.Add("com.apple.macintosh.tags");
xattrs.Sort();
@@ -106,7 +107,10 @@ public sealed partial class AppleMFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
diff --git a/Aaru.Filesystems/AtheOS/Info.cs b/Aaru.Filesystems/AtheOS/Info.cs
index 554b782b2..951634fde 100644
--- a/Aaru.Filesystems/AtheOS/Info.cs
+++ b/Aaru.Filesystems/AtheOS/Info.cs
@@ -110,7 +110,8 @@ public sealed partial class AtheOS
sb.AppendFormat(Localization._0_bytes_per_block, afsSb.block_size).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_volume_1_bytes, afsSb.num_blocks,
- afsSb.num_blocks * afsSb.block_size).AppendLine();
+ afsSb.num_blocks * afsSb.block_size).
+ AppendLine();
sb.AppendFormat(Localization._0_used_blocks_1_bytes, afsSb.used_blocks, afsSb.used_blocks * afsSb.block_size).
AppendLine();
@@ -118,39 +119,41 @@ public sealed partial class AtheOS
sb.AppendFormat(Localization._0_bytes_per_i_node, afsSb.inode_size).AppendLine();
sb.AppendFormat(Localization._0_blocks_per_allocation_group_1_bytes, afsSb.blocks_per_ag,
- afsSb.blocks_per_ag * afsSb.block_size).AppendLine();
+ afsSb.blocks_per_ag * afsSb.block_size).
+ AppendLine();
sb.AppendFormat(Localization._0_allocation_groups_in_volume, afsSb.num_ags).AppendLine();
sb.AppendFormat(Localization.Journal_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
afsSb.log_blocks_start, afsSb.log_blocks_ag, afsSb.log_blocks_len,
- afsSb.log_blocks_len * afsSb.block_size).AppendLine();
+ afsSb.log_blocks_len * afsSb.block_size).
+ AppendLine();
sb.AppendFormat(Localization.Journal_starts_in_byte_0_and_has_1_bytes_in_2_blocks, afsSb.log_start,
- afsSb.log_size, afsSb.log_valid_blocks).AppendLine();
+ afsSb.log_size, afsSb.log_valid_blocks).
+ AppendLine();
sb.
- AppendFormat(
- Localization.
- Root_folder_s_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
- afsSb.root_dir_start, afsSb.root_dir_ag, afsSb.root_dir_len,
- afsSb.root_dir_len * afsSb.block_size).AppendLine();
+ AppendFormat(Localization.Root_folder_s_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
+ afsSb.root_dir_start, afsSb.root_dir_ag, afsSb.root_dir_len,
+ afsSb.root_dir_len * afsSb.block_size).
+ AppendLine();
sb.
- AppendFormat(
- Localization.
- Directory_containing_files_scheduled_for_deletion_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
- afsSb.deleted_start, afsSb.deleted_ag, afsSb.deleted_len,
- afsSb.deleted_len * afsSb.block_size).AppendLine();
+ AppendFormat(Localization.Directory_containing_files_scheduled_for_deletion_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
+ afsSb.deleted_start, afsSb.deleted_ag, afsSb.deleted_len,
+ afsSb.deleted_len * afsSb.block_size).
+ AppendLine();
sb.
- AppendFormat(
- Localization.Indices_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
- afsSb.indices_start, afsSb.indices_ag, afsSb.indices_len,
- afsSb.indices_len * afsSb.block_size).AppendLine();
+ AppendFormat(Localization.Indices_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
+ afsSb.indices_start, afsSb.indices_ag, afsSb.indices_len,
+ afsSb.indices_len * afsSb.block_size).
+ AppendLine();
sb.AppendFormat(Localization._0_blocks_for_bootloader_1_bytes, afsSb.boot_size,
- afsSb.boot_size * afsSb.block_size).AppendLine();
+ afsSb.boot_size * afsSb.block_size).
+ AppendLine();
information = sb.ToString();
diff --git a/Aaru.Filesystems/BFS/Info.cs b/Aaru.Filesystems/BFS/Info.cs
index 4b2ecad9d..1a46b4af0 100644
--- a/Aaru.Filesystems/BFS/Info.cs
+++ b/Aaru.Filesystems/BFS/Info.cs
@@ -59,8 +59,7 @@ public sealed partial class BeFS
var magic = BitConverter.ToUInt32(sbSector, 0x20);
var magicBe = BigEndianBitConverter.ToUInt32(sbSector, 0x20);
- if(magic == BEFS_MAGIC1 ||
- magicBe == BEFS_MAGIC1)
+ if(magic == BEFS_MAGIC1 || magicBe == BEFS_MAGIC1)
return true;
if(sbSector.Length >= 0x400)
@@ -69,8 +68,7 @@ public sealed partial class BeFS
magicBe = BigEndianBitConverter.ToUInt32(sbSector, 0x220);
}
- if(magic == BEFS_MAGIC1 ||
- magicBe == BEFS_MAGIC1)
+ if(magic == BEFS_MAGIC1 || magicBe == BEFS_MAGIC1)
return true;
errno = imagePlugin.ReadSector(1 + partition.Start, out sbSector);
@@ -167,7 +165,8 @@ public sealed partial class BeFS
sb.AppendFormat(Localization.Indices_i_node_size_0_blocks_Should_be_one, besb.indices_len).AppendLine();
sb.AppendFormat(Localization.blockshift_0_1_should_be_2, besb.block_shift, 1 << (int)besb.block_shift,
- besb.block_size).AppendLine();
+ besb.block_size).
+ AppendLine();
}
switch(besb.flags)
@@ -200,28 +199,27 @@ public sealed partial class BeFS
sb.AppendFormat(Localization._0_bytes_per_i_node, besb.inode_size).AppendLine();
sb.AppendFormat(Localization._0_blocks_per_allocation_group_1_bytes, besb.blocks_per_ag,
- besb.blocks_per_ag * besb.block_size).AppendLine();
+ besb.blocks_per_ag * besb.block_size).
+ AppendLine();
sb.AppendFormat(Localization._0_allocation_groups_in_volume, besb.num_ags).AppendLine();
sb.AppendFormat(Localization.Journal_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
besb.log_blocks_start, besb.log_blocks_ag, besb.log_blocks_len,
- besb.log_blocks_len * besb.block_size).AppendLine();
+ besb.log_blocks_len * besb.block_size).
+ AppendLine();
sb.AppendFormat(Localization.Journal_starts_in_byte_0_and_ends_in_byte_1, besb.log_start, besb.log_end).
AppendLine();
sb.
- AppendFormat(
- Localization.
- Root_folder_s_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
- besb.root_dir_start, besb.root_dir_ag, besb.root_dir_len, besb.root_dir_len * besb.block_size).
+ AppendFormat(Localization.Root_folder_s_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
+ besb.root_dir_start, besb.root_dir_ag, besb.root_dir_len, besb.root_dir_len * besb.block_size).
AppendLine();
sb.
- AppendFormat(
- Localization.Indices_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
- besb.indices_start, besb.indices_ag, besb.indices_len, besb.indices_len * besb.block_size).
+ AppendFormat(Localization.Indices_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
+ besb.indices_start, besb.indices_ag, besb.indices_len, besb.indices_len * besb.block_size).
AppendLine();
information = sb.ToString();
diff --git a/Aaru.Filesystems/BTRFS/Info.cs b/Aaru.Filesystems/BTRFS/Info.cs
index 97ccbd8f7..8a0f7b711 100644
--- a/Aaru.Filesystems/BTRFS/Info.cs
+++ b/Aaru.Filesystems/BTRFS/Info.cs
@@ -120,8 +120,7 @@ public sealed partial class BTRFS
AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.stripesize = {0}", btrfsSb.stripesize);
AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.n = {0}", btrfsSb.n);
- AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.chunk_root_generation = {0}",
- btrfsSb.chunk_root_generation);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.chunk_root_generation = {0}", btrfsSb.chunk_root_generation);
AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.compat_flags = 0x{0:X16}", btrfsSb.compat_flags);
AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.compat_ro_flags = 0x{0:X16}", btrfsSb.compat_ro_flags);
@@ -134,21 +133,17 @@ public sealed partial class BTRFS
AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.bytes = {0}", btrfsSb.dev_item.bytes);
AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.used = {0}", btrfsSb.dev_item.used);
- AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.optimal_align = {0}",
- btrfsSb.dev_item.optimal_align);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.optimal_align = {0}", btrfsSb.dev_item.optimal_align);
- AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.optimal_width = {0}",
- btrfsSb.dev_item.optimal_width);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.optimal_width = {0}", btrfsSb.dev_item.optimal_width);
- AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.minimal_size = {0}",
- btrfsSb.dev_item.minimal_size);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.minimal_size = {0}", btrfsSb.dev_item.minimal_size);
AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.type = {0}", btrfsSb.dev_item.type);
AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.generation = {0}", btrfsSb.dev_item.generation);
- AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.start_offset = {0}",
- btrfsSb.dev_item.start_offset);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.start_offset = {0}", btrfsSb.dev_item.start_offset);
AaruConsole.DebugWriteLine(MODULE_NAME, "btrfsSb.dev_item.dev_group = {0}", btrfsSb.dev_item.dev_group);
@@ -169,7 +164,8 @@ public sealed partial class BTRFS
sbInformation.AppendFormat(Localization.Log_tree_starts_at_LBA_0, btrfsSb.log_lba).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes_spanned_in_1_devices, btrfsSb.total_bytes,
- btrfsSb.num_devices).AppendLine();
+ btrfsSb.num_devices).
+ AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes_used, btrfsSb.bytes_used).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_sector, btrfsSb.sectorsize).AppendLine();
diff --git a/Aaru.Filesystems/CBM/Info.cs b/Aaru.Filesystems/CBM/Info.cs
index ade10a172..afd2846bf 100644
--- a/Aaru.Filesystems/CBM/Info.cs
+++ b/Aaru.Filesystems/CBM/Info.cs
@@ -70,8 +70,7 @@ public sealed partial class CBM
Header cbmHdr = Marshal.ByteArrayToStructureLittleEndian(sector);
- if(cbmHdr.diskDosVersion == 0x44 &&
- cbmHdr is { dosVersion: 0x33, diskVersion: 0x44 })
+ if(cbmHdr.diskDosVersion == 0x44 && cbmHdr is { dosVersion: 0x33, diskVersion: 0x44 })
return true;
}
else
@@ -119,18 +118,26 @@ public sealed partial class CBM
Header cbmHdr = Marshal.ByteArrayToStructureLittleEndian(sector);
sbInformation.AppendFormat(Localization.Directory_starts_at_track_0_sector_1, cbmHdr.directoryTrack,
- cbmHdr.directorySector).AppendLine();
+ cbmHdr.directorySector).
+ AppendLine();
- sbInformation.AppendFormat(Localization.Disk_DOS_Version_0,
- Encoding.ASCII.GetString(new[] { cbmHdr.diskDosVersion })).AppendLine();
+ sbInformation.AppendFormat(Localization.Disk_DOS_Version_0, Encoding.ASCII.GetString(new[]
+ {
+ cbmHdr.diskDosVersion
+ })).
+ AppendLine();
- sbInformation.
- AppendFormat(Localization.DOS_Version_0, Encoding.ASCII.GetString(new[] { cbmHdr.dosVersion })).
- AppendLine();
+ sbInformation.AppendFormat(Localization.DOS_Version_0, Encoding.ASCII.GetString(new[]
+ {
+ cbmHdr.dosVersion
+ })).
+ AppendLine();
- sbInformation.
- AppendFormat(Localization.Disk_Version_0, Encoding.ASCII.GetString(new[] { cbmHdr.diskVersion })).
- AppendLine();
+ sbInformation.AppendFormat(Localization.Disk_Version_0, Encoding.ASCII.GetString(new[]
+ {
+ cbmHdr.diskVersion
+ })).
+ AppendLine();
sbInformation.AppendFormat(Localization.Disk_ID_0, cbmHdr.diskId).AppendLine();
@@ -150,14 +157,18 @@ public sealed partial class CBM
BAM cbmBam = Marshal.ByteArrayToStructureLittleEndian(sector);
sbInformation.AppendFormat(Localization.Directory_starts_at_track_0_sector_1, cbmBam.directoryTrack,
- cbmBam.directorySector).AppendLine();
+ cbmBam.directorySector).
+ AppendLine();
sbInformation.AppendFormat(Localization.Disk_DOS_type_0,
- Encoding.ASCII.GetString(BitConverter.GetBytes(cbmBam.dosType))).AppendLine();
+ Encoding.ASCII.GetString(BitConverter.GetBytes(cbmBam.dosType))).
+ AppendLine();
- sbInformation.
- AppendFormat(Localization.DOS_Version_0, Encoding.ASCII.GetString(new[] { cbmBam.dosVersion })).
- AppendLine();
+ sbInformation.AppendFormat(Localization.DOS_Version_0, Encoding.ASCII.GetString(new[]
+ {
+ cbmBam.dosVersion
+ })).
+ AppendLine();
sbInformation.AppendFormat(Localization.Disk_ID_0, cbmBam.diskId).AppendLine();
diff --git a/Aaru.Filesystems/CPM/Definitions.cs b/Aaru.Filesystems/CPM/Definitions.cs
index 30bcac224..1bea96c16 100644
--- a/Aaru.Filesystems/CPM/Definitions.cs
+++ b/Aaru.Filesystems/CPM/Definitions.cs
@@ -50,10 +50,8 @@ public sealed partial class CPM
{
_definitions =
JsonSerializer.
- Deserialize(
- Assembly.GetExecutingAssembly().
- GetManifestResourceStream("Aaru.Filesystems.CPM.cpmdefs.json") ?? new MemoryStream(),
- typeof(CpmDefinitions), CpmDefinitionsContext.Default) as CpmDefinitions;
+ Deserialize(Assembly.GetExecutingAssembly().GetManifestResourceStream("Aaru.Filesystems.CPM.cpmdefs.json") ?? new MemoryStream(),
+ typeof(CpmDefinitions), CpmDefinitionsContext.Default) as CpmDefinitions;
if(_definitions is null)
return false;
@@ -73,8 +71,7 @@ public sealed partial class CPM
def.side1.sectorIds[i] = i + 1;
}
- if(def.sides != 2 ||
- def.side2 != null)
+ if(def.sides != 2 || def.side2 != null)
continue;
{
diff --git a/Aaru.Filesystems/CPM/Dir.cs b/Aaru.Filesystems/CPM/Dir.cs
index 2b1e38eb1..41a7be7c0 100644
--- a/Aaru.Filesystems/CPM/Dir.cs
+++ b/Aaru.Filesystems/CPM/Dir.cs
@@ -50,8 +50,7 @@ public sealed partial class CPM
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(!string.IsNullOrEmpty(path) &&
- string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
+ if(!string.IsNullOrEmpty(path) && string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
return ErrorNumber.NotSupported;
node = new CpmDirNode
@@ -124,15 +123,13 @@ public sealed partial class CPM
{
for(var f = 0; f < 8; f++)
{
- if(entry.filename[f] < 0x20 &&
- entry.filename[f] != 0x00)
+ if(entry.filename[f] < 0x20 && entry.filename[f] != 0x00)
return false;
}
for(var e = 0; e < 3; e++)
{
- if(entry.extension[e] < 0x20 &&
- entry.extension[e] != 0x00)
+ if(entry.extension[e] < 0x20 && entry.extension[e] != 0x00)
return false;
}
@@ -147,15 +144,13 @@ public sealed partial class CPM
{
for(var f = 0; f < 8; f++)
{
- if(entry.filename[f] < 0x20 &&
- entry.filename[f] != 0x00)
+ if(entry.filename[f] < 0x20 && entry.filename[f] != 0x00)
return false;
}
for(var e = 0; e < 3; e++)
{
- if(entry.extension[e] < 0x20 &&
- entry.extension[e] != 0x00)
+ if(entry.extension[e] < 0x20 && entry.extension[e] != 0x00)
return false;
}
diff --git a/Aaru.Filesystems/CPM/File.cs b/Aaru.Filesystems/CPM/File.cs
index 570a1f40d..0005a75b0 100644
--- a/Aaru.Filesystems/CPM/File.cs
+++ b/Aaru.Filesystems/CPM/File.cs
@@ -46,7 +46,10 @@ public sealed partial class CPM
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -76,7 +79,10 @@ public sealed partial class CPM
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -117,8 +123,7 @@ public sealed partial class CPM
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(buffer is null ||
- buffer.Length < length)
+ if(buffer is null || buffer.Length < length)
return ErrorNumber.InvalidArgument;
if(node is not CpmFileNode mynode)
@@ -152,13 +157,15 @@ public sealed partial class CPM
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
- if(!string.IsNullOrEmpty(path) &&
- string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
+ if(!string.IsNullOrEmpty(path) && string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
{
return _statCache.TryGetValue(pathElements[0].ToUpperInvariant(), out stat)
? ErrorNumber.NoError
diff --git a/Aaru.Filesystems/CPM/Info.cs b/Aaru.Filesystems/CPM/Info.cs
index 40e05da3b..09e6f7e41 100644
--- a/Aaru.Filesystems/CPM/Info.cs
+++ b/Aaru.Filesystems/CPM/Info.cs
@@ -191,9 +191,7 @@ public sealed partial class CPM
var sig3 = BitConverter.ToUInt32(sector, 0x7C);
// PCW16 extended boot record
- if(sig1 == 0x4D2F5043 &&
- sig2 == 0x004B5344 &&
- sig3 == sig1)
+ if(sig1 == 0x4D2F5043 && sig2 == 0x004B5344 && sig3 == sig1)
amsSbOffset = 0x80;
// Read the superblock
@@ -211,8 +209,7 @@ public sealed partial class CPM
sectorSize = (ulong)(128 << amsSb.psh);
// Compare device limits from superblock to real limits
- if(sectorSize == imagePlugin.Info.SectorSize &&
- sectorCount == imagePlugin.Info.Sectors)
+ if(sectorSize == imagePlugin.Info.SectorSize && sectorCount == imagePlugin.Info.Sectors)
{
_cpmFound = true;
firstDirectorySector = (ulong)(amsSb.off * amsSb.spt);
@@ -431,11 +428,9 @@ public sealed partial class CPM
byte formatByte;
// Check for alternate location of format ID
- if(sector.Last() == 0x00 ||
- sector.Last() == 0xFF)
+ if(sector.Last() == 0x00 || sector.Last() == 0xFF)
{
- if(sector[0x40] == 0x94 ||
- sector[0x40] == 0x26)
+ if(sector[0x40] == 0x94 || sector[0x40] == 0x26)
formatByte = sector[0x40];
else
formatByte = sector.Last();
@@ -920,14 +915,12 @@ public sealed partial class CPM
// Load all definitions
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Trying_to_load_definitions);
- if(LoadDefinitions() &&
- _definitions?.definitions is { Count: > 0 })
+ if(LoadDefinitions() && _definitions?.definitions is { Count: > 0 })
{
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Trying_all_known_definitions);
foreach(CpmDefinition def in from def in _definitions.definitions
- let sectors =
- (ulong)(def.cylinders * def.sides * def.sectorsPerTrack)
+ let sectors = (ulong)(def.cylinders * def.sides * def.sectorsPerTrack)
where sectors == imagePlugin.Info.Sectors &&
def.bytesPerSector == imagePlugin.Info.SectorSize
select def)
@@ -970,7 +963,8 @@ public sealed partial class CPM
// Head changes after whole side
else if(string.Compare(def.order, "CYLINDERS",
- StringComparison.InvariantCultureIgnoreCase) == 0)
+ StringComparison.InvariantCultureIgnoreCase) ==
+ 0)
{
for(var m = 0; m < def.side1.sectorIds.Length; m++)
_sectorMask[m] = def.side1.sectorIds[m] - def.side1.sectorIds[0];
@@ -979,14 +973,17 @@ public sealed partial class CPM
for(var m = 0; m < def.side1.sectorIds.Length; m++)
{
_sectorMask[m + def.side1.sectorIds.Length] =
- def.side1.sectorIds[m] - def.side1.sectorIds[0] + def.side1.sectorIds.Length +
+ def.side1.sectorIds[m] -
+ def.side1.sectorIds[0] +
+ def.side1.sectorIds.Length +
def.side2.sectorIds.Length;
}
}
// TODO: Implement COLUMBIA ordering
else if(string.Compare(def.order, "COLUMBIA",
- StringComparison.InvariantCultureIgnoreCase) == 0)
+ StringComparison.InvariantCultureIgnoreCase) ==
+ 0)
{
AaruConsole.DebugWriteLine(MODULE_NAME,
Localization.
@@ -1023,11 +1020,8 @@ public sealed partial class CPM
{
errno =
imagePlugin.
- ReadSector(
- (ulong)((int)offset + (int)partition.Start +
- p / _sectorMask.Length * _sectorMask.Length +
- _sectorMask[p % _sectorMask.Length]),
- out byte[] dirSector);
+ ReadSector((ulong)((int)offset + (int)partition.Start + p / _sectorMask.Length * _sectorMask.Length + _sectorMask[p % _sectorMask.Length]),
+ out byte[] dirSector);
if(errno != ErrorNumber.NoError)
break;
@@ -1163,10 +1157,7 @@ public sealed partial class CPM
metadata = new FileSystem();
// As the identification is so complex, just call Identify() and relay on its findings
- if(!Identify(imagePlugin, partition) ||
- !_cpmFound ||
- _workingDefinition == null ||
- _dpb == null)
+ if(!Identify(imagePlugin, partition) || !_cpmFound || _workingDefinition == null || _dpb == null)
return;
var sb = new StringBuilder();
diff --git a/Aaru.Filesystems/CPM/Super.cs b/Aaru.Filesystems/CPM/Super.cs
index 9a462e390..e4507b684 100644
--- a/Aaru.Filesystems/CPM/Super.cs
+++ b/Aaru.Filesystems/CPM/Super.cs
@@ -61,10 +61,7 @@ public sealed partial class CPM
_encoding = encoding ?? Encoding.GetEncoding("IBM437");
// As the identification is so complex, just call Identify() and relay on its findings
- if(!Identify(_device, partition) ||
- !_cpmFound ||
- _workingDefinition == null ||
- _dpb == null)
+ if(!Identify(_device, partition) || !_cpmFound || _workingDefinition == null || _dpb == null)
return ErrorNumber.InvalidArgument;
// Build the software interleaving sector mask
@@ -90,14 +87,16 @@ public sealed partial class CPM
for(var m = 0; m < _workingDefinition.side2.sectorIds.Length; m++)
{
_sectorMask[m + _workingDefinition.side1.sectorIds.Length] =
- _workingDefinition.side2.sectorIds[m] - _workingDefinition.side2.sectorIds[0] +
+ _workingDefinition.side2.sectorIds[m] -
+ _workingDefinition.side2.sectorIds[0] +
_workingDefinition.side1.sectorIds.Length;
}
}
// Head changes after whole side
else if(string.Compare(_workingDefinition.order, "CYLINDERS",
- StringComparison.InvariantCultureIgnoreCase) == 0)
+ StringComparison.InvariantCultureIgnoreCase) ==
+ 0)
{
for(var m = 0; m < _workingDefinition.side1.sectorIds.Length; m++)
_sectorMask[m] = _workingDefinition.side1.sectorIds[m] - _workingDefinition.side1.sectorIds[0];
@@ -106,8 +105,10 @@ public sealed partial class CPM
for(var m = 0; m < _workingDefinition.side1.sectorIds.Length; m++)
{
_sectorMask[m + _workingDefinition.side1.sectorIds.Length] =
- _workingDefinition.side1.sectorIds[m] - _workingDefinition.side1.sectorIds[0] +
- _workingDefinition.side1.sectorIds.Length + _workingDefinition.side2.sectorIds.Length;
+ _workingDefinition.side1.sectorIds[m] -
+ _workingDefinition.side1.sectorIds[0] +
+ _workingDefinition.side1.sectorIds.Length +
+ _workingDefinition.side2.sectorIds.Length;
}
// TODO: Implement CYLINDERS ordering
@@ -157,10 +158,8 @@ public sealed partial class CPM
for(var p = 0; p <= (int)(partition.End - partition.Start); p++)
{
ErrorNumber errno =
- _device.ReadSector(
- (ulong)((int)partition.Start + p / _sectorMask.Length * _sectorMask.Length +
- _sectorMask[p % _sectorMask.Length]),
- out byte[] readSector);
+ _device.ReadSector((ulong)((int)partition.Start + p / _sectorMask.Length * _sectorMask.Length + _sectorMask[p % _sectorMask.Length]),
+ out byte[] readSector);
if(errno != ErrorNumber.NoError)
return errno;
diff --git a/Aaru.Filesystems/CPM/Xattr.cs b/Aaru.Filesystems/CPM/Xattr.cs
index 8a4f76c34..485e07573 100644
--- a/Aaru.Filesystems/CPM/Xattr.cs
+++ b/Aaru.Filesystems/CPM/Xattr.cs
@@ -46,7 +46,10 @@ public sealed partial class CPM
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -76,7 +79,10 @@ public sealed partial class CPM
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
diff --git a/Aaru.Filesystems/EFS/Info.cs b/Aaru.Filesystems/EFS/Info.cs
index 021677a41..43ebbc47b 100644
--- a/Aaru.Filesystems/EFS/Info.cs
+++ b/Aaru.Filesystems/EFS/Info.cs
@@ -159,12 +159,11 @@ public sealed partial class EFS
efsSb = Marshal.ByteArrayToStructureBigEndian(sector);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.magic_at_0_equals_1_expected_2_or_3, 1,
- efsSb.sb_magic, EFS_MAGIC, EFS_MAGIC_NEW);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.magic_at_0_equals_1_expected_2_or_3, 1, efsSb.sb_magic,
+ EFS_MAGIC, EFS_MAGIC_NEW);
}
- if(efsSb.sb_magic != EFS_MAGIC &&
- efsSb.sb_magic != EFS_MAGIC_NEW)
+ if(efsSb.sb_magic != EFS_MAGIC && efsSb.sb_magic != EFS_MAGIC_NEW)
return;
var sb = new StringBuilder();
diff --git a/Aaru.Filesystems/F2FS/Info.cs b/Aaru.Filesystems/F2FS/Info.cs
index 97ac5a442..3bd49df6d 100644
--- a/Aaru.Filesystems/F2FS/Info.cs
+++ b/Aaru.Filesystems/F2FS/Info.cs
@@ -116,7 +116,8 @@ public sealed partial class F2FS
sb.AppendFormat(Localization._0_bytes_per_sector, 1 << (int)f2fsSb.log_sectorsize).AppendLine();
sb.AppendFormat(Localization._0_sectors_1_bytes_per_block, 1 << (int)f2fsSb.log_sectors_per_block,
- 1 << (int)f2fsSb.log_blocksize).AppendLine();
+ 1 << (int)f2fsSb.log_blocksize).
+ AppendLine();
sb.AppendFormat(Localization._0_blocks_per_segment, f2fsSb.log_blocks_per_seg).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_volume, f2fsSb.block_count).AppendLine();
@@ -128,7 +129,8 @@ public sealed partial class F2FS
sb.AppendFormat(Localization.Volume_UUID_0, f2fsSb.uuid).AppendLine();
sb.AppendFormat(Localization.Volume_name_0,
- StringHandlers.CToString(f2fsSb.volume_name, Encoding.Unicode, true)).AppendLine();
+ StringHandlers.CToString(f2fsSb.volume_name, Encoding.Unicode, true)).
+ AppendLine();
sb.AppendFormat(Localization.Volume_last_mounted_on_kernel_version_0, StringHandlers.CToString(f2fsSb.version)).
AppendLine();
diff --git a/Aaru.Filesystems/FAT/BPB.cs b/Aaru.Filesystems/FAT/BPB.cs
index 982b60272..b8f42ac09 100644
--- a/Aaru.Filesystems/FAT/BPB.cs
+++ b/Aaru.Filesystems/FAT/BPB.cs
@@ -60,11 +60,21 @@ public sealed partial class FAT
: humanBpb.clusters == expectedClusters;
// Check OEM for Human68k is correct
- bool humanOemCorrect = bpbSector[2] >= 0x20 && bpbSector[3] >= 0x20 && bpbSector[4] >= 0x20 &&
- bpbSector[5] >= 0x20 && bpbSector[6] >= 0x20 && bpbSector[7] >= 0x20 &&
- bpbSector[8] >= 0x20 && bpbSector[9] >= 0x20 && bpbSector[10] >= 0x20 &&
- bpbSector[11] >= 0x20 && bpbSector[12] >= 0x20 && bpbSector[13] >= 0x20 &&
- bpbSector[14] >= 0x20 && bpbSector[15] >= 0x20 && bpbSector[16] >= 0x20 &&
+ bool humanOemCorrect = bpbSector[2] >= 0x20 &&
+ bpbSector[3] >= 0x20 &&
+ bpbSector[4] >= 0x20 &&
+ bpbSector[5] >= 0x20 &&
+ bpbSector[6] >= 0x20 &&
+ bpbSector[7] >= 0x20 &&
+ bpbSector[8] >= 0x20 &&
+ bpbSector[9] >= 0x20 &&
+ bpbSector[10] >= 0x20 &&
+ bpbSector[11] >= 0x20 &&
+ bpbSector[12] >= 0x20 &&
+ bpbSector[13] >= 0x20 &&
+ bpbSector[14] >= 0x20 &&
+ bpbSector[15] >= 0x20 &&
+ bpbSector[16] >= 0x20 &&
bpbSector[17] >= 0x20;
// Check correct branch for Human68k
@@ -176,10 +186,14 @@ public sealed partial class FAT
apricotBpb.mainBPB.sectors /= 4;
}
- andosOemCorrect = dos33Bpb.oem_name[0] < 0x20 && dos33Bpb.oem_name[1] >= 0x20 &&
- dos33Bpb.oem_name[2] >= 0x20 && dos33Bpb.oem_name[3] >= 0x20 &&
- dos33Bpb.oem_name[4] >= 0x20 && dos33Bpb.oem_name[5] >= 0x20 &&
- dos33Bpb.oem_name[6] >= 0x20 && dos33Bpb.oem_name[7] >= 0x20;
+ andosOemCorrect = dos33Bpb.oem_name[0] < 0x20 &&
+ dos33Bpb.oem_name[1] >= 0x20 &&
+ dos33Bpb.oem_name[2] >= 0x20 &&
+ dos33Bpb.oem_name[3] >= 0x20 &&
+ dos33Bpb.oem_name[4] >= 0x20 &&
+ dos33Bpb.oem_name[5] >= 0x20 &&
+ dos33Bpb.oem_name[6] >= 0x20 &&
+ dos33Bpb.oem_name[7] >= 0x20;
if(bitsInBpsFat32 == 1 &&
correctSpcFat32 &&
@@ -285,7 +299,8 @@ public sealed partial class FAT
dos33Bpb.sectors <= partition.End - partition.Start + 1)
{
if(atariBpb.jump[0] == 0x60 ||
- atariBpb.jump[0] == 0xE9 && atariBpb.jump[1] == 0x00 &&
+ atariBpb.jump[0] == 0xE9 &&
+ atariBpb.jump[1] == 0x00 &&
Encoding.ASCII.GetString(dos33Bpb.oem_name) != "NEXT " ||
partition.Type is "GEM" or "BGM")
{
@@ -308,11 +323,11 @@ public sealed partial class FAT
useDos32Bpb = true;
minBootNearJump = 0x1E;
}
- else if(dos30Bpb.sptrk is > 0 and < 64 &&
- dos30Bpb.heads is > 0 and < 256)
+ else if(dos30Bpb.sptrk is > 0 and < 64 && dos30Bpb.heads is > 0 and < 256)
{
if(atariBpb.jump[0] == 0x60 ||
- atariBpb.jump[0] == 0xE9 && atariBpb.jump[1] == 0x00 &&
+ atariBpb.jump[0] == 0xE9 &&
+ atariBpb.jump[1] == 0x00 &&
Encoding.ASCII.GetString(dos33Bpb.oem_name) != "NEXT ")
{
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Using_Atari_BPB);
@@ -328,7 +343,8 @@ public sealed partial class FAT
else
{
if(atariBpb.jump[0] == 0x60 ||
- atariBpb.jump[0] == 0xE9 && atariBpb.jump[1] == 0x00 &&
+ atariBpb.jump[0] == 0xE9 &&
+ atariBpb.jump[1] == 0x00 &&
Encoding.ASCII.GetString(dos33Bpb.oem_name) != "NEXT ")
{
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Using_Atari_BPB);
@@ -372,7 +388,10 @@ public sealed partial class FAT
// Volume is software interleaved 2:1
var rootMs = new MemoryStream();
- foreach(ulong rootSector in new ulong[] { 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20 })
+ foreach(ulong rootSector in new ulong[]
+ {
+ 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20
+ })
{
imagePlugin.ReadSector(rootSector, out byte[] tmp);
rootMs.Write(tmp, 0, tmp.Length);
@@ -613,8 +632,9 @@ public sealed partial class FAT
}
// This assumes a bootable sector will jump somewhere or disable interrupts in x86 code
- bootable |= bpbSector[0] == 0xFA || bpbSector[0] == 0xEB && bpbSector[1] <= 0x7F ||
- bpbSector[0] == 0xE9 && BitConverter.ToUInt16(bpbSector, 1) <= 0x1FC;
+ bootable |= bpbSector[0] == 0xFA ||
+ bpbSector[0] == 0xEB && bpbSector[1] <= 0x7F ||
+ bpbSector[0] == 0xE9 && BitConverter.ToUInt16(bpbSector, 1) <= 0x1FC;
fakeBpb.boot_code = bpbSector;
@@ -794,8 +814,7 @@ public sealed partial class FAT
fakeBpb.sptrk = apricotBpb.spt;
bootable = apricotBpb.bootType > 0;
- if(apricotBpb.bootLocation > 0 &&
- apricotBpb.bootLocation + apricotBpb.bootSize < imagePlugin.Info.Sectors)
+ if(apricotBpb.bootLocation > 0 && apricotBpb.bootLocation + apricotBpb.bootSize < imagePlugin.Info.Sectors)
{
imagePlugin.ReadSectors(apricotBpb.bootLocation,
(uint)(apricotBpb.sectorSize * apricotBpb.bootSize) / imagePlugin.Info.SectorSize,
diff --git a/Aaru.Filesystems/FAT/Dir.cs b/Aaru.Filesystems/FAT/Dir.cs
index 7a9e96c41..2dfa73fec 100644
--- a/Aaru.Filesystems/FAT/Dir.cs
+++ b/Aaru.Filesystems/FAT/Dir.cs
@@ -61,8 +61,7 @@ public sealed partial class FAT
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(string.IsNullOrWhiteSpace(path) ||
- path == "/")
+ if(string.IsNullOrWhiteSpace(path) || path == "/")
{
node = new FatDirNode
{
@@ -90,7 +89,10 @@ public sealed partial class FAT
return ErrorNumber.NoError;
}
- string[] pieces = cutPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pieces = cutPath.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
KeyValuePair entry =
_rootDirectoryCache.FirstOrDefault(t => t.Key.ToLower(_cultureInfo) == pieces[0]);
@@ -172,8 +174,7 @@ public sealed partial class FAT
if(dirent.attributes.HasFlag(FatAttributes.LFN))
{
- if(_namespace != Namespace.Lfn &&
- _namespace != Namespace.Ecs)
+ if(_namespace != Namespace.Lfn && _namespace != Namespace.Ecs)
continue;
LfnEntry lfnEntry =
@@ -207,8 +208,7 @@ public sealed partial class FAT
}
// Not a correct entry
- if(dirent.filename[0] < DIRENT_MIN &&
- dirent.filename[0] != DIRENT_E5)
+ if(dirent.filename[0] < DIRENT_MIN && dirent.filename[0] != DIRENT_E5)
continue;
// Self
@@ -233,8 +233,7 @@ public sealed partial class FAT
Dirent = dirent
};
- if(_namespace is Namespace.Lfn or Namespace.Ecs &&
- lastLfnName != null)
+ if(_namespace is Namespace.Lfn or Namespace.Ecs && lastLfnName != null)
{
byte calculatedLfnChecksum = LfnChecksum(dirent.filename, dirent.extension);
@@ -254,13 +253,11 @@ public sealed partial class FAT
string name = _encoding.GetString(dirent.filename).TrimEnd();
string extension = _encoding.GetString(dirent.extension).TrimEnd();
- if(name == "" &&
- extension == "")
+ if(name == "" && extension == "")
{
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_empty_filename_in_0, path);
- if(!_debug ||
- dirent is { size: > 0, start_cluster: 0 })
+ if(!_debug || dirent is { size: > 0, start_cluster: 0 })
continue; // Skip invalid name
// If debug, add it
@@ -325,12 +322,9 @@ public sealed partial class FAT
}
// Check OS/2 .LONGNAME
- if(_eaCache != null &&
- _namespace is Namespace.Os2 or Namespace.Ecs &&
- !_fat32)
+ if(_eaCache != null && _namespace is Namespace.Os2 or Namespace.Ecs && !_fat32)
{
- var filesWithEas =
- currentDirectory.Where(t => t.Value.Dirent.ea_handle != 0).ToList();
+ var filesWithEas = currentDirectory.Where(t => t.Value.Dirent.ea_handle != 0).ToList();
foreach(KeyValuePair fileWithEa in filesWithEas)
{
@@ -371,8 +365,8 @@ public sealed partial class FAT
// Check FAT32.IFS EAs
if(_fat32 || _debug)
{
- var fat32EaSidecars =
- currentDirectory.Where(t => t.Key.EndsWith(FAT32_EA_TAIL, true, _cultureInfo)).ToList();
+ var fat32EaSidecars = currentDirectory.Where(t => t.Key.EndsWith(FAT32_EA_TAIL, true, _cultureInfo)).
+ ToList();
foreach(KeyValuePair sidecar in fat32EaSidecars)
{
diff --git a/Aaru.Filesystems/FAT/FAT.cs b/Aaru.Filesystems/FAT/FAT.cs
index ecbb31ca1..0a9678740 100644
--- a/Aaru.Filesystems/FAT/FAT.cs
+++ b/Aaru.Filesystems/FAT/FAT.cs
@@ -88,17 +88,29 @@ public sealed partial class FAT : IReadOnlyFilesystem
///
public Dictionary Namespaces => new()
{
- { "dos", Localization.DOS_8_3_all_uppercase },
- { "nt", Localization.Windows_NT_8_3_mixed_case },
- { "os2", Localization.OS2_LONGNAME_extended_attribute },
- { "ecs", Localization.Use_LFN_when_available_with_fallback_to_LONGNAME_default },
- { "lfn", Localization.Long_file_names }
+ {
+ "dos", Localization.DOS_8_3_all_uppercase
+ },
+ {
+ "nt", Localization.Windows_NT_8_3_mixed_case
+ },
+ {
+ "os2", Localization.OS2_LONGNAME_extended_attribute
+ },
+ {
+ "ecs", Localization.Use_LFN_when_available_with_fallback_to_LONGNAME_default
+ },
+ {
+ "lfn", Localization.Long_file_names
+ }
};
#endregion
static Dictionary GetDefaultOptions() => new()
{
- { "debug", false.ToString() }
+ {
+ "debug", false.ToString()
+ }
};
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/FAT/File.cs b/Aaru.Filesystems/FAT/File.cs
index e30191cc6..1b60f2241 100644
--- a/Aaru.Filesystems/FAT/File.cs
+++ b/Aaru.Filesystems/FAT/File.cs
@@ -73,8 +73,7 @@ public sealed partial class FAT
if(err != ErrorNumber.NoError)
return err;
- if(stat.Attributes.HasFlag(FileAttributes.Directory) &&
- !_debug)
+ if(stat.Attributes.HasFlag(FileAttributes.Directory) && !_debug)
return ErrorNumber.IsDirectory;
uint[] clusters = GetClusters((uint)stat.Inode);
@@ -115,8 +114,7 @@ public sealed partial class FAT
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(buffer is null ||
- buffer.Length < length)
+ if(buffer is null || buffer.Length < length)
return ErrorNumber.InvalidArgument;
if(node is not FatFileNode mynode)
@@ -183,14 +181,12 @@ public sealed partial class FAT
Links = 1
};
- if(entry.cdate > 0 ||
- entry.ctime > 0)
+ if(entry.cdate > 0 || entry.ctime > 0)
stat.CreationTime = DateHandlers.DosToDateTime(entry.cdate, entry.ctime);
if(_namespace != Namespace.Human)
{
- if(entry.mdate > 0 ||
- entry.mtime > 0)
+ if(entry.mdate > 0 || entry.mtime > 0)
stat.LastWriteTime = DateHandlers.DosToDateTime(entry.mdate, entry.mtime);
if(entry.ctime_ms > 0)
@@ -204,8 +200,7 @@ public sealed partial class FAT
{
stat.Attributes |= FileAttributes.Directory;
- if(_fat32 && entry.ea_handle << 16 > 0 ||
- entry.start_cluster > 0)
+ if(_fat32 && entry.ea_handle << 16 > 0 || entry.start_cluster > 0)
{
stat.Blocks = _fat32
? GetClusters((uint)((entry.ea_handle << 16) + entry.start_cluster))?.Length ?? 0
@@ -259,8 +254,7 @@ public sealed partial class FAT
if(_fat32)
{
- while((nextCluster & FAT32_MASK) > 0 &&
- (nextCluster & FAT32_MASK) <= FAT32_RESERVED)
+ while((nextCluster & FAT32_MASK) > 0 && (nextCluster & FAT32_MASK) <= FAT32_RESERVED)
{
clusters.Add(nextCluster);
@@ -276,8 +270,7 @@ public sealed partial class FAT
nextCluster = BitConverter.ToUInt32(fatData, nextEntry * 4);
- nextSector = nextCluster / _fatEntriesPerSector + _fatFirstSector +
- (_useFirstFat ? 0 : _sectorsPerFat);
+ nextSector = nextCluster / _fatEntriesPerSector + _fatFirstSector + (_useFirstFat ? 0 : _sectorsPerFat);
nextEntry = (int)(nextCluster % _fatEntriesPerSector);
}
@@ -314,7 +307,10 @@ public sealed partial class FAT
string cutPath = path.StartsWith('/') ? path[1..].ToLower(_cultureInfo) : path.ToLower(_cultureInfo);
- string[] pieces = cutPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pieces = cutPath.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pieces.Length == 0)
return ErrorNumber.InvalidArgument;
diff --git a/Aaru.Filesystems/FAT/Info.cs b/Aaru.Filesystems/FAT/Info.cs
index e1e9e58cc..069e96eaf 100644
--- a/Aaru.Filesystems/FAT/Info.cs
+++ b/Aaru.Filesystems/FAT/Info.cs
@@ -100,11 +100,21 @@ public sealed partial class FAT
: humanBpb.clusters == expectedClusters;
// Check OEM for Human68k is correct
- bool humanOemCorrect = bpbSector[2] >= 0x20 && bpbSector[3] >= 0x20 && bpbSector[4] >= 0x20 &&
- bpbSector[5] >= 0x20 && bpbSector[6] >= 0x20 && bpbSector[7] >= 0x20 &&
- bpbSector[8] >= 0x20 && bpbSector[9] >= 0x20 && bpbSector[10] >= 0x20 &&
- bpbSector[11] >= 0x20 && bpbSector[12] >= 0x20 && bpbSector[13] >= 0x20 &&
- bpbSector[14] >= 0x20 && bpbSector[15] >= 0x20 && bpbSector[16] >= 0x20 &&
+ bool humanOemCorrect = bpbSector[2] >= 0x20 &&
+ bpbSector[3] >= 0x20 &&
+ bpbSector[4] >= 0x20 &&
+ bpbSector[5] >= 0x20 &&
+ bpbSector[6] >= 0x20 &&
+ bpbSector[7] >= 0x20 &&
+ bpbSector[8] >= 0x20 &&
+ bpbSector[9] >= 0x20 &&
+ bpbSector[10] >= 0x20 &&
+ bpbSector[11] >= 0x20 &&
+ bpbSector[12] >= 0x20 &&
+ bpbSector[13] >= 0x20 &&
+ bpbSector[14] >= 0x20 &&
+ bpbSector[15] >= 0x20 &&
+ bpbSector[16] >= 0x20 &&
bpbSector[17] >= 0x20;
// Check correct branch for Human68k
@@ -115,10 +125,7 @@ public sealed partial class FAT
AaruConsole.DebugWriteLine(MODULE_NAME, "humanBranchCorrect = {0}", humanBranchCorrect);
// If all Human68k checks are correct, it is a Human68k FAT16
- if(humanClustersCorrect &&
- humanOemCorrect &&
- humanBranchCorrect &&
- expectedClusters > 0)
+ if(humanClustersCorrect && humanOemCorrect && humanBranchCorrect && expectedClusters > 0)
return true;
Array.Copy(bpbSector, 0x02, atariOem, 0, 6);
@@ -147,11 +154,21 @@ public sealed partial class FAT
string msxString = Encoding.ASCII.GetString(msxId);
string fat32String = Encoding.ASCII.GetString(fat32Id);
- bool atariOemCorrect = atariOem[0] >= 0x20 && atariOem[1] >= 0x20 && atariOem[2] >= 0x20 &&
- atariOem[3] >= 0x20 && atariOem[4] >= 0x20 && atariOem[5] >= 0x20;
+ bool atariOemCorrect = atariOem[0] >= 0x20 &&
+ atariOem[1] >= 0x20 &&
+ atariOem[2] >= 0x20 &&
+ atariOem[3] >= 0x20 &&
+ atariOem[4] >= 0x20 &&
+ atariOem[5] >= 0x20;
- bool dosOemCorrect = dosOem[0] >= 0x20 && dosOem[1] >= 0x20 && dosOem[2] >= 0x20 && dosOem[3] >= 0x20 &&
- dosOem[4] >= 0x20 && dosOem[5] >= 0x20 && dosOem[6] >= 0x20 && dosOem[7] >= 0x20;
+ bool dosOemCorrect = dosOem[0] >= 0x20 &&
+ dosOem[1] >= 0x20 &&
+ dosOem[2] >= 0x20 &&
+ dosOem[3] >= 0x20 &&
+ dosOem[4] >= 0x20 &&
+ dosOem[5] >= 0x20 &&
+ dosOem[6] >= 0x20 &&
+ dosOem[7] >= 0x20;
string oemString = Encoding.ASCII.GetString(dosOem);
@@ -234,16 +251,18 @@ public sealed partial class FAT
var hpfsMagic1 = BitConverter.ToUInt32(hpfsSbSector, 0x000);
var hpfsMagic2 = BitConverter.ToUInt32(hpfsSbSector, 0x004);
- if(hpfsMagic1 == 0xF995E849 &&
- hpfsMagic2 == 0xFA53E9C5)
+ if(hpfsMagic1 == 0xF995E849 && hpfsMagic2 == 0xFA53E9C5)
return false;
}
switch(bitsInBps)
{
// FAT32 for sure
- case 1 when correctSpc && numberOfFats <= 2 && fatSectors == 0 && fat32Signature == 0x29 &&
- fat32String == "FAT32 ":
+ case 1 when correctSpc &&
+ numberOfFats <= 2 &&
+ fatSectors == 0 &&
+ fat32Signature == 0x29 &&
+ fat32String == "FAT32 ":
return true;
// short FAT32
@@ -255,21 +274,30 @@ public sealed partial class FAT
: sectors <= partition.End - partition.Start + 1;
// MSX-DOS FAT12
- case 1 when correctSpc && numberOfFats <= 2 && rootEntries > 0 &&
- sectors <= partition.End - partition.Start + 1 && fatSectors > 0 &&
- msxString == "VOL_ID":
+ case 1 when correctSpc &&
+ numberOfFats <= 2 &&
+ rootEntries > 0 &&
+ sectors <= partition.End - partition.Start + 1 &&
+ fatSectors > 0 &&
+ msxString == "VOL_ID":
return true;
// EBPB
- case 1 when correctSpc && numberOfFats <= 2 && rootEntries > 0 && fatSectors > 0 &&
+ case 1 when correctSpc &&
+ numberOfFats <= 2 &&
+ rootEntries > 0 &&
+ fatSectors > 0 &&
bpbSignature is 0x28 or 0x29:
return sectors == 0
? bigSectors <= partition.End - partition.Start + 1
: sectors <= partition.End - partition.Start + 1;
// BPB
- case 1 when correctSpc && reservedSecs < partition.End - partition.Start && numberOfFats <= 2 &&
- rootEntries > 0 && fatSectors > 0:
+ case 1 when correctSpc &&
+ reservedSecs < partition.End - partition.Start &&
+ numberOfFats <= 2 &&
+ rootEntries > 0 &&
+ fatSectors > 0:
return sectors == 0
? bigSectors <= partition.End - partition.Start + 1
: sectors <= partition.End - partition.Start + 1;
@@ -313,7 +341,10 @@ public sealed partial class FAT
// Volume is software interleaved 2:1
var rootMs = new MemoryStream();
- foreach(ulong rootSector in new ulong[] { 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20 })
+ foreach(ulong rootSector in new ulong[]
+ {
+ 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20
+ })
{
errno = imagePlugin.ReadSector(rootSector, out byte[] tmp);
@@ -409,8 +440,7 @@ public sealed partial class FAT
break;
}
- if(fat2SectorNo > partition.End ||
- fat2SectorNo == 0)
+ if(fat2SectorNo > partition.End || fat2SectorNo == 0)
return false;
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Second_fat_starts_at_0, fat2SectorNo);
@@ -507,9 +537,7 @@ public sealed partial class FAT
if(fat32Bpb.oem_name != null)
{
- if(fat32Bpb.oem_name[5] == 0x49 &&
- fat32Bpb.oem_name[6] == 0x48 &&
- fat32Bpb.oem_name[7] == 0x43)
+ if(fat32Bpb.oem_name[5] == 0x49 && fat32Bpb.oem_name[6] == 0x48 && fat32Bpb.oem_name[7] == 0x43)
sb.AppendLine(Localization.Volume_has_been_modified_by_Windows_9x_Me_Volume_Tracker);
else
metadata.SystemIdentifier = StringHandlers.CToString(fat32Bpb.oem_name);
@@ -526,21 +554,24 @@ public sealed partial class FAT
if(fat32Bpb is { big_sectors: 0, signature: 0x28 })
{
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, shortFat32Bpb.huge_sectors,
- shortFat32Bpb.huge_sectors * shortFat32Bpb.bps).AppendLine();
+ shortFat32Bpb.huge_sectors * shortFat32Bpb.bps).
+ AppendLine();
metadata.Clusters = shortFat32Bpb.huge_sectors / shortFat32Bpb.spc;
}
else if(fat32Bpb.sectors == 0)
{
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, fat32Bpb.big_sectors,
- fat32Bpb.big_sectors * fat32Bpb.bps).AppendLine();
+ fat32Bpb.big_sectors * fat32Bpb.bps).
+ AppendLine();
metadata.Clusters = fat32Bpb.big_sectors / fat32Bpb.spc;
}
else
{
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, fat32Bpb.sectors,
- fat32Bpb.sectors * fat32Bpb.bps).AppendLine();
+ fat32Bpb.sectors * fat32Bpb.bps).
+ AppendLine();
metadata.Clusters = (ulong)(fat32Bpb.sectors / fat32Bpb.spc);
}
@@ -603,7 +634,8 @@ public sealed partial class FAT
// This will mean that the volume will boot, even if just to say "this is not bootable change disk"......
metadata.Bootable =
fat32Bpb.jump[0] == 0xEB && fat32Bpb.jump[1] >= minBootNearJump && fat32Bpb.jump[1] < 0x80 ||
- fat32Bpb.jump[0] == 0xE9 && fat32Bpb.jump.Length >= 3 &&
+ fat32Bpb.jump[0] == 0xE9 &&
+ fat32Bpb.jump.Length >= 3 &&
BitConverter.ToUInt16(fat32Bpb.jump, 1) >= minBootNearJump &&
BitConverter.ToUInt16(fat32Bpb.jump, 1) <= 0x1FC;
@@ -611,8 +643,10 @@ public sealed partial class FAT
// First root directory sector
rootDirectorySector =
- (ulong)((fat32Bpb.root_cluster - 2) * fat32Bpb.spc + fat32Bpb.big_spfat * fat32Bpb.fats_no +
- fat32Bpb.rsectors) * sectorsPerRealSector;
+ (ulong)((fat32Bpb.root_cluster - 2) * fat32Bpb.spc +
+ fat32Bpb.big_spfat * fat32Bpb.fats_no +
+ fat32Bpb.rsectors) *
+ sectorsPerRealSector;
sectorsForRootDirectory = 1;
@@ -657,7 +691,8 @@ public sealed partial class FAT
var atariSb = new StringBuilder();
atariSb.AppendFormat(Localization.cmdload_will_be_loaded_with_value_0,
- BigEndianBitConverter.ToUInt16(bpbSector, 0x01E)).AppendLine();
+ BigEndianBitConverter.ToUInt16(bpbSector, 0x01E)).
+ AppendLine();
atariSb.AppendFormat(Localization.Boot_program_will_be_loaded_at_address_0, atariBpb.ldaaddr).
AppendLine();
@@ -721,8 +756,9 @@ public sealed partial class FAT
if(bpbKind != BpbKind.Human)
{
- int reservedSectors = fakeBpb.rsectors + fakeBpb.fats_no * fakeBpb.spfat +
- fakeBpb.root_ent * 32 / fakeBpb.bps;
+ int reservedSectors = fakeBpb.rsectors +
+ fakeBpb.fats_no * fakeBpb.spfat +
+ fakeBpb.root_ent * 32 / fakeBpb.bps;
if(fakeBpb.sectors == 0)
{
@@ -743,8 +779,7 @@ public sealed partial class FAT
// This will walk all the FAT entries and check if they're valid FAT12 or FAT16 entries.
// If the whole table is valid in both senses, it considers the type entry in the BPB.
// BeOS is known to set the type as FAT16 but treat it as FAT12.
- if(!isFat12 &&
- !isFat16)
+ if(!isFat12 && !isFat16)
{
if(clusters < 4089)
{
@@ -795,8 +830,7 @@ public sealed partial class FAT
isFat16 = fakeBpb.fs_type != null && Encoding.ASCII.GetString(fakeBpb.fs_type) == "FAT16 ";
}
- if(!isFat12 &&
- !isFat16)
+ if(!isFat12 && !isFat16)
isFat12 = true;
}
else
@@ -841,9 +875,7 @@ public sealed partial class FAT
if(bpbKind == BpbKind.Atari)
{
- if(atariBpb.serial_no[0] == 0x49 &&
- atariBpb.serial_no[1] == 0x48 &&
- atariBpb.serial_no[2] == 0x43)
+ if(atariBpb.serial_no[0] == 0x49 && atariBpb.serial_no[1] == 0x48 && atariBpb.serial_no[2] == 0x43)
sb.AppendLine(Localization.Volume_has_been_modified_by_Windows_9x_Me_Volume_Tracker);
else
{
@@ -858,9 +890,7 @@ public sealed partial class FAT
}
else if(fakeBpb.oem_name != null)
{
- if(fakeBpb.oem_name[5] == 0x49 &&
- fakeBpb.oem_name[6] == 0x48 &&
- fakeBpb.oem_name[7] == 0x43)
+ if(fakeBpb.oem_name[5] == 0x49 && fakeBpb.oem_name[6] == 0x48 && fakeBpb.oem_name[7] == 0x43)
sb.AppendLine(Localization.Volume_has_been_modified_by_Windows_9x_Me_Volume_Tracker);
else
{
@@ -896,9 +926,8 @@ public sealed partial class FAT
fakeBpb.oem_name[6] >= 0x20 &&
fakeBpb.oem_name[6] <= 0x7F &&
fakeBpb.oem_name[7] >= 0x20 &&
- fakeBpb.oem_name[7] <= 0x7F => StringHandlers.CToString(
- fakeBpb.oem_name, encoding,
- start: 1),
+ fakeBpb.oem_name[7] <= 0x7F =>
+ StringHandlers.CToString(fakeBpb.oem_name, encoding, start: 1),
_ => metadata.SystemIdentifier
};
}
@@ -917,12 +946,14 @@ public sealed partial class FAT
if(fakeBpb.sectors == 0)
{
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, fakeBpb.big_sectors,
- fakeBpb.big_sectors * fakeBpb.bps).AppendLine();
+ fakeBpb.big_sectors * fakeBpb.bps).
+ AppendLine();
}
else
{
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, fakeBpb.sectors,
- fakeBpb.sectors * fakeBpb.bps).AppendLine();
+ fakeBpb.sectors * fakeBpb.bps).
+ AppendLine();
}
}
else
@@ -945,8 +976,7 @@ public sealed partial class FAT
sb.AppendFormat(Localization._0_sectors_per_FAT, fakeBpb.spfat).AppendLine();
- if(fakeBpb.sptrk is > 0 and < 64 &&
- fakeBpb.heads is > 0 and < 256)
+ if(fakeBpb.sptrk is > 0 and < 64 && fakeBpb.heads is > 0 and < 256)
{
sb.AppendFormat(Localization._0_sectors_per_track, fakeBpb.sptrk).AppendLine();
sb.AppendFormat(Localization._0_heads, fakeBpb.heads).AppendLine();
@@ -983,8 +1013,7 @@ public sealed partial class FAT
AppendLine();
}
}
- else if(bpbKind == BpbKind.Atari &&
- metadata.VolumeSerial != null)
+ else if(bpbKind == BpbKind.Atari && metadata.VolumeSerial != null)
sb.AppendFormat(Localization.Volume_Serial_Number_0, metadata.VolumeSerial).AppendLine();
bootChk = Sha1Context.Data(fakeBpb.boot_code, out _);
@@ -995,12 +1024,12 @@ public sealed partial class FAT
// Check that jumps to a correct boot code position and has boot signature set.
// This will mean that the volume will boot, even if just to say "this is not bootable change disk"......
- if(metadata.Bootable == false &&
- fakeBpb.jump != null)
+ if(metadata.Bootable == false && fakeBpb.jump != null)
{
metadata.Bootable |=
fakeBpb.jump[0] == 0xEB && fakeBpb.jump[1] >= minBootNearJump && fakeBpb.jump[1] < 0x80 ||
- fakeBpb.jump[0] == 0xE9 && fakeBpb.jump.Length >= 3 &&
+ fakeBpb.jump[0] == 0xE9 &&
+ fakeBpb.jump.Length >= 3 &&
BitConverter.ToUInt16(fakeBpb.jump, 1) >= minBootNearJump &&
BitConverter.ToUInt16(fakeBpb.jump, 1) <= 0x1FC;
}
@@ -1029,7 +1058,10 @@ public sealed partial class FAT
{
var rootMs = new MemoryStream();
- foreach(ulong rootSector in new ulong[] { 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20 })
+ foreach(ulong rootSector in new ulong[]
+ {
+ 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20
+ })
{
errno = imagePlugin.ReadSector(rootSector, out byte[] tmp);
@@ -1045,18 +1077,15 @@ public sealed partial class FAT
for(var i = 0; i < rootDirectory.Length; i += 32)
{
// Not a correct entry
- if(rootDirectory[i] < DIRENT_MIN &&
- rootDirectory[i] != DIRENT_E5)
+ if(rootDirectory[i] < DIRENT_MIN && rootDirectory[i] != DIRENT_E5)
continue;
// Deleted or subdirectory entry
- if(rootDirectory[i] == DIRENT_SUBDIR ||
- rootDirectory[i] == DIRENT_DELETED)
+ if(rootDirectory[i] == DIRENT_SUBDIR || rootDirectory[i] == DIRENT_DELETED)
continue;
// Not a volume label
- if(rootDirectory[i + 0x0B] != 0x08 &&
- rootDirectory[i + 0x0B] != 0x28)
+ if(rootDirectory[i + 0x0B] != 0x08 && rootDirectory[i + 0x0B] != 0x28)
continue;
DirectoryEntry entry = Marshal.ByteArrayToStructureLittleEndian(rootDirectory, i, 32);
@@ -1088,7 +1117,8 @@ public sealed partial class FAT
if(entry.adate > 0)
{
sb.AppendFormat(Localization.Volume_last_accessed_on_0_d,
- DateHandlers.DosToDateTime(entry.adate, 0)).AppendLine();
+ DateHandlers.DosToDateTime(entry.adate, 0)).
+ AppendLine();
}
break;
diff --git a/Aaru.Filesystems/FAT/Super.cs b/Aaru.Filesystems/FAT/Super.cs
index f6f2e477e..75283ac27 100644
--- a/Aaru.Filesystems/FAT/Super.cs
+++ b/Aaru.Filesystems/FAT/Super.cs
@@ -128,9 +128,8 @@ public sealed partial class FAT
uint sectorsForRootDirectory = 0;
uint rootDirectoryCluster = 0;
- _encoding = encoding ?? (bpbKind == BpbKind.Human
- ? Encoding.GetEncoding("shift_jis")
- : Encoding.GetEncoding("IBM437"));
+ _encoding = encoding ??
+ (bpbKind == BpbKind.Human ? Encoding.GetEncoding("shift_jis") : Encoding.GetEncoding("IBM437"));
switch(bpbKind)
{
@@ -208,7 +207,8 @@ public sealed partial class FAT
// This will mean that the volume will boot, even if just to say "this is not bootable change disk"......
Metadata.Bootable =
fat32Bpb.jump[0] == 0xEB && fat32Bpb.jump[1] >= minBootNearJump && fat32Bpb.jump[1] < 0x80 ||
- fat32Bpb.jump[0] == 0xE9 && fat32Bpb.jump.Length >= 3 &&
+ fat32Bpb.jump[0] == 0xE9 &&
+ fat32Bpb.jump.Length >= 3 &&
BitConverter.ToUInt16(fat32Bpb.jump, 1) >= minBootNearJump &&
BitConverter.ToUInt16(fat32Bpb.jump, 1) <= 0x1FC;
@@ -294,8 +294,9 @@ public sealed partial class FAT
if(bpbKind != BpbKind.Human)
{
- int reservedSectors = fakeBpb.rsectors + fakeBpb.fats_no * fakeBpb.spfat +
- fakeBpb.root_ent * 32 / fakeBpb.bps;
+ int reservedSectors = fakeBpb.rsectors +
+ fakeBpb.fats_no * fakeBpb.spfat +
+ fakeBpb.root_ent * 32 / fakeBpb.bps;
if(fakeBpb.sectors == 0)
{
@@ -316,8 +317,7 @@ public sealed partial class FAT
// This will walk all the FAT entries and check if they're valid FAT12 or FAT16 entries.
// If the whole table is valid in both senses, it considers the type entry in the BPB.
// BeOS is known to set the type as FAT16 but treat it as FAT12.
- if(!_fat12 &&
- !_fat16)
+ if(!_fat12 && !_fat16)
{
if(clusters < 4089)
{
@@ -360,8 +360,7 @@ public sealed partial class FAT
_fat16 = fat16Valid;
// Check BPB type
- if(_fat12 == _fat16 &&
- fakeBpb.fs_type != null)
+ if(_fat12 == _fat16 && fakeBpb.fs_type != null)
{
_fat12 = Encoding.ASCII.GetString(fakeBpb.fs_type) == "FAT12 ";
_fat16 = Encoding.ASCII.GetString(fakeBpb.fs_type) == "FAT16 ";
@@ -385,9 +384,7 @@ public sealed partial class FAT
if(bpbKind == BpbKind.Atari)
{
- if(atariBpb.serial_no[0] != 0x49 ||
- atariBpb.serial_no[1] != 0x48 ||
- atariBpb.serial_no[2] != 0x43)
+ if(atariBpb.serial_no[0] != 0x49 || atariBpb.serial_no[1] != 0x48 || atariBpb.serial_no[2] != 0x43)
{
Metadata.VolumeSerial = $"{atariBpb.serial_no[0]:X2}{atariBpb.serial_no[1]:X2}{atariBpb.serial_no[2]
:X2}";
@@ -395,7 +392,8 @@ public sealed partial class FAT
_statfs.Id = new FileSystemId
{
IsInt = true,
- Serial32 = (uint)((atariBpb.serial_no[0] << 16) + (atariBpb.serial_no[1] << 8) +
+ Serial32 = (uint)((atariBpb.serial_no[0] << 16) +
+ (atariBpb.serial_no[1] << 8) +
atariBpb.serial_no[2])
};
}
@@ -407,9 +405,7 @@ public sealed partial class FAT
}
else if(fakeBpb.oem_name != null)
{
- if(fakeBpb.oem_name[5] != 0x49 ||
- fakeBpb.oem_name[6] != 0x48 ||
- fakeBpb.oem_name[7] != 0x43)
+ if(fakeBpb.oem_name[5] != 0x49 || fakeBpb.oem_name[6] != 0x48 || fakeBpb.oem_name[7] != 0x43)
{
Metadata.SystemIdentifier = fakeBpb.oem_name[0] switch
{
@@ -443,9 +439,8 @@ public sealed partial class FAT
fakeBpb.oem_name[6] >= 0x20 &&
fakeBpb.oem_name[6] <= 0x7F &&
fakeBpb.oem_name[7] >= 0x20 &&
- fakeBpb.oem_name[7] <= 0x7F => StringHandlers.CToString(
- fakeBpb.oem_name, _encoding,
- start: 1),
+ fakeBpb.oem_name[7] <= 0x7F =>
+ StringHandlers.CToString(fakeBpb.oem_name, _encoding, start: 1),
_ => Metadata.SystemIdentifier
};
}
@@ -489,12 +484,12 @@ public sealed partial class FAT
// Check that jumps to a correct boot code position and has boot signature set.
// This will mean that the volume will boot, even if just to say "this is not bootable change disk"......
- if(Metadata.Bootable == false &&
- fakeBpb.jump != null)
+ if(Metadata.Bootable == false && fakeBpb.jump != null)
{
Metadata.Bootable |=
fakeBpb.jump[0] == 0xEB && fakeBpb.jump[1] >= minBootNearJump && fakeBpb.jump[1] < 0x80 ||
- fakeBpb.jump[0] == 0xE9 && fakeBpb.jump.Length >= 3 &&
+ fakeBpb.jump[0] == 0xE9 &&
+ fakeBpb.jump.Length >= 3 &&
BitConverter.ToUInt16(fakeBpb.jump, 1) >= minBootNearJump &&
BitConverter.ToUInt16(fakeBpb.jump, 1) <= 0x1FC;
}
@@ -537,7 +532,10 @@ public sealed partial class FAT
{
var rootMs = new MemoryStream();
- foreach(ulong rootSector in new ulong[] { 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20 })
+ foreach(ulong rootSector in new ulong[]
+ {
+ 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20
+ })
{
errno = imagePlugin.ReadSector(rootSector, out byte[] tmp);
@@ -560,8 +558,8 @@ public sealed partial class FAT
foreach(uint cluster in rootDirectoryClusters)
{
- errno = imagePlugin.ReadSectors(_firstClusterSector + cluster * _sectorsPerCluster,
- _sectorsPerCluster, out byte[] buffer);
+ errno = imagePlugin.ReadSectors(_firstClusterSector + cluster * _sectorsPerCluster, _sectorsPerCluster,
+ out byte[] buffer);
if(errno != ErrorNumber.NoError)
return errno;
@@ -593,8 +591,7 @@ public sealed partial class FAT
if(entry.attributes.HasFlag(FatAttributes.LFN))
{
- if(_namespace != Namespace.Lfn &&
- _namespace != Namespace.Ecs)
+ if(_namespace != Namespace.Lfn && _namespace != Namespace.Ecs)
continue;
LfnEntry lfnEntry =
@@ -627,8 +624,7 @@ public sealed partial class FAT
}
// Not a correct entry
- if(entry.filename[0] < DIRENT_MIN &&
- entry.filename[0] != DIRENT_E5)
+ if(entry.filename[0] < DIRENT_MIN && entry.filename[0] != DIRENT_E5)
continue;
// Self
@@ -680,8 +676,7 @@ public sealed partial class FAT
Dirent = entry
};
- if(_namespace is Namespace.Lfn or Namespace.Ecs &&
- lastLfnName != null)
+ if(_namespace is Namespace.Lfn or Namespace.Ecs && lastLfnName != null)
{
byte calculatedLfnChecksum = LfnChecksum(entry.filename, entry.extension);
@@ -715,13 +710,11 @@ public sealed partial class FAT
else
filename = name;
- if(name == "" &&
- extension == "")
+ if(name == "" && extension == "")
{
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_empty_filename_in_root_directory);
- if(!_debug ||
- entry is { size: > 0, start_cluster: 0 })
+ if(!_debug || entry is { size: > 0, start_cluster: 0 })
continue; // Skip invalid name
// If debug, add it
@@ -766,8 +759,7 @@ public sealed partial class FAT
completeEntry.HumanName = filename;
}
- if(!_fat32 &&
- filename == "EA DATA. SF")
+ if(!_fat32 && filename == "EA DATA. SF")
{
_eaDirEntry = entry;
lastLfnName = null;
@@ -917,12 +909,9 @@ public sealed partial class FAT
_eaCache = new Dictionary>();
// Check OS/2 .LONGNAME
- if(_eaCache != null &&
- _namespace is Namespace.Os2 or Namespace.Ecs &&
- !_fat32)
+ if(_eaCache != null && _namespace is Namespace.Os2 or Namespace.Ecs && !_fat32)
{
- var rootFilesWithEas =
- _rootDirectoryCache.Where(t => t.Value.Dirent.ea_handle != 0).ToList();
+ var rootFilesWithEas = _rootDirectoryCache.Where(t => t.Value.Dirent.ea_handle != 0).ToList();
foreach(KeyValuePair fileWithEa in rootFilesWithEas)
{
@@ -963,8 +952,8 @@ public sealed partial class FAT
// Check FAT32.IFS EAs
if(_fat32 || _debug)
{
- var fat32EaSidecars =
- _rootDirectoryCache.Where(t => t.Key.EndsWith(FAT32_EA_TAIL, true, _cultureInfo)).ToList();
+ var fat32EaSidecars = _rootDirectoryCache.Where(t => t.Key.EndsWith(FAT32_EA_TAIL, true, _cultureInfo)).
+ ToList();
foreach(KeyValuePair sidecar in fat32EaSidecars)
{
diff --git a/Aaru.Filesystems/FAT/Xattr.cs b/Aaru.Filesystems/FAT/Xattr.cs
index e78eaad03..00b95a1d4 100644
--- a/Aaru.Filesystems/FAT/Xattr.cs
+++ b/Aaru.Filesystems/FAT/Xattr.cs
@@ -51,8 +51,7 @@ public sealed partial class FAT
return ErrorNumber.AccessDenied;
// No other xattr recognized yet
- if(_cachedEaData is null &&
- !_fat32)
+ if(_cachedEaData is null && !_fat32)
return ErrorNumber.NotSupported;
if(path[0] == '/')
@@ -67,8 +66,7 @@ public sealed partial class FAT
ErrorNumber err = GetFileEntry(path, out CompleteDirectoryEntry entry);
- if(err != ErrorNumber.NoError ||
- entry is null)
+ if(err != ErrorNumber.NoError || entry is null)
return err;
xattrs = new List();
@@ -187,8 +185,7 @@ public sealed partial class FAT
Dictionary GetEas(byte[] eaData)
{
- if(eaData is null ||
- eaData.Length < 4)
+ if(eaData is null || eaData.Length < 4)
return null;
Dictionary eas = new();
diff --git a/Aaru.Filesystems/FATX/Dir.cs b/Aaru.Filesystems/FATX/Dir.cs
index a30d4436a..4e76fc1ab 100644
--- a/Aaru.Filesystems/FATX/Dir.cs
+++ b/Aaru.Filesystems/FATX/Dir.cs
@@ -47,8 +47,7 @@ public sealed partial class XboxFatPlugin
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(string.IsNullOrWhiteSpace(path) ||
- path == "/")
+ if(string.IsNullOrWhiteSpace(path) || path == "/")
{
node = new FatxDirNode
{
@@ -74,7 +73,10 @@ public sealed partial class XboxFatPlugin
return ErrorNumber.NoError;
}
- string[] pieces = cutPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pieces = cutPath.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
KeyValuePair entry =
_rootDirectory.FirstOrDefault(t => t.Key.ToLower(_cultureInfo) == pieces[0]);
diff --git a/Aaru.Filesystems/FATX/FATX.cs b/Aaru.Filesystems/FATX/FATX.cs
index fbc3bf6d0..08fc04707 100644
--- a/Aaru.Filesystems/FATX/FATX.cs
+++ b/Aaru.Filesystems/FATX/FATX.cs
@@ -103,6 +103,8 @@ public sealed partial class XboxFatPlugin : IReadOnlyFilesystem
static Dictionary GetDefaultOptions() => new()
{
- { "debug", false.ToString() }
+ {
+ "debug", false.ToString()
+ }
};
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/FATX/File.cs b/Aaru.Filesystems/FATX/File.cs
index 3d85b7d8d..bc6c06fb7 100644
--- a/Aaru.Filesystems/FATX/File.cs
+++ b/Aaru.Filesystems/FATX/File.cs
@@ -73,8 +73,7 @@ public sealed partial class XboxFatPlugin
if(err != ErrorNumber.NoError)
return err;
- if(stat.Attributes.HasFlag(FileAttributes.Directory) &&
- !_debug)
+ if(stat.Attributes.HasFlag(FileAttributes.Directory) && !_debug)
return ErrorNumber.IsDirectory;
uint[] clusters = GetClusters((uint)stat.Inode);
@@ -112,8 +111,7 @@ public sealed partial class XboxFatPlugin
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(buffer is null ||
- buffer.Length < length)
+ if(buffer is null || buffer.Length < length)
return ErrorNumber.InvalidArgument;
if(node is not FatxFileNode mynode)
@@ -249,8 +247,7 @@ public sealed partial class XboxFatPlugin
if(_fat16 is null)
{
- while((nextCluster & FAT32_MASK) > 0 &&
- (nextCluster & FAT32_MASK) <= FAT32_RESERVED)
+ while((nextCluster & FAT32_MASK) > 0 && (nextCluster & FAT32_MASK) <= FAT32_RESERVED)
{
clusters.Add(nextCluster);
nextCluster = _fat32[nextCluster];
@@ -274,7 +271,10 @@ public sealed partial class XboxFatPlugin
string cutPath = path.StartsWith('/') ? path[1..].ToLower(_cultureInfo) : path.ToLower(_cultureInfo);
- string[] pieces = cutPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pieces = cutPath.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pieces.Length == 0)
return ErrorNumber.InvalidArgument;
diff --git a/Aaru.Filesystems/FATX/Info.cs b/Aaru.Filesystems/FATX/Info.cs
index 4a7c72710..d9b534e42 100644
--- a/Aaru.Filesystems/FATX/Info.cs
+++ b/Aaru.Filesystems/FATX/Info.cs
@@ -90,7 +90,8 @@ public sealed partial class XboxFatPlugin
sb.AppendLine(Localization.FATX_filesystem);
sb.AppendFormat(Localization._0_logical_sectors_1_bytes_per_physical_sector, logicalSectorsPerPhysicalSectors,
- logicalSectorsPerPhysicalSectors * imagePlugin.Info.SectorSize).AppendLine();
+ logicalSectorsPerPhysicalSectors * imagePlugin.Info.SectorSize).
+ AppendLine();
sb.AppendFormat(Localization._0_sectors_1_bytes_per_cluster, fatxSb.sectorsPerCluster,
fatxSb.sectorsPerCluster * logicalSectorsPerPhysicalSectors * imagePlugin.Info.SectorSize).
@@ -109,7 +110,8 @@ public sealed partial class XboxFatPlugin
metadata = new FileSystem
{
Type = FS_TYPE,
- ClusterSize = (uint)(fatxSb.sectorsPerCluster * logicalSectorsPerPhysicalSectors *
+ ClusterSize = (uint)(fatxSb.sectorsPerCluster *
+ logicalSectorsPerPhysicalSectors *
imagePlugin.Info.SectorSize),
VolumeName = volumeLabel,
VolumeSerial = $"{fatxSb.id:X8}"
diff --git a/Aaru.Filesystems/FATX/Super.cs b/Aaru.Filesystems/FATX/Super.cs
index 647f8e09b..dd2e18d77 100644
--- a/Aaru.Filesystems/FATX/Super.cs
+++ b/Aaru.Filesystems/FATX/Super.cs
@@ -96,7 +96,8 @@ public sealed partial class XboxFatPlugin
Metadata = new FileSystem
{
Type = Localization.FATX_filesystem,
- ClusterSize = (uint)(_superblock.sectorsPerCluster * logicalSectorsPerPhysicalSectors *
+ ClusterSize = (uint)(_superblock.sectorsPerCluster *
+ logicalSectorsPerPhysicalSectors *
imagePlugin.Info.SectorSize),
VolumeName = volumeLabel,
VolumeSerial = $"{_superblock.id:X8}"
diff --git a/Aaru.Filesystems/FFS/Info.cs b/Aaru.Filesystems/FFS/Info.cs
index 5e7641a72..81a1e4622 100644
--- a/Aaru.Filesystems/FFS/Info.cs
+++ b/Aaru.Filesystems/FFS/Info.cs
@@ -297,8 +297,7 @@ public sealed partial class FFSPlugin
}
// This is for sure, as it is shared with a sectors/track with non-x86 SunOS, Epoch is absurdly high for that
- if(sb.fs_old_npsect > SunOSEpoch &&
- DateHandlers.UnixToDateTime(sb.fs_old_npsect) < DateTime.Now)
+ if(sb.fs_old_npsect > SunOSEpoch && DateHandlers.UnixToDateTime(sb.fs_old_npsect) < DateTime.Now)
{
fs_type_42bsd = false;
fs_type_sun86 = true;
@@ -306,8 +305,7 @@ public sealed partial class FFSPlugin
fs_type_43bsd = false;
}
- if(sb.fs_cgrotor > 0x00000000 &&
- (uint)sb.fs_cgrotor < 0xFFFFFFFF)
+ if(sb.fs_cgrotor > 0x00000000 && (uint)sb.fs_cgrotor < 0xFFFFFFFF)
{
fs_type_42bsd = false;
fs_type_sun = false;
@@ -365,13 +363,15 @@ public sealed partial class FFSPlugin
metadata.ModificationDate = DateHandlers.UnixToDateTime(sb.fs_old_time);
sbInformation.AppendFormat(Localization._0_blocks_in_volume_1_bytes, sb.fs_old_size,
- (long)sb.fs_old_size * sb.fs_fsize).AppendLine();
+ (long)sb.fs_old_size * sb.fs_fsize).
+ AppendLine();
metadata.Clusters = (ulong)sb.fs_old_size;
metadata.ClusterSize = (uint)sb.fs_fsize;
sbInformation.AppendFormat(Localization._0_data_blocks_in_volume_1_bytes, sb.fs_old_dsize,
- (long)sb.fs_old_dsize * sb.fs_fsize).AppendLine();
+ (long)sb.fs_old_dsize * sb.fs_fsize).
+ AppendLine();
sbInformation.AppendFormat(Localization._0_cylinder_groups_in_volume, sb.fs_ncg).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_in_a_basic_block, sb.fs_bsize).AppendLine();
@@ -448,7 +448,8 @@ public sealed partial class FFSPlugin
sbInformation.AppendFormat(Localization._0_directories, sb.fs_old_cstotal.cs_ndir).AppendLine();
sbInformation.AppendFormat(Localization._0_free_blocks_1_bytes, sb.fs_old_cstotal.cs_nbfree,
- (long)sb.fs_old_cstotal.cs_nbfree * sb.fs_fsize).AppendLine();
+ (long)sb.fs_old_cstotal.cs_nbfree * sb.fs_fsize).
+ AppendLine();
metadata.FreeClusters = (ulong)sb.fs_old_cstotal.cs_nbfree;
sbInformation.AppendFormat(Localization._0_free_inodes, sb.fs_old_cstotal.cs_nifree).AppendLine();
@@ -494,7 +495,8 @@ public sealed partial class FFSPlugin
sbInformation.AppendFormat(Localization._0_directories, sb.fs_cstotal.cs_ndir).AppendLine();
sbInformation.AppendFormat(Localization._0_free_blocks_1_bytes, sb.fs_cstotal.cs_nbfree,
- sb.fs_cstotal.cs_nbfree * sb.fs_fsize).AppendLine();
+ sb.fs_cstotal.cs_nbfree * sb.fs_fsize).
+ AppendLine();
metadata.FreeClusters = (ulong)sb.fs_cstotal.cs_nbfree;
sbInformation.AppendFormat(Localization._0_free_inodes, sb.fs_cstotal.cs_nifree).AppendLine();
diff --git a/Aaru.Filesystems/HAMMER/Info.cs b/Aaru.Filesystems/HAMMER/Info.cs
index 511c7e317..89df4bbb9 100644
--- a/Aaru.Filesystems/HAMMER/Info.cs
+++ b/Aaru.Filesystems/HAMMER/Info.cs
@@ -124,10 +124,12 @@ public sealed partial class HAMMER
if(superBlock.vol_no == superBlock.vol_rootvol)
{
sb.AppendFormat(Localization.Filesystem_contains_0_big_blocks_1_bytes, superBlock.vol0_stat_bigblocks,
- superBlock.vol0_stat_bigblocks * HAMMER_BIGBLOCK_SIZE).AppendLine();
+ superBlock.vol0_stat_bigblocks * HAMMER_BIGBLOCK_SIZE).
+ AppendLine();
sb.AppendFormat(Localization.Filesystem_has_0_big_blocks_free_1_bytes, superBlock.vol0_stat_freebigblocks,
- superBlock.vol0_stat_freebigblocks * HAMMER_BIGBLOCK_SIZE).AppendLine();
+ superBlock.vol0_stat_freebigblocks * HAMMER_BIGBLOCK_SIZE).
+ AppendLine();
sb.AppendFormat(Localization.Filesystem_has_0_inodes_used, superBlock.vol0_stat_inodes).AppendLine();
diff --git a/Aaru.Filesystems/HPFS/Info.cs b/Aaru.Filesystems/HPFS/Info.cs
index 95989cab6..952f80aab 100644
--- a/Aaru.Filesystems/HPFS/Info.cs
+++ b/Aaru.Filesystems/HPFS/Info.cs
@@ -230,10 +230,7 @@ public sealed partial class HPFS
metadata = new FileSystem();
// Theoretically everything from BPB to SB is boot code, should I hash everything or only the sector loaded by BIOS itself?
- if(bpb.jump[0] == 0xEB &&
- bpb.jump[1] > 0x3C &&
- bpb.jump[1] < 0x80 &&
- bpb.signature2 == 0xAA55)
+ if(bpb.jump[0] == 0xEB && bpb.jump[1] > 0x3C && bpb.jump[1] < 0x80 && bpb.signature2 == 0xAA55)
{
metadata.Bootable = true;
string bootChk = Sha1Context.Data(bpb.boot_code, out byte[] _);
diff --git a/Aaru.Filesystems/HPOFS/Consts.cs b/Aaru.Filesystems/HPOFS/Consts.cs
index 491ca2708..1f3f5d6aa 100644
--- a/Aaru.Filesystems/HPOFS/Consts.cs
+++ b/Aaru.Filesystems/HPOFS/Consts.cs
@@ -33,6 +33,9 @@ public sealed partial class HPOFS
// Do not translate
const string FS_TYPE = "hpofs";
readonly byte[] _medinfoSignature = "MEDINFO "u8.ToArray();
- readonly byte[] _type = { 0x48, 0x50, 0x4F, 0x46, 0x53, 0x00, 0x00, 0x00 };
+ readonly byte[] _type =
+ {
+ 0x48, 0x50, 0x4F, 0x46, 0x53, 0x00, 0x00, 0x00
+ };
readonly byte[] _volinfoSignature = "VOLINFO "u8.ToArray();
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/HPOFS/Info.cs b/Aaru.Filesystems/HPOFS/Info.cs
index 906dac540..9691baf7b 100644
--- a/Aaru.Filesystems/HPOFS/Info.cs
+++ b/Aaru.Filesystems/HPOFS/Info.cs
@@ -170,8 +170,7 @@ public sealed partial class HPOFS
AaruConsole.DebugWriteLine(MODULE_NAME, "vib.unknown4 = \"{0}\"",
StringHandlers.SpacePaddedToString(vib.unknown4));
- AaruConsole.DebugWriteLine(MODULE_NAME, "vib.owner = \"{0}\"",
- StringHandlers.SpacePaddedToString(vib.owner));
+ AaruConsole.DebugWriteLine(MODULE_NAME, "vib.owner = \"{0}\"", StringHandlers.SpacePaddedToString(vib.owner));
AaruConsole.DebugWriteLine(MODULE_NAME, "vib.unknown5 = \"{0}\"",
StringHandlers.SpacePaddedToString(vib.unknown5));
@@ -205,12 +204,14 @@ public sealed partial class HPOFS
AppendLine();
sb.AppendFormat(Localization.Volume_created_on_0,
- DateHandlers.DosToDateTime(mib.creationDate, mib.creationTime)).AppendLine();
+ DateHandlers.DosToDateTime(mib.creationDate, mib.creationTime)).
+ AppendLine();
sb.AppendFormat(Localization.Volume_uses_0_codepage_1,
mib.codepageType is > 0 and < 3
? mib.codepageType == 2 ? Localization.EBCDIC : Localization.ASCII
- : Localization.Unknown_codepage, mib.codepage).AppendLine();
+ : Localization.Unknown_codepage, mib.codepage).
+ AppendLine();
sb.AppendFormat(Localization.RPS_level_0, mib.rps).AppendLine();
sb.AppendFormat(Localization.Filesystem_version_0_1, mib.major, mib.minor).AppendLine();
diff --git a/Aaru.Filesystems/ISO9660/Date.cs b/Aaru.Filesystems/ISO9660/Date.cs
index 2d4be8ad3..b5f7e5ee9 100644
--- a/Aaru.Filesystems/ISO9660/Date.cs
+++ b/Aaru.Filesystems/ISO9660/Date.cs
@@ -36,10 +36,9 @@ public sealed partial class ISO9660
{
static DateTime? DecodeIsoDateTime(byte[] timestamp) => timestamp?.Length switch
{
- 7 => DecodeIsoDateTime(
- Marshal.
- ByteArrayToStructureLittleEndian(
- timestamp)),
+ 7 => DecodeIsoDateTime(Marshal.
+ ByteArrayToStructureLittleEndian<
+ IsoTimestamp>(timestamp)),
17 => DateHandlers.Iso9660ToDateTime(timestamp),
_ => null
};
diff --git a/Aaru.Filesystems/ISO9660/Dir.cs b/Aaru.Filesystems/ISO9660/Dir.cs
index fcdb6198f..1e6a6d4db 100644
--- a/Aaru.Filesystems/ISO9660/Dir.cs
+++ b/Aaru.Filesystems/ISO9660/Dir.cs
@@ -53,8 +53,7 @@ public sealed partial class ISO9660
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(string.IsNullOrWhiteSpace(path) ||
- path == "/")
+ if(string.IsNullOrWhiteSpace(path) || path == "/")
{
node = new Iso9660DirNode
{
@@ -82,7 +81,10 @@ public sealed partial class ISO9660
return ErrorNumber.NoError;
}
- string[] pieces = cutPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pieces = cutPath.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
KeyValuePair entry =
_rootDirectoryCache.FirstOrDefault(t => t.Key.Equals(pieces[0], StringComparison.CurrentCultureIgnoreCase));
@@ -99,8 +101,9 @@ public sealed partial class ISO9660
for(var p = 0; p < pieces.Length; p++)
{
- entry = currentDirectory.FirstOrDefault(
- t => t.Key.Equals(pieces[p], StringComparison.CurrentCultureIgnoreCase));
+ entry =
+ currentDirectory.FirstOrDefault(t => t.Key.Equals(pieces[p],
+ StringComparison.CurrentCultureIgnoreCase));
if(string.IsNullOrEmpty(entry.Key))
return ErrorNumber.NoSuchFile;
@@ -116,22 +119,25 @@ public sealed partial class ISO9660
if(entry.Value.Extents.Count == 0)
return ErrorNumber.InvalidArgument;
- currentDirectory = _cdi
- ? DecodeCdiDirectory(entry.Value.Extents[0].extent + entry.Value.XattrLength,
- entry.Value.Extents[0].size)
- : _highSierra
- ? DecodeHighSierraDirectory(
- entry.Value.Extents[0].extent + entry.Value.XattrLength,
- entry.Value.Extents[0].size)
- : DecodeIsoDirectory(entry.Value.Extents[0].extent + entry.Value.XattrLength,
- entry.Value.Extents[0].size);
+ currentDirectory =
+ _cdi
+ ?
+ DecodeCdiDirectory(entry.Value.Extents[0].extent + entry.Value.XattrLength,
+ entry.Value.Extents[0].size)
+ : _highSierra
+ ? DecodeHighSierraDirectory(entry.Value.Extents[0].extent + entry.Value.XattrLength,
+ entry.Value.Extents[0].size)
+ : DecodeIsoDirectory(entry.Value.Extents[0].extent + entry.Value.XattrLength,
+ entry.Value.Extents[0].size);
if(_usePathTable)
{
foreach(DecodedDirectoryEntry subDirectory in _cdi
? GetSubdirsFromCdiPathTable(currentPath)
- : _highSierra
- ? GetSubdirsFromHighSierraPathTable(currentPath)
+ :
+ _highSierra
+ ?
+ GetSubdirsFromHighSierraPathTable(currentPath)
: GetSubdirsFromIsoPathTable(currentPath))
currentDirectory[subDirectory.Filename] = subDirectory;
}
@@ -238,8 +244,7 @@ public sealed partial class ISO9660
// Special entries for current and parent directories, skip them
if(record.name_len == 1)
{
- if(data[entryOff + _directoryRecordSize] == 0 ||
- data[entryOff + _directoryRecordSize] == 1)
+ if(data[entryOff + _directoryRecordSize] == 0 || data[entryOff + _directoryRecordSize] == 1)
{
entryOff += record.length;
@@ -278,8 +283,7 @@ public sealed partial class ISO9660
if(entry.CdiSystemArea.Value.attributes.HasFlag(CdiAttributes.Directory))
entry.Flags |= FileFlags.Directory;
- if(!entry.CdiSystemArea.Value.attributes.HasFlag(CdiAttributes.Directory) ||
- !_usePathTable)
+ if(!entry.CdiSystemArea.Value.attributes.HasFlag(CdiAttributes.Directory) || !_usePathTable)
entries[entry.Filename] = entry;
entryOff += record.length;
@@ -320,8 +324,7 @@ public sealed partial class ISO9660
// Special entries for current and parent directories, skip them
if(record.name_len == 1)
{
- if(data[entryOff + _directoryRecordSize] == 0 ||
- data[entryOff + _directoryRecordSize] == 1)
+ if(data[entryOff + _directoryRecordSize] == 0 || data[entryOff + _directoryRecordSize] == 1)
{
entryOff += record.length;
@@ -393,8 +396,7 @@ public sealed partial class ISO9660
// Special entries for current and parent directories, skip them
if(record.name_len == 1)
{
- if(data[entryOff + _directoryRecordSize] == 0 ||
- data[entryOff + _directoryRecordSize] == 1)
+ if(data[entryOff + _directoryRecordSize] == 0 || data[entryOff + _directoryRecordSize] == 1)
{
entryOff += record.length;
@@ -406,11 +408,10 @@ public sealed partial class ISO9660
{
Size = record.size,
Flags = record.flags,
- Filename =
- _joliet
- ? Encoding.BigEndianUnicode.GetString(data, entryOff + _directoryRecordSize,
- record.name_len)
- : Encoding.GetString(data, entryOff + _directoryRecordSize, record.name_len),
+ Filename = _joliet
+ ? Encoding.BigEndianUnicode.GetString(data, entryOff + _directoryRecordSize,
+ record.name_len)
+ : Encoding.GetString(data, entryOff + _directoryRecordSize, record.name_len),
FileUnitSize = record.file_unit_size,
Interleave = record.interleave,
VolumeSequenceNumber = record.volume_sequence_number,
@@ -614,8 +615,7 @@ public sealed partial class ISO9660
var appleId = (AppleId)data[systemAreaOff + 3];
// Old AAIP
- if(appleId == AppleId.ProDOS &&
- appleLength != 7)
+ if(appleId == AppleId.ProDOS && appleLength != 7)
goto case AAIP_MAGIC;
switch(appleId)
@@ -831,8 +831,7 @@ public sealed partial class ISO9660
systemAreaOff + Marshal.SizeOf(),
Marshal.SizeOf());
- if(!continueSymlink ||
- entry.SymbolicLink is null)
+ if(!continueSymlink || entry.SymbolicLink is null)
entry.SymbolicLink = "";
if(slc.flags.HasFlag(SymlinkComponentFlags.Root))
@@ -844,18 +843,20 @@ public sealed partial class ISO9660
if(slc.flags.HasFlag(SymlinkComponentFlags.Parent))
entry.SymbolicLink += "..";
- if(!continueSymlinkComponent &&
- !slc.flags.HasFlag(SymlinkComponentFlags.Root))
+ if(!continueSymlinkComponent && !slc.flags.HasFlag(SymlinkComponentFlags.Root))
entry.SymbolicLink += "/";
entry.SymbolicLink += slc.flags.HasFlag(SymlinkComponentFlags.Networkname)
- ? Environment.MachineName
+ ?
+ Environment.MachineName
: _joliet
? Encoding.BigEndianUnicode.GetString(data,
- systemAreaOff + Marshal.SizeOf() +
+ systemAreaOff +
+ Marshal.SizeOf() +
Marshal.SizeOf(), slc.length)
: Encoding.GetString(data,
- systemAreaOff + Marshal.SizeOf() +
+ systemAreaOff +
+ Marshal.SizeOf() +
Marshal.SizeOf(),
slc.length);
@@ -877,7 +878,7 @@ public sealed partial class ISO9660
AlternateName alternateName =
Marshal.ByteArrayToStructureLittleEndian(data, systemAreaOff,
- Marshal.SizeOf());
+ Marshal.SizeOf());
byte[] nm;
@@ -1049,8 +1050,7 @@ public sealed partial class ISO9660
errno = ReadSingleExtent(ca.offset, ca.ca_length, ca.block, out byte[] caData);
// TODO: Check continuation area definition, this is not a proper fix
- if(errno == ErrorNumber.NoError &&
- caData.Length > 0)
+ if(errno == ErrorNumber.NoError && caData.Length > 0)
DecodeSystemArea(caData, 0, (int)ca.ca_length, ref entry, out hasResourceFork);
systemAreaOff += ceLength;
@@ -1114,7 +1114,10 @@ public sealed partial class ISO9660
? path[1..].ToLower(CultureInfo.CurrentUICulture)
: path.ToLower(CultureInfo.CurrentUICulture);
- string[] pieces = cutPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pieces = cutPath.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
var currentParent = 1;
var currentPiece = 0;
@@ -1122,7 +1125,10 @@ public sealed partial class ISO9660
while(currentPiece < pieces.Length)
{
PathTableEntryInternal currentEntry = _pathTable.FirstOrDefault(p => p.Parent == currentParent &&
- p.Name.Equals(pieces[currentPiece], StringComparison.CurrentCultureIgnoreCase));
+ p.Name.
+ Equals(pieces[currentPiece],
+ StringComparison.
+ CurrentCultureIgnoreCase));
if(currentEntry is null)
break;
diff --git a/Aaru.Filesystems/ISO9660/File.cs b/Aaru.Filesystems/ISO9660/File.cs
index 947288912..818354f14 100644
--- a/Aaru.Filesystems/ISO9660/File.cs
+++ b/Aaru.Filesystems/ISO9660/File.cs
@@ -77,8 +77,7 @@ public sealed partial class ISO9660
if(err != ErrorNumber.NoError)
return err;
- if(entry.Flags.HasFlag(FileFlags.Directory) &&
- !_debug)
+ if(entry.Flags.HasFlag(FileFlags.Directory) && !_debug)
return ErrorNumber.IsDirectory;
if(entry.Extents is null)
@@ -118,8 +117,7 @@ public sealed partial class ISO9660
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(buffer is null ||
- buffer.Length < length)
+ if(buffer is null || buffer.Length < length)
return ErrorNumber.InvalidArgument;
if(node is not Iso9660FileNode mynode)
@@ -382,9 +380,7 @@ public sealed partial class ISO9660
if(entry.SymbolicLink != null)
stat.Attributes |= FileAttributes.Symlink;
- if(entry.XattrLength == 0 ||
- _cdi ||
- _highSierra)
+ if(entry.XattrLength == 0 || _cdi || _highSierra)
return ErrorNumber.NoError;
if(entry.CdiSystemArea != null)
@@ -475,7 +471,10 @@ public sealed partial class ISO9660
? path[1..].ToLower(CultureInfo.CurrentUICulture)
: path.ToLower(CultureInfo.CurrentUICulture);
- string[] pieces = cutPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pieces = cutPath.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pieces.Length == 0)
return ErrorNumber.InvalidArgument;
@@ -504,11 +503,10 @@ public sealed partial class ISO9660
if(string.IsNullOrEmpty(dirent.Key))
{
- if(!_joliet &&
- !pieces[^1].EndsWith(";1", StringComparison.Ordinal))
+ if(!_joliet && !pieces[^1].EndsWith(";1", StringComparison.Ordinal))
{
- dirent = parent.FirstOrDefault(
- t => t.Key.Equals(pieces[^1] + ";1", StringComparison.CurrentCultureIgnoreCase));
+ dirent = parent.FirstOrDefault(t => t.Key.Equals(pieces[^1] + ";1",
+ StringComparison.CurrentCultureIgnoreCase));
if(string.IsNullOrEmpty(dirent.Key))
return ErrorNumber.NoSuchFile;
diff --git a/Aaru.Filesystems/ISO9660/ISO9660.cs b/Aaru.Filesystems/ISO9660/ISO9660.cs
index 4eca2fb36..7b9674a49 100644
--- a/Aaru.Filesystems/ISO9660/ISO9660.cs
+++ b/Aaru.Filesystems/ISO9660/ISO9660.cs
@@ -79,24 +79,37 @@ public sealed partial class ISO9660 : IReadOnlyFilesystem
new (string name, Type type, string description)[]
{
("use_path_table", typeof(bool), "Use path table for directory traversal"),
- ("use_trans_tbl", typeof(bool), "Use TRANS.TBL for filenames"), ("use_evd", typeof(bool),
- "If present, use Enhanced Volume Descriptor with specified encoding (overrides namespace)")
+ ("use_trans_tbl", typeof(bool), "Use TRANS.TBL for filenames"),
+ ("use_evd", typeof(bool),
+ "If present, use Enhanced Volume Descriptor with specified encoding (overrides namespace)")
};
///
public Dictionary Namespaces => new()
{
- { "normal", "Primary Volume Descriptor, ignoring ;1 suffixes" },
- { "vms", "Primary Volume Descriptor, showing version suffixes" },
- { "joliet", "Joliet Volume Descriptor (default)" },
- { "rrip", "Rock Ridge" },
- { "romeo", "Primary Volume Descriptor using the specified encoding codepage" }
+ {
+ "normal", "Primary Volume Descriptor, ignoring ;1 suffixes"
+ },
+ {
+ "vms", "Primary Volume Descriptor, showing version suffixes"
+ },
+ {
+ "joliet", "Joliet Volume Descriptor (default)"
+ },
+ {
+ "rrip", "Rock Ridge"
+ },
+ {
+ "romeo", "Primary Volume Descriptor using the specified encoding codepage"
+ }
};
#endregion
static Dictionary GetDefaultOptions() => new()
{
- { "debug", false.ToString() }
+ {
+ "debug", false.ToString()
+ }
};
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/ISO9660/Info.cs b/Aaru.Filesystems/ISO9660/Info.cs
index 11278bf90..62f898f15 100644
--- a/Aaru.Filesystems/ISO9660/Info.cs
+++ b/Aaru.Filesystems/ISO9660/Info.cs
@@ -82,7 +82,8 @@ public sealed partial class ISO9660
AaruConsole.DebugWriteLine(MODULE_NAME, "HSMagic = {0}", Encoding.ASCII.GetString(hsMagic));
return Encoding.ASCII.GetString(vdMagic) == ISO_MAGIC ||
- Encoding.ASCII.GetString(hsMagic) == HIGH_SIERRA_MAGIC || Encoding.ASCII.GetString(vdMagic) == CDI_MAGIC;
+ Encoding.ASCII.GetString(hsMagic) == HIGH_SIERRA_MAGIC ||
+ Encoding.ASCII.GetString(vdMagic) == CDI_MAGIC;
}
///
@@ -211,8 +212,7 @@ public sealed partial class ISO9660
// Check if this is Joliet
if(svd.version == 1)
{
- if(svd.escape_sequences[0] == '%' &&
- svd.escape_sequences[1] == '/')
+ if(svd.escape_sequences[0] == '%' && svd.escape_sequences[1] == '/')
{
if(svd.escape_sequences[2] == '@' ||
svd.escape_sequences[2] == 'C' ||
@@ -247,9 +247,7 @@ public sealed partial class ISO9660
metadata = new FileSystem();
- if(pvd == null &&
- hsvd == null &&
- fsvd == null)
+ if(pvd == null && hsvd == null && fsvd == null)
{
information = Localization.ERROR_Could_not_find_primary_volume_descriptor;
@@ -314,8 +312,7 @@ public sealed partial class ISO9660
}
// Walk thru root directory to see system area extensions in use
- while(rootOff + Marshal.SizeOf() < rootDir.Length &&
- !cdiInfo)
+ while(rootOff + Marshal.SizeOf() < rootDir.Length && !cdiInfo)
{
DirectoryRecord record =
Marshal.ByteArrayToStructureLittleEndian(rootDir, rootOff,
@@ -325,8 +322,7 @@ public sealed partial class ISO9660
saOff += saOff % 2;
int saLen = record.length - saOff;
- if(saLen > 0 &&
- rootOff + saOff + saLen <= rootDir.Length)
+ if(saLen > 0 && rootOff + saOff + saLen <= rootDir.Length)
{
var sa = new byte[saLen];
Array.Copy(rootDir, rootOff + saOff, sa, 0, saLen);
@@ -406,8 +402,7 @@ public sealed partial class ISO9660
switch(nextSignature)
{
case APPLE_MAGIC:
- if(sa[saOff + 3] == 1 &&
- sa[saOff + 2] == 7)
+ if(sa[saOff + 3] == 1 && sa[saOff + 2] == 7)
apple = true;
else
apple |= sa[saOff + 3] != 1;
@@ -438,8 +433,8 @@ public sealed partial class ISO9660
ziso |= nextSignature == ZISO_MAGIC;
amiga |= nextSignature == AMIGA_MAGIC;
- aaip |= nextSignature == AAIP_MAGIC || nextSignature == AAIP_MAGIC_OLD &&
- sa[saOff + 3] == 1 && sa[saOff + 2] >= 9;
+ aaip |= nextSignature == AAIP_MAGIC ||
+ nextSignature == AAIP_MAGIC_OLD && sa[saOff + 3] == 1 && sa[saOff + 2] >= 9;
saOff += sa[saOff + 2];
@@ -467,7 +462,8 @@ public sealed partial class ISO9660
(highSierraInfo ? hsvd.Value.logical_block_size : pvd.Value.logical_block_size);
if((ca.ca_length_be + ca.offset_be) %
- (highSierraInfo ? hsvd.Value.logical_block_size : pvd.Value.logical_block_size) > 0)
+ (highSierraInfo ? hsvd.Value.logical_block_size : pvd.Value.logical_block_size) >
+ 0)
caLen++;
errno = imagePlugin.ReadSectors(ca.block_be, caLen, out byte[] caSectors);
@@ -487,8 +483,7 @@ public sealed partial class ISO9660
{
// Apple never said to include its extensions inside a continuation area, but just in case
case APPLE_MAGIC:
- if(caData[caOff + 3] == 1 &&
- caData[caOff + 2] == 7)
+ if(caData[caOff + 3] == 1 && caData[caOff + 2] == 7)
apple = true;
else
apple |= caData[caOff + 3] != 1;
@@ -504,14 +499,13 @@ public sealed partial class ISO9660
rrip |= nextSignature is RRIP_MAGIC or RRIP_POSIX_ATTRIBUTES or RRIP_POSIX_DEV_NO or RRIP_SYMLINK
or RRIP_NAME or RRIP_CHILDLINK or RRIP_PARENTLINK or RRIP_RELOCATED_DIR
- or RRIP_TIMESTAMPS
- or RRIP_SPARSE;
+ or RRIP_TIMESTAMPS or RRIP_SPARSE;
ziso |= nextSignature == ZISO_MAGIC;
amiga |= nextSignature == AMIGA_MAGIC;
- aaip |= nextSignature == AAIP_MAGIC || nextSignature == AAIP_MAGIC_OLD && caData[caOff + 3] == 1 &&
- caData[caOff + 2] >= 9;
+ aaip |= nextSignature == AAIP_MAGIC ||
+ nextSignature == AAIP_MAGIC_OLD && caData[caOff + 3] == 1 && caData[caOff + 2] >= 9;
caOff += caData[caOff + 2];
}
@@ -729,8 +723,7 @@ public sealed partial class ISO9660
AaruConsole.DebugWriteLine(MODULE_NAME, "initialEntry.load_rba = {0}", initialEntry.load_rba);
- AaruConsole.DebugWriteLine(MODULE_NAME, "initialEntry.sector_count = {0}",
- initialEntry.sector_count);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "initialEntry.sector_count = {0}", initialEntry.sector_count);
byte[] bootImage = null;
@@ -754,17 +747,20 @@ public sealed partial class ISO9660
isoMetadata.AppendFormat("\t" + Localization.Bootable_on_0, valentry.platform_id).AppendLine();
isoMetadata.AppendFormat("\t" + Localization.Bootable_image_starts_at_sector_0_and_runs_for_1_sectors,
- initialEntry.load_rba, initialEntry.sector_count).AppendLine();
+ initialEntry.load_rba, initialEntry.sector_count).
+ AppendLine();
if(valentry.platform_id == ElToritoPlatform.x86)
{
isoMetadata.AppendFormat("\t" + Localization.Bootable_image_will_be_loaded_at_segment_0,
- initialEntry.load_seg == 0 ? 0x7C0 : initialEntry.load_seg).AppendLine();
+ initialEntry.load_seg == 0 ? 0x7C0 : initialEntry.load_seg).
+ AppendLine();
}
else
{
isoMetadata.AppendFormat("\t" + Localization.Bootable_image_will_be_loaded_at_0,
- (uint)initialEntry.load_seg * 10).AppendLine();
+ (uint)initialEntry.load_seg * 10).
+ AppendLine();
}
switch(initialEntry.boot_type)
@@ -787,7 +783,8 @@ public sealed partial class ISO9660
break;
default:
isoMetadata.AppendFormat("\t" + Localization.Image_uses_unknown_emulation_type_0,
- (byte)initialEntry.boot_type).AppendLine();
+ (byte)initialEntry.boot_type).
+ AppendLine();
break;
}
@@ -851,7 +848,8 @@ public sealed partial class ISO9660
isoMetadata.
AppendFormat("\t\t" + Localization.Bootable_image_starts_at_sector_0_and_runs_for_1_sectors,
- sectionEntry.load_rba, sectionEntry.sector_count).AppendLine();
+ sectionEntry.load_rba, sectionEntry.sector_count).
+ AppendLine();
if(valentry.platform_id == ElToritoPlatform.x86)
{
@@ -862,7 +860,8 @@ public sealed partial class ISO9660
else
{
isoMetadata.AppendFormat("\t\t" + Localization.Bootable_image_will_be_loaded_at_0,
- (uint)sectionEntry.load_seg * 10).AppendLine();
+ (uint)sectionEntry.load_seg * 10).
+ AppendLine();
}
switch((ElToritoEmulation)((byte)sectionEntry.boot_type & 0xF))
@@ -872,29 +871,31 @@ public sealed partial class ISO9660
break;
case ElToritoEmulation.Md2Hd:
- isoMetadata.AppendLine("\t\t" + Localization.
- Image_emulates_a_high_density_MD2HD_floppy);
+ isoMetadata.AppendLine("\t\t" +
+ Localization.Image_emulates_a_high_density_MD2HD_floppy);
break;
case ElToritoEmulation.Mf2Hd:
- isoMetadata.AppendLine("\t\t" + Localization.
- Image_emulates_a_high_density_MF2HD_floppy);
+ isoMetadata.AppendLine("\t\t" +
+ Localization.Image_emulates_a_high_density_MF2HD_floppy);
break;
case ElToritoEmulation.Mf2Ed:
- isoMetadata.AppendLine("\t\t" + Localization.
- Image_emulates_a_extra_density_MF2ED_floppy);
+ isoMetadata.AppendLine("\t\t" +
+ Localization.Image_emulates_a_extra_density_MF2ED_floppy);
break;
default:
isoMetadata.AppendFormat("\t\t" + Localization.Image_uses_unknown_emulation_type_0,
- (byte)initialEntry.boot_type).AppendLine();
+ (byte)initialEntry.boot_type).
+ AppendLine();
break;
}
isoMetadata.AppendFormat("\t\t" + Localization.Selection_criteria_type_0,
- sectionEntry.selection_criteria_type).AppendLine();
+ sectionEntry.selection_criteria_type).
+ AppendLine();
isoMetadata.AppendFormat("\t\t" + Localization.System_type_0, sectionEntry.system_type).
AppendLine();
@@ -902,7 +903,8 @@ public sealed partial class ISO9660
if(bootImage != null)
{
isoMetadata.AppendFormat("\t\t" + Localization.Bootable_image_SHA1_0,
- Sha1Context.Data(bootImage, out _)).AppendLine();
+ Sha1Context.Data(bootImage, out _)).
+ AppendLine();
}
}
else
diff --git a/Aaru.Filesystems/ISO9660/Mode2.cs b/Aaru.Filesystems/ISO9660/Mode2.cs
index 6fa7ccf87..93ce453f3 100644
--- a/Aaru.Filesystems/ISO9660/Mode2.cs
+++ b/Aaru.Filesystems/ISO9660/Mode2.cs
@@ -91,15 +91,24 @@ public sealed partial class ISO9660
data[1], (Mode2Submode)data[2], data[3]);
break;
- case 2352 when data[0] != 0x00 || data[1] != 0xFF || data[2] != 0xFF || data[3] != 0xFF ||
- data[4] != 0xFF || data[5] != 0xFF || data[6] != 0xFF || data[7] != 0xFF ||
- data[8] != 0xFF || data[9] != 0xFF || data[10] != 0xFF || data[11] != 0x00:
+ case 2352 when data[0] != 0x00 ||
+ data[1] != 0xFF ||
+ data[2] != 0xFF ||
+ data[3] != 0xFF ||
+ data[4] != 0xFF ||
+ data[5] != 0xFF ||
+ data[6] != 0xFF ||
+ data[7] != 0xFF ||
+ data[8] != 0xFF ||
+ data[9] != 0xFF ||
+ data[10] != 0xFF ||
+ data[11] != 0x00:
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.tor_Sector_0_Raw_Audio, realSector);
break;
case 2352 when data[15] != 2:
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.tor_Sector_0_1_2_3_Raw_Mode_4,
- realSector, data[12], data[13], data[14], data[15]);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.tor_Sector_0_1_2_3_Raw_Mode_4, realSector,
+ data[12], data[13], data[14], data[15]);
break;
case 2352:
@@ -155,8 +164,8 @@ public sealed partial class ISO9660
break;
case 2324:
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.tor_Sector_0_Cooked_Mode_two_Form_two, dstSector);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.tor_Sector_0_Cooked_Mode_two_Form_two,
+ dstSector);
break;
case 2336:
@@ -168,11 +177,19 @@ public sealed partial class ISO9660
data[0], data[1], (Mode2Submode)data[2], data[3]);
break;
- case 2352 when data[0] != 0x00 || data[1] != 0xFF || data[2] != 0xFF || data[3] != 0xFF ||
- data[4] != 0xFF || data[5] != 0xFF || data[6] != 0xFF || data[7] != 0xFF ||
- data[8] != 0xFF || data[9] != 0xFF || data[10] != 0xFF || data[11] != 0x00:
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.tor_Sector_0_Raw_Audio,
- dstSector);
+ case 2352 when data[0] != 0x00 ||
+ data[1] != 0xFF ||
+ data[2] != 0xFF ||
+ data[3] != 0xFF ||
+ data[4] != 0xFF ||
+ data[5] != 0xFF ||
+ data[6] != 0xFF ||
+ data[7] != 0xFF ||
+ data[8] != 0xFF ||
+ data[9] != 0xFF ||
+ data[10] != 0xFF ||
+ data[11] != 0x00:
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.tor_Sector_0_Raw_Audio, dstSector);
break;
case 2352 when data[15] != 2:
diff --git a/Aaru.Filesystems/ISO9660/PathTable.cs b/Aaru.Filesystems/ISO9660/PathTable.cs
index e6aac76b3..74c86549c 100644
--- a/Aaru.Filesystems/ISO9660/PathTable.cs
+++ b/Aaru.Filesystems/ISO9660/PathTable.cs
@@ -36,8 +36,7 @@ public sealed partial class ISO9660
{
PathTableEntryInternal[] DecodePathTable(byte[] data)
{
- if(data is null ||
- data.Length == 0)
+ if(data is null || data.Length == 0)
return null;
List table = new();
@@ -94,9 +93,9 @@ public sealed partial class ISO9660
{
HighSierraPathTableEntry entry =
Marshal.ByteArrayToStructureBigEndian(data, off,
- Marshal.
- SizeOf<
- HighSierraPathTableEntry>());
+ Marshal.
+ SizeOf<
+ HighSierraPathTableEntry>());
if(entry.name_len == 0)
break;
diff --git a/Aaru.Filesystems/ISO9660/Structs/CDi.cs b/Aaru.Filesystems/ISO9660/Structs/CDi.cs
index 74b0c534e..698e0007e 100644
--- a/Aaru.Filesystems/ISO9660/Structs/CDi.cs
+++ b/Aaru.Filesystems/ISO9660/Structs/CDi.cs
@@ -51,14 +51,12 @@ public sealed partial class ISO9660
ApplicationIdentifier = StringHandlers.CToString(pvd.application_data).TrimEnd()
};
- if(pvd.creation_date[0] == '0' ||
- pvd.creation_date[0] == 0x00)
+ if(pvd.creation_date[0] == '0' || pvd.creation_date[0] == 0x00)
decodedVd.CreationTime = DateTime.MinValue;
else
decodedVd.CreationTime = DateHandlers.HighSierraToDateTime(pvd.creation_date);
- if(pvd.modification_date[0] == '0' ||
- pvd.modification_date[0] == 0x00)
+ if(pvd.modification_date[0] == '0' || pvd.modification_date[0] == 0x00)
decodedVd.HasModificationTime = false;
else
{
@@ -66,8 +64,7 @@ public sealed partial class ISO9660
decodedVd.ModificationTime = DateHandlers.HighSierraToDateTime(pvd.modification_date);
}
- if(pvd.expiration_date[0] == '0' ||
- pvd.expiration_date[0] == 0x00)
+ if(pvd.expiration_date[0] == '0' || pvd.expiration_date[0] == 0x00)
decodedVd.HasExpirationTime = false;
else
{
@@ -75,8 +72,7 @@ public sealed partial class ISO9660
decodedVd.ExpirationTime = DateHandlers.HighSierraToDateTime(pvd.expiration_date);
}
- if(pvd.effective_date[0] == '0' ||
- pvd.effective_date[0] == 0x00)
+ if(pvd.effective_date[0] == '0' || pvd.effective_date[0] == 0x00)
decodedVd.HasEffectiveTime = false;
else
{
diff --git a/Aaru.Filesystems/ISO9660/Structs/HighSierra.cs b/Aaru.Filesystems/ISO9660/Structs/HighSierra.cs
index b9be758f4..c38402afc 100644
--- a/Aaru.Filesystems/ISO9660/Structs/HighSierra.cs
+++ b/Aaru.Filesystems/ISO9660/Structs/HighSierra.cs
@@ -48,14 +48,12 @@ public sealed partial class ISO9660
ApplicationIdentifier = Encoding.ASCII.GetString(pvd.application_data).TrimEnd().Trim('\0')
};
- if(pvd.creation_date[0] == '0' ||
- pvd.creation_date[0] == 0x00)
+ if(pvd.creation_date[0] == '0' || pvd.creation_date[0] == 0x00)
decodedVd.CreationTime = DateTime.MinValue;
else
decodedVd.CreationTime = DateHandlers.HighSierraToDateTime(pvd.creation_date);
- if(pvd.modification_date[0] == '0' ||
- pvd.modification_date[0] == 0x00)
+ if(pvd.modification_date[0] == '0' || pvd.modification_date[0] == 0x00)
decodedVd.HasModificationTime = false;
else
{
@@ -63,8 +61,7 @@ public sealed partial class ISO9660
decodedVd.ModificationTime = DateHandlers.HighSierraToDateTime(pvd.modification_date);
}
- if(pvd.expiration_date[0] == '0' ||
- pvd.expiration_date[0] == 0x00)
+ if(pvd.expiration_date[0] == '0' || pvd.expiration_date[0] == 0x00)
decodedVd.HasExpirationTime = false;
else
{
@@ -72,8 +69,7 @@ public sealed partial class ISO9660
decodedVd.ExpirationTime = DateHandlers.HighSierraToDateTime(pvd.expiration_date);
}
- if(pvd.effective_date[0] == '0' ||
- pvd.effective_date[0] == 0x00)
+ if(pvd.effective_date[0] == '0' || pvd.effective_date[0] == 0x00)
decodedVd.HasEffectiveTime = false;
else
{
diff --git a/Aaru.Filesystems/ISO9660/Structs/ISO.cs b/Aaru.Filesystems/ISO9660/Structs/ISO.cs
index b2cbe7f56..c81b40b34 100644
--- a/Aaru.Filesystems/ISO9660/Structs/ISO.cs
+++ b/Aaru.Filesystems/ISO9660/Structs/ISO.cs
@@ -52,14 +52,12 @@ public sealed partial class ISO9660
ApplicationIdentifier = StringHandlers.CToString(pvd.application_id, encoding).TrimEnd()
};
- if(pvd.creation_date[0] == '0' ||
- pvd.creation_date[0] == 0x00)
+ if(pvd.creation_date[0] == '0' || pvd.creation_date[0] == 0x00)
decodedVd.CreationTime = DateTime.MinValue;
else
decodedVd.CreationTime = DateHandlers.Iso9660ToDateTime(pvd.creation_date);
- if(pvd.modification_date[0] == '0' ||
- pvd.modification_date[0] == 0x00)
+ if(pvd.modification_date[0] == '0' || pvd.modification_date[0] == 0x00)
decodedVd.HasModificationTime = false;
else
{
@@ -67,8 +65,7 @@ public sealed partial class ISO9660
decodedVd.ModificationTime = DateHandlers.Iso9660ToDateTime(pvd.modification_date);
}
- if(pvd.expiration_date[0] == '0' ||
- pvd.expiration_date[0] == 0x00)
+ if(pvd.expiration_date[0] == '0' || pvd.expiration_date[0] == 0x00)
decodedVd.HasExpirationTime = false;
else
{
@@ -76,8 +73,7 @@ public sealed partial class ISO9660
decodedVd.ExpirationTime = DateHandlers.Iso9660ToDateTime(pvd.expiration_date);
}
- if(pvd.effective_date[0] == '0' ||
- pvd.effective_date[0] == 0x00)
+ if(pvd.effective_date[0] == '0' || pvd.effective_date[0] == 0x00)
decodedVd.HasEffectiveTime = false;
else
{
diff --git a/Aaru.Filesystems/ISO9660/Structs/Joliet.cs b/Aaru.Filesystems/ISO9660/Structs/Joliet.cs
index ae5544e69..a509127ab 100644
--- a/Aaru.Filesystems/ISO9660/Structs/Joliet.cs
+++ b/Aaru.Filesystems/ISO9660/Structs/Joliet.cs
@@ -41,24 +41,26 @@ public sealed partial class ISO9660
{
SystemIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.system_id).Replace('\u0000', ' ').TrimEnd(),
VolumeIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.volume_id).Replace('\u0000', ' ').TrimEnd(),
- VolumeSetIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.volume_set_id).Replace('\u0000', ' ').
+ VolumeSetIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.volume_set_id).
+ Replace('\u0000', ' ').
TrimEnd(),
- PublisherIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.publisher_id).Replace('\u0000', ' ').
+ PublisherIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.publisher_id).
+ Replace('\u0000', ' ').
TrimEnd(),
- DataPreparerIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.preparer_id).Replace('\u0000', ' ').
+ DataPreparerIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.preparer_id).
+ Replace('\u0000', ' ').
TrimEnd(),
- ApplicationIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.application_id).Replace('\u0000', ' ').
+ ApplicationIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.application_id).
+ Replace('\u0000', ' ').
TrimEnd()
};
- if(jolietvd.creation_date[0] < 0x31 ||
- jolietvd.creation_date[0] > 0x39)
+ if(jolietvd.creation_date[0] < 0x31 || jolietvd.creation_date[0] > 0x39)
decodedVd.CreationTime = DateTime.MinValue;
else
decodedVd.CreationTime = DateHandlers.Iso9660ToDateTime(jolietvd.creation_date);
- if(jolietvd.modification_date[0] < 0x31 ||
- jolietvd.modification_date[0] > 0x39)
+ if(jolietvd.modification_date[0] < 0x31 || jolietvd.modification_date[0] > 0x39)
decodedVd.HasModificationTime = false;
else
{
@@ -66,8 +68,7 @@ public sealed partial class ISO9660
decodedVd.ModificationTime = DateHandlers.Iso9660ToDateTime(jolietvd.modification_date);
}
- if(jolietvd.expiration_date[0] < 0x31 ||
- jolietvd.expiration_date[0] > 0x39)
+ if(jolietvd.expiration_date[0] < 0x31 || jolietvd.expiration_date[0] > 0x39)
decodedVd.HasExpirationTime = false;
else
{
@@ -75,8 +76,7 @@ public sealed partial class ISO9660
decodedVd.ExpirationTime = DateHandlers.Iso9660ToDateTime(jolietvd.expiration_date);
}
- if(jolietvd.effective_date[0] < 0x31 ||
- jolietvd.effective_date[0] > 0x39)
+ if(jolietvd.effective_date[0] < 0x31 || jolietvd.effective_date[0] > 0x39)
decodedVd.HasEffectiveTime = false;
else
{
diff --git a/Aaru.Filesystems/ISO9660/Super.cs b/Aaru.Filesystems/ISO9660/Super.cs
index 5dc226b3f..5735a6ac5 100644
--- a/Aaru.Filesystems/ISO9660/Super.cs
+++ b/Aaru.Filesystems/ISO9660/Super.cs
@@ -210,8 +210,7 @@ public sealed partial class ISO9660
// Check if this is Joliet
if(svd.version == 1)
{
- if(svd.escape_sequences[0] == '%' &&
- svd.escape_sequences[1] == '/')
+ if(svd.escape_sequences[0] == '%' && svd.escape_sequences[1] == '/')
{
if(svd.escape_sequences[2] == '@' ||
svd.escape_sequences[2] == 'C' ||
@@ -261,9 +260,7 @@ public sealed partial class ISO9660
Metadata = new FileSystem();
- if(pvd == null &&
- hsvd == null &&
- fsvd == null)
+ if(pvd == null && hsvd == null && fsvd == null)
{
AaruConsole.ErrorWriteLine(Localization.ERROR_Could_not_find_primary_volume_descriptor);
@@ -348,13 +345,10 @@ public sealed partial class ISO9660
}
// High Sierra and CD-i do not support Joliet or RRIP
- if((_highSierra || _cdi) &&
- _namespace != Namespace.Normal &&
- _namespace != Namespace.Vms)
+ if((_highSierra || _cdi) && _namespace != Namespace.Normal && _namespace != Namespace.Vms)
_namespace = Namespace.Normal;
- if(jolietvd is null &&
- _namespace == Namespace.Joliet)
+ if(jolietvd is null && _namespace == Namespace.Joliet)
_namespace = Namespace.Normal;
uint rootLocation;
@@ -373,8 +367,7 @@ public sealed partial class ISO9660
rootSize = _highSierra ? hsvd.Value.root_directory_record.size : pvd.Value.root_directory_record.size;
- if(_pathTable?.Length > 1 &&
- rootLocation != _pathTable[0].Extent)
+ if(_pathTable?.Length > 1 && rootLocation != _pathTable[0].Extent)
{
AaruConsole.DebugWriteLine(MODULE_NAME,
Localization.
@@ -521,17 +514,14 @@ public sealed partial class ISO9660
if(_namespace != Namespace.Joliet)
{
- _rootDirectoryCache = _cdi
- ? DecodeCdiDirectory(rootLocation + rootXattrLength, rootSize)
- : _highSierra
- ? DecodeHighSierraDirectory(rootLocation + rootXattrLength, rootSize)
- : DecodeIsoDirectory(rootLocation + rootXattrLength, rootSize);
+ _rootDirectoryCache = _cdi ? DecodeCdiDirectory(rootLocation + rootXattrLength, rootSize) :
+ _highSierra ? DecodeHighSierraDirectory(rootLocation + rootXattrLength, rootSize) :
+ DecodeIsoDirectory(rootLocation + rootXattrLength, rootSize);
}
Metadata.Type = fsFormat;
- if(jolietvd != null &&
- _namespace is Namespace.Joliet or Namespace.Rrip)
+ if(jolietvd != null && _namespace is Namespace.Joliet or Namespace.Rrip)
{
rootLocation = jolietvd.Value.root_directory_record.extent;
rootXattrLength = jolietvd.Value.root_directory_record.xattr_len;
@@ -794,11 +784,9 @@ public sealed partial class ISO9660
if(_usePathTable)
{
- foreach(DecodedDirectoryEntry subDirectory in _cdi
- ? GetSubdirsFromCdiPathTable("")
- : _highSierra
- ? GetSubdirsFromHighSierraPathTable("")
- : GetSubdirsFromIsoPathTable(""))
+ foreach(DecodedDirectoryEntry subDirectory in _cdi ? GetSubdirsFromCdiPathTable("") :
+ _highSierra ? GetSubdirsFromHighSierraPathTable("") :
+ GetSubdirsFromIsoPathTable(""))
_rootDirectoryCache[subDirectory.Filename] = subDirectory;
}
diff --git a/Aaru.Filesystems/ISO9660/Xattr.cs b/Aaru.Filesystems/ISO9660/Xattr.cs
index 1b8a5b690..35c34e676 100644
--- a/Aaru.Filesystems/ISO9660/Xattr.cs
+++ b/Aaru.Filesystems/ISO9660/Xattr.cs
@@ -81,9 +81,7 @@ public sealed partial class ISO9660
if(entry.AmigaComment != null)
xattrs.Add("com.amiga.comments");
- if(entry.Flags.HasFlag(FileFlags.Directory) ||
- entry.Extents == null ||
- entry.Extents.Count == 0)
+ if(entry.Flags.HasFlag(FileFlags.Directory) || entry.Extents == null || entry.Extents.Count == 0)
return ErrorNumber.NoError;
ErrorNumber errno = _image.ReadSectorLong(entry.Extents[0].extent * _blockSize / 2048, out byte[] sector);
@@ -116,11 +114,11 @@ public sealed partial class ISO9660
switch(xattr)
{
case "org.iso.9660.ea":
- return entry.XattrLength == 0
- ? ErrorNumber.NoSuchExtendedAttribute
- : entry.Extents is null
- ? ErrorNumber.InvalidArgument
- : ReadSingleExtent(entry.XattrLength * _blockSize, entry.Extents[0].extent, out buf);
+ return entry.XattrLength == 0 ? ErrorNumber.NoSuchExtendedAttribute :
+ entry.Extents is null ? ErrorNumber.InvalidArgument :
+ ReadSingleExtent(entry.XattrLength * _blockSize,
+ entry.Extents[0].extent,
+ out buf);
case "org.iso.9660.AssociatedFile":
if(entry.AssociatedFile is null)
diff --git a/Aaru.Filesystems/JFS/Info.cs b/Aaru.Filesystems/JFS/Info.cs
index cf3bd97e1..26a67f0e6 100644
--- a/Aaru.Filesystems/JFS/Info.cs
+++ b/Aaru.Filesystems/JFS/Info.cs
@@ -161,7 +161,8 @@ public sealed partial class JFS
sb.AppendLine(Localization.Volume_is_dirty);
sb.AppendFormat(Localization.Volume_was_last_updated_on_0_,
- DateHandlers.UnixUnsignedToDateTime(jfsSb.s_time.tv_sec, jfsSb.s_time.tv_nsec)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(jfsSb.s_time.tv_sec, jfsSb.s_time.tv_nsec)).
+ AppendLine();
if(jfsSb.s_version == 1)
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(jfsSb.s_fpack, encoding)).AppendLine();
diff --git a/Aaru.Filesystems/LisaFS/Dir.cs b/Aaru.Filesystems/LisaFS/Dir.cs
index 8eb468acd..49f687dd6 100644
--- a/Aaru.Filesystems/LisaFS/Dir.cs
+++ b/Aaru.Filesystems/LisaFS/Dir.cs
@@ -182,10 +182,7 @@ public sealed partial class LisaFS
offset += 54;
// Check that the entry is correct, not empty or garbage
- if(entV2.filenameLen != 0 &&
- entV2.filenameLen <= E_NAME &&
- entV2.fileType != 0 &&
- entV2.fileID > 0)
+ if(entV2.filenameLen != 0 && entV2.filenameLen <= E_NAME && entV2.fileType != 0 && entV2.fileID > 0)
catalogV2.Add(entV2);
}
@@ -229,8 +226,7 @@ public sealed partial class LisaFS
DecodeTag(tag, out LisaTag.PriamTag catTag);
- if(catTag.FileId != FILEID_CATALOG ||
- catTag.RelPage != 0)
+ if(catTag.FileId != FILEID_CATALOG || catTag.RelPage != 0)
continue;
errno = _device.ReadSectors(i, 4, out firstCatalogBlock);
@@ -323,8 +319,7 @@ public sealed partial class LisaFS
break;
// Normal entry
- else if(buf[offset + 0x24] == 0x03 &&
- buf[offset] == 0x24)
+ else if(buf[offset + 0x24] == 0x03 && buf[offset] == 0x24)
{
var entry = new CatalogEntry
{
@@ -358,8 +353,7 @@ public sealed partial class LisaFS
}
// Subdirectory entry
- else if(buf[offset + 0x24] == 0x01 &&
- buf[offset] == 0x24)
+ else if(buf[offset + 0x24] == 0x01 && buf[offset] == 0x24)
{
var entry = new CatalogEntry
{
diff --git a/Aaru.Filesystems/LisaFS/Extent.cs b/Aaru.Filesystems/LisaFS/Extent.cs
index 0d08facc7..7f7757057 100644
--- a/Aaru.Filesystems/LisaFS/Extent.cs
+++ b/Aaru.Filesystems/LisaFS/Extent.cs
@@ -48,8 +48,7 @@ public sealed partial class LisaFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(fileId < 4 ||
- fileId == 4 && _mddf.fsversion != LISA_V2 && _mddf.fsversion != LISA_V1)
+ if(fileId < 4 || fileId == 4 && _mddf.fsversion != LISA_V2 && _mddf.fsversion != LISA_V1)
return ErrorNumber.InvalidArgument;
if(_extentCache.TryGetValue(fileId, out file))
@@ -120,8 +119,7 @@ public sealed partial class LisaFS
if(errno != ErrorNumber.NoError)
return errno;
- if(sector[0] >= 32 ||
- sector[0] == 0)
+ if(sector[0] >= 32 || sector[0] == 0)
return ErrorNumber.InvalidArgument;
file.filenameLen = sector[0];
diff --git a/Aaru.Filesystems/LisaFS/File.cs b/Aaru.Filesystems/LisaFS/File.cs
index 489e4e5ce..3b9dd0995 100644
--- a/Aaru.Filesystems/LisaFS/File.cs
+++ b/Aaru.Filesystems/LisaFS/File.cs
@@ -110,8 +110,7 @@ public sealed partial class LisaFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(buffer is null ||
- buffer.Length < length)
+ if(buffer is null || buffer.Length < length)
return ErrorNumber.InvalidArgument;
if(node is not LisaFileNode mynode)
@@ -244,19 +243,16 @@ public sealed partial class LisaFS
buf = null;
ErrorNumber errno;
- if(!_mounted ||
- !_debug)
+ if(!_mounted || !_debug)
return ErrorNumber.AccessDenied;
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;
}
- if(_systemFileCache.TryGetValue(fileId, out buf) &&
- !tags)
+ if(_systemFileCache.TryGetValue(fileId, out buf) && !tags)
return ErrorNumber.NoError;
var count = 0;
@@ -349,8 +345,7 @@ public sealed partial class LisaFS
if(fileId <= 4)
{
- if(!_debug ||
- fileId == 0)
+ if(!_debug || fileId == 0)
return ErrorNumber.NoSuchFile;
stat = new FileEntryInfo();
@@ -361,9 +356,7 @@ public sealed partial class LisaFS
if(error != ErrorNumber.NoError)
return error;
- if(fileId < 0 &&
- fileId != FILEID_BOOT_SIGNED &&
- fileId != FILEID_LOADER_SIGNED)
+ if(fileId < 0 && fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED)
{
error = ReadExtentsFile((short)(fileId * -1), out file);
@@ -445,12 +438,10 @@ public sealed partial class LisaFS
tags &= _debug;
- if(fileId < 4 ||
- fileId == 4 && _mddf.fsversion != LISA_V2 && _mddf.fsversion != LISA_V1)
+ if(fileId < 4 || fileId == 4 && _mddf.fsversion != LISA_V2 && _mddf.fsversion != LISA_V1)
return ErrorNumber.InvalidArgument;
- if(!tags &&
- _fileCache.TryGetValue(fileId, out buf))
+ if(!tags && _fileCache.TryGetValue(fileId, out buf))
return ErrorNumber.NoError;
ErrorNumber error = ReadExtentsFile(fileId, out ExtentFile file);
@@ -473,12 +464,14 @@ public sealed partial class LisaFS
{
byte[] sector;
- ErrorNumber errno =
- !tags
- ? _device.ReadSectors((ulong)file.extents[i].start + _mddf.mddf_block + _volumePrefix,
- (uint)file.extents[i].length, out sector)
- : _device.ReadSectorsTag((ulong)file.extents[i].start + _mddf.mddf_block + _volumePrefix,
- (uint)file.extents[i].length, SectorTagType.AppleSectorTag, out sector);
+ ErrorNumber errno = !tags
+ ? _device.
+ ReadSectors((ulong)file.extents[i].start + _mddf.mddf_block + _volumePrefix,
+ (uint)file.extents[i].length, out sector)
+ : _device.
+ ReadSectorsTag((ulong)file.extents[i].start + _mddf.mddf_block + _volumePrefix,
+ (uint)file.extents[i].length, SectorTagType.AppleSectorTag,
+ out sector);
if(errno != ErrorNumber.NoError)
return errno;
@@ -513,7 +506,10 @@ public sealed partial class LisaFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
switch(pathElements.Length)
{
@@ -591,8 +587,7 @@ public sealed partial class LisaFS
isDir = entry.fileType == 0x01;
// Not last path element, and it's not a directory
- if(lvl != pathElements.Length - 1 &&
- !isDir)
+ if(lvl != pathElements.Length - 1 && !isDir)
return ErrorNumber.NotDirectory;
// Arrived last path element
diff --git a/Aaru.Filesystems/LisaFS/Info.cs b/Aaru.Filesystems/LisaFS/Info.cs
index 1b00a3e3c..2860bc9f2 100644
--- a/Aaru.Filesystems/LisaFS/Info.cs
+++ b/Aaru.Filesystems/LisaFS/Info.cs
@@ -68,8 +68,7 @@ public sealed partial class LisaFS
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Sector_0_file_ID_1, i, searchTag.FileId);
- if(beforeMddf == -1 &&
- searchTag.FileId == FILEID_LOADER_SIGNED)
+ if(beforeMddf == -1 && searchTag.FileId == FILEID_LOADER_SIGNED)
beforeMddf = i - 1;
if(searchTag.FileId != FILEID_MDDF)
@@ -157,8 +156,7 @@ public sealed partial class LisaFS
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Sector_0_file_ID_1, i, searchTag.FileId);
- if(beforeMddf == -1 &&
- searchTag.FileId == FILEID_LOADER_SIGNED)
+ if(beforeMddf == -1 && searchTag.FileId == FILEID_LOADER_SIGNED)
beforeMddf = i - 1;
if(searchTag.FileId != FILEID_MDDF)
@@ -345,10 +343,12 @@ public sealed partial class LisaFS
sb.AppendFormat(Localization.Volume_is_number_0_of_1, infoMddf.volnum, infoMddf.vol_sequence).AppendLine();
sb.AppendFormat(Localization.Serial_number_of_Lisa_computer_that_created_this_volume_0,
- infoMddf.machine_id).AppendLine();
+ infoMddf.machine_id).
+ AppendLine();
sb.AppendFormat(Localization.Serial_number_of_Lisa_computer_that_can_use_this_volume_software_0,
- infoMddf.serialization).AppendLine();
+ infoMddf.serialization).
+ AppendLine();
sb.AppendFormat(Localization.Volume_created_on_0, infoMddf.dtvc).AppendLine();
sb.AppendFormat(Localization.Volume_catalog_created_on_0, infoMddf.dtcc).AppendLine();
@@ -376,7 +376,8 @@ public sealed partial class LisaFS
sb.AppendFormat(Localization.Overmount_stamp_0, infoMddf.overmount_stamp).AppendLine();
sb.AppendFormat(Localization.S_Records_start_at_0_and_spans_for_1_blocks,
- infoMddf.srec_ptr + infoMddf.mddf_block + beforeMddf, infoMddf.srec_len).AppendLine();
+ infoMddf.srec_ptr + infoMddf.mddf_block + beforeMddf, infoMddf.srec_len).
+ AppendLine();
sb.AppendLine(infoMddf.vol_left_mounted == 0 ? Localization.Volume_is_clean : Localization.Volume_is_dirty);
diff --git a/Aaru.Filesystems/LisaFS/LisaFS.cs b/Aaru.Filesystems/LisaFS/LisaFS.cs
index 11096cdc2..8b03a9a80 100644
--- a/Aaru.Filesystems/LisaFS/LisaFS.cs
+++ b/Aaru.Filesystems/LisaFS/LisaFS.cs
@@ -72,15 +72,21 @@ public sealed partial class LisaFS : IReadOnlyFilesystem
///
public Dictionary Namespaces => new()
{
- { "workshop", "Filenames as shown by the Lisa Pascal Workshop (default)" },
- { "office", "Filenames as shown by the Lisa Office System (not yet implemented)" }
+ {
+ "workshop", "Filenames as shown by the Lisa Pascal Workshop (default)"
+ },
+ {
+ "office", "Filenames as shown by the Lisa Office System (not yet implemented)"
+ }
};
#endregion
static Dictionary GetDefaultOptions() => new()
{
- { "debug", false.ToString() }
+ {
+ "debug", false.ToString()
+ }
};
#region Caches
diff --git a/Aaru.Filesystems/LisaFS/Structs.cs b/Aaru.Filesystems/LisaFS/Structs.cs
index 6c131f4f3..f0946d1ea 100644
--- a/Aaru.Filesystems/LisaFS/Structs.cs
+++ b/Aaru.Filesystems/LisaFS/Structs.cs
@@ -435,6 +435,8 @@ public sealed partial class LisaFS
public byte scavenge_flag;
}
+#region Nested type: MDDF
+
#endregion
#region Nested type: SRecord
diff --git a/Aaru.Filesystems/LisaFS/Super.cs b/Aaru.Filesystems/LisaFS/Super.cs
index 402c1381c..34c3d5d8b 100644
--- a/Aaru.Filesystems/LisaFS/Super.cs
+++ b/Aaru.Filesystems/LisaFS/Super.cs
@@ -87,8 +87,7 @@ public sealed partial class LisaFS
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Sector_0_file_ID_1, i, searchTag.FileId);
- if(_volumePrefix == _device.Info.Sectors &&
- searchTag.FileId == FILEID_LOADER_SIGNED)
+ if(_volumePrefix == _device.Info.Sectors && searchTag.FileId == FILEID_LOADER_SIGNED)
_volumePrefix = i - 1;
if(searchTag.FileId != FILEID_MDDF)
@@ -249,7 +248,9 @@ public sealed partial class LisaFS
_directoryDtcCache = new Dictionary
{
- { DIRID_ROOT, _mddf.dtcc }
+ {
+ DIRID_ROOT, _mddf.dtcc
+ }
};
// Read the Catalog File
diff --git a/Aaru.Filesystems/LisaFS/Xattr.cs b/Aaru.Filesystems/LisaFS/Xattr.cs
index 827ffc26f..4a7f899e5 100644
--- a/Aaru.Filesystems/LisaFS/Xattr.cs
+++ b/Aaru.Filesystems/LisaFS/Xattr.cs
@@ -83,8 +83,7 @@ public sealed partial class LisaFS
// System files
if(fileId < 4)
{
- if(!_debug ||
- fileId == 0)
+ if(!_debug || fileId == 0)
return ErrorNumber.InvalidArgument;
xattrs = new List();
@@ -146,8 +145,7 @@ public sealed partial class LisaFS
// System files
if(fileId < 4)
{
- if(!_debug ||
- fileId == 0)
+ if(!_debug || fileId == 0)
return ErrorNumber.InvalidArgument;
// Only MDDF contains an extended attributes
@@ -187,8 +185,7 @@ public sealed partial class LisaFS
return ErrorNumber.NoError;
}
- if(!ArrayHelpers.ArrayIsNullOrEmpty(file.LisaInfo) &&
- xattr == "com.apple.lisa.label")
+ if(!ArrayHelpers.ArrayIsNullOrEmpty(file.LisaInfo) && xattr == "com.apple.lisa.label")
{
buf = new byte[128];
Array.Copy(file.LisaInfo, 0, buf, 0, 128);
diff --git a/Aaru.Filesystems/Locus/Info.cs b/Aaru.Filesystems/Locus/Info.cs
index 439e2a3fe..7b19b73e4 100644
--- a/Aaru.Filesystems/Locus/Info.cs
+++ b/Aaru.Filesystems/Locus/Info.cs
@@ -190,7 +190,8 @@ public sealed partial class Locus
AppendLine();
sb.AppendFormat(Localization.Volume_has_0_blocks_of_1_bytes_each_total_2_bytes, locusSb.s_fsize, blockSize,
- locusSb.s_fsize * blockSize).AppendLine();
+ locusSb.s_fsize * blockSize).
+ AppendLine();
sb.AppendFormat(Localization._0_blocks_free_1_bytes, locusSb.s_tfree, locusSb.s_tfree * blockSize).AppendLine();
sb.AppendFormat(Localization.Inode_list_uses_0_blocks, locusSb.s_isize).AppendLine();
@@ -198,7 +199,8 @@ public sealed partial class Locus
sb.AppendFormat(Localization.Next_free_inode_search_will_start_at_inode_0, locusSb.s_lasti).AppendLine();
sb.AppendFormat(Localization.There_are_an_estimate_of_0_free_inodes_before_next_search_start,
- locusSb.s_nbehind).AppendLine();
+ locusSb.s_nbehind).
+ AppendLine();
if(locusSb.s_flags.HasFlag(Flags.SB_RDONLY))
sb.AppendLine(Localization.Read_only_volume);
diff --git a/Aaru.Filesystems/MinixFS/Info.cs b/Aaru.Filesystems/MinixFS/Info.cs
index 225b88c88..b2c07c85c 100644
--- a/Aaru.Filesystems/MinixFS/Info.cs
+++ b/Aaru.Filesystems/MinixFS/Info.cs
@@ -223,8 +223,7 @@ public sealed partial class MinixFS
? Marshal.ByteArrayToStructureLittleEndian(minixSbSector)
: Marshal.ByteArrayToStructureBigEndian(minixSbSector);
- if(magic != MINIX3_MAGIC &&
- magic != MINIX3_CIGAM)
+ if(magic != MINIX3_MAGIC && magic != MINIX3_CIGAM)
mnxSb.s_blocksize = 1024;
sb.AppendLine(minixVersion);
@@ -245,10 +244,12 @@ public sealed partial class MinixFS
sb.AppendFormat(Localization._0_inodes_in_volume, mnxSb.s_ninodes).AppendLine();
sb.AppendFormat(Localization._0_blocks_on_inode_map_1_bytes, mnxSb.s_imap_blocks,
- mnxSb.s_imap_blocks * mnxSb.s_blocksize).AppendLine();
+ mnxSb.s_imap_blocks * mnxSb.s_blocksize).
+ AppendLine();
sb.AppendFormat(Localization._0_blocks_on_zone_map_1_bytes, mnxSb.s_zmap_blocks,
- mnxSb.s_zmap_blocks * mnxSb.s_blocksize).AppendLine();
+ mnxSb.s_zmap_blocks * mnxSb.s_blocksize).
+ AppendLine();
sb.AppendFormat(Localization.First_data_zone_0, mnxSb.s_firstdatazone).AppendLine();
@@ -282,10 +283,12 @@ public sealed partial class MinixFS
sb.AppendFormat(Localization._0_inodes_in_volume, mnxSb.s_ninodes).AppendLine();
sb.AppendFormat(Localization._0_blocks_on_inode_map_1_bytes, mnxSb.s_imap_blocks,
- mnxSb.s_imap_blocks * 1024).AppendLine();
+ mnxSb.s_imap_blocks * 1024).
+ AppendLine();
sb.AppendFormat(Localization._0_blocks_on_zone_map_1_bytes, mnxSb.s_zmap_blocks,
- mnxSb.s_zmap_blocks * 1024).AppendLine();
+ mnxSb.s_zmap_blocks * 1024).
+ AppendLine();
sb.AppendFormat(Localization.First_data_zone_0, mnxSb.s_firstdatazone).AppendLine();
diff --git a/Aaru.Filesystems/NTFS/Info.cs b/Aaru.Filesystems/NTFS/Info.cs
index 9ef2cbca6..5305b4146 100644
--- a/Aaru.Filesystems/NTFS/Info.cs
+++ b/Aaru.Filesystems/NTFS/Info.cs
@@ -120,7 +120,8 @@ public sealed partial class NTFS
if(ntfsBb.mft_rc_clusters > 0)
{
sb.AppendFormat(Localization._0_clusters_per_MFT_record_1_bytes, ntfsBb.mft_rc_clusters,
- ntfsBb.mft_rc_clusters * ntfsBb.bps * ntfsBb.spc).AppendLine();
+ ntfsBb.mft_rc_clusters * ntfsBb.bps * ntfsBb.spc).
+ AppendLine();
}
else
sb.AppendFormat(Localization._0_bytes_per_MFT_record, 1 << -ntfsBb.mft_rc_clusters).AppendLine();
@@ -128,7 +129,8 @@ public sealed partial class NTFS
if(ntfsBb.index_blk_cts > 0)
{
sb.AppendFormat(Localization._0_clusters_per_Index_block_1_bytes, ntfsBb.index_blk_cts,
- ntfsBb.index_blk_cts * ntfsBb.bps * ntfsBb.spc).AppendLine();
+ ntfsBb.index_blk_cts * ntfsBb.bps * ntfsBb.spc).
+ AppendLine();
}
else
sb.AppendFormat(Localization._0_bytes_per_Index_block, 1 << -ntfsBb.index_blk_cts).AppendLine();
@@ -139,10 +141,7 @@ public sealed partial class NTFS
metadata = new FileSystem();
- if(ntfsBb.jump[0] == 0xEB &&
- ntfsBb.jump[1] > 0x4E &&
- ntfsBb.jump[1] < 0x80 &&
- ntfsBb.signature2 == 0xAA55)
+ if(ntfsBb.jump[0] == 0xEB && ntfsBb.jump[1] > 0x4E && ntfsBb.jump[1] < 0x80 && ntfsBb.signature2 == 0xAA55)
{
metadata.Bootable = true;
string bootChk = Sha1Context.Data(ntfsBb.boot_code, out _);
diff --git a/Aaru.Filesystems/Nintendo/Helpers.cs b/Aaru.Filesystems/Nintendo/Helpers.cs
index e5ff1fae4..883ba2ca8 100644
--- a/Aaru.Filesystems/Nintendo/Helpers.cs
+++ b/Aaru.Filesystems/Nintendo/Helpers.cs
@@ -95,10 +95,9 @@ public sealed partial class NintendoPlugin
NintendoPlugin_RegionCodeToString_Taiwan,
"U" => Localization.
NintendoPlugin_RegionCodeToString_Australia,
- _ => string.Format(
- Localization.
- NintendoPlugin_RegionCodeToString_unknown_region_code_0,
- regionCode)
+ _ => string.
+ Format(Localization.NintendoPlugin_RegionCodeToString_unknown_region_code_0,
+ regionCode)
};
[SuppressMessage("ReSharper", "StringLiteralTypo")]
@@ -125,9 +124,9 @@ public sealed partial class NintendoPlugin
"4Q" => "Disney Interactive",
"GD" => "Square Enix",
"7D" => "Sierra",
- _ => string.Format(
- Localization.Unknown_publisher_0,
- publisherCode)
+ _ => string.
+ Format(Localization.Unknown_publisher_0,
+ publisherCode)
};
static string PartitionTypeToString(uint type) => type switch
@@ -135,7 +134,7 @@ public sealed partial class NintendoPlugin
0 => Localization.data,
1 => Localization.update,
2 => Localization.channel,
- _ => string.Format(
- Localization.unknown_partition_type_0, type)
+ _ => string.Format(Localization.unknown_partition_type_0,
+ type)
};
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/Nintendo/Info.cs b/Aaru.Filesystems/Nintendo/Info.cs
index dfb49da0f..c6a3daf91 100644
--- a/Aaru.Filesystems/Nintendo/Info.cs
+++ b/Aaru.Filesystems/Nintendo/Info.cs
@@ -132,8 +132,7 @@ public sealed partial class NintendoPlugin
fields.FirstPartitions[i].Offset =
BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 0)) << 2;
- fields.FirstPartitions[i].Type =
- BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 4));
+ fields.FirstPartitions[i].Type = BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 4));
}
for(var i = 0; i < fields.SecondPartitions.Length; i++)
@@ -144,8 +143,7 @@ public sealed partial class NintendoPlugin
fields.FirstPartitions[i].Offset =
BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 0)) << 2;
- fields.FirstPartitions[i].Type =
- BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 4));
+ fields.FirstPartitions[i].Type = BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 4));
}
for(var i = 0; i < fields.ThirdPartitions.Length; i++)
@@ -156,8 +154,7 @@ public sealed partial class NintendoPlugin
fields.FirstPartitions[i].Offset =
BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 0)) << 2;
- fields.FirstPartitions[i].Type =
- BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 4));
+ fields.FirstPartitions[i].Type = BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 4));
}
for(var i = 0; i < fields.FourthPartitions.Length; i++)
@@ -168,8 +165,7 @@ public sealed partial class NintendoPlugin
fields.FirstPartitions[i].Offset =
BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 0)) << 2;
- fields.FirstPartitions[i].Type =
- BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 4));
+ fields.FirstPartitions[i].Type = BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 4));
}
fields.Region = header[0x4E000];
@@ -213,8 +209,8 @@ public sealed partial class NintendoPlugin
AaruConsole.DebugWriteLine(MODULE_NAME, "firstPartitions[{1}].offset = {0}",
fields.FirstPartitions[i].Offset, i);
- AaruConsole.DebugWriteLine(MODULE_NAME, "firstPartitions[{1}].type = {0}",
- fields.FirstPartitions[i].Type, i);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "firstPartitions[{1}].type = {0}", fields.FirstPartitions[i].Type,
+ i);
}
for(var i = 0; i < fields.SecondPartitions.Length; i++)
@@ -222,8 +218,8 @@ public sealed partial class NintendoPlugin
AaruConsole.DebugWriteLine(MODULE_NAME, "secondPartitions[{1}].offset = {0}",
fields.SecondPartitions[i].Offset, i);
- AaruConsole.DebugWriteLine(MODULE_NAME, "secondPartitions[{1}].type = {0}",
- fields.SecondPartitions[i].Type, i);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "secondPartitions[{1}].type = {0}", fields.SecondPartitions[i].Type,
+ i);
}
for(var i = 0; i < fields.ThirdPartitions.Length; i++)
@@ -231,8 +227,8 @@ public sealed partial class NintendoPlugin
AaruConsole.DebugWriteLine(MODULE_NAME, "thirdPartitions[{1}].offset = {0}",
fields.ThirdPartitions[i].Offset, i);
- AaruConsole.DebugWriteLine(MODULE_NAME, "thirdPartitions[{1}].type = {0}",
- fields.ThirdPartitions[i].Type, i);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "thirdPartitions[{1}].type = {0}", fields.ThirdPartitions[i].Type,
+ i);
}
for(var i = 0; i < fields.FourthPartitions.Length; i++)
@@ -240,8 +236,8 @@ public sealed partial class NintendoPlugin
AaruConsole.DebugWriteLine(MODULE_NAME, "fourthPartitions[{1}].offset = {0}",
fields.FourthPartitions[i].Offset, i);
- AaruConsole.DebugWriteLine(MODULE_NAME, "fourthPartitions[{1}].type = {0}",
- fields.FourthPartitions[i].Type, i);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "fourthPartitions[{1}].type = {0}", fields.FourthPartitions[i].Type,
+ i);
}
AaruConsole.DebugWriteLine(MODULE_NAME, "region = {0}", fields.Region);
@@ -291,28 +287,32 @@ public sealed partial class NintendoPlugin
{
sbInformation.AppendFormat(Localization.First_0_partition_starts_at_sector_1,
PartitionTypeToString(fields.FirstPartitions[i].Type),
- fields.FirstPartitions[i].Offset / 2048).AppendLine();
+ fields.FirstPartitions[i].Offset / 2048).
+ AppendLine();
}
for(var i = 0; i < fields.SecondPartitions.Length; i++)
{
sbInformation.AppendFormat(Localization.Second_0_partition_starts_at_sector_1,
PartitionTypeToString(fields.SecondPartitions[i].Type),
- fields.SecondPartitions[i].Offset / 2048).AppendLine();
+ fields.SecondPartitions[i].Offset / 2048).
+ AppendLine();
}
for(var i = 0; i < fields.ThirdPartitions.Length; i++)
{
sbInformation.AppendFormat(Localization.Third_0_partition_starts_at_sector_1,
PartitionTypeToString(fields.ThirdPartitions[i].Type),
- fields.ThirdPartitions[i].Offset / 2048).AppendLine();
+ fields.ThirdPartitions[i].Offset / 2048).
+ AppendLine();
}
for(var i = 0; i < fields.FourthPartitions.Length; i++)
{
sbInformation.AppendFormat(Localization.Fourth_0_partition_starts_at_sector_1,
PartitionTypeToString(fields.FourthPartitions[i].Type),
- fields.FourthPartitions[i].Offset / 2048).AppendLine();
+ fields.FourthPartitions[i].Offset / 2048).
+ AppendLine();
}
// sbInformation.AppendFormat("Region byte is {0}", fields.region).AppendLine();
diff --git a/Aaru.Filesystems/ODS/Info.cs b/Aaru.Filesystems/ODS/Info.cs
index e757fb1e2..9b8bc0284 100644
--- a/Aaru.Filesystems/ODS/Info.cs
+++ b/Aaru.Filesystems/ODS/Info.cs
@@ -144,21 +144,24 @@ public sealed partial class ODS
StringHandlers.CToString(homeblock.format) != "DECFILE11B ")
sb.AppendLine(Localization.The_following_information_may_be_incorrect_for_this_volume);
- if(homeblock.resfiles < 5 ||
- homeblock.devtype != 0)
+ if(homeblock.resfiles < 5 || homeblock.devtype != 0)
sb.AppendLine(Localization.This_volume_may_be_corrupted);
sb.AppendFormat(Localization.Volume_format_is_0,
- StringHandlers.SpacePaddedToString(homeblock.format, encoding)).AppendLine();
+ StringHandlers.SpacePaddedToString(homeblock.format, encoding)).
+ AppendLine();
sb.AppendFormat(Localization.Volume_is_Level_0_revision_1, (homeblock.struclev & 0xFF00) >> 8,
- homeblock.struclev & 0xFF).AppendLine();
+ homeblock.struclev & 0xFF).
+ AppendLine();
sb.AppendFormat(Localization.Lowest_structure_in_the_volume_is_Level_0_revision_1,
- (homeblock.lowstruclev & 0xFF00) >> 8, homeblock.lowstruclev & 0xFF).AppendLine();
+ (homeblock.lowstruclev & 0xFF00) >> 8, homeblock.lowstruclev & 0xFF).
+ AppendLine();
sb.AppendFormat(Localization.Highest_structure_in_the_volume_is_Level_0_revision_1,
- (homeblock.highstruclev & 0xFF00) >> 8, homeblock.highstruclev & 0xFF).AppendLine();
+ (homeblock.highstruclev & 0xFF00) >> 8, homeblock.highstruclev & 0xFF).
+ AppendLine();
sb.AppendFormat(Localization._0_sectors_per_cluster_1_bytes, homeblock.cluster, homeblock.cluster * 512).
AppendLine();
@@ -167,13 +170,15 @@ public sealed partial class ODS
AppendLine();
sb.AppendFormat(Localization.Secondary_home_block_is_on_sector_0_VBN_1, homeblock.alhomelbn,
- homeblock.alhomevbn).AppendLine();
+ homeblock.alhomevbn).
+ AppendLine();
sb.AppendFormat(Localization.Volume_bitmap_starts_in_sector_0_VBN_1, homeblock.ibmaplbn, homeblock.ibmapvbn).
AppendLine();
sb.AppendFormat(Localization.Volume_bitmap_runs_for_0_sectors_1_bytes, homeblock.ibmapsize,
- homeblock.ibmapsize * 512).AppendLine();
+ homeblock.ibmapsize * 512).
+ AppendLine();
sb.AppendFormat(Localization.Backup_INDEXF_SYS_is_in_sector_0_VBN_1, homeblock.altidxlbn, homeblock.altidxvbn).
AppendLine();
@@ -181,11 +186,11 @@ public sealed partial class ODS
sb.AppendFormat(Localization._0_maximum_files_on_the_volume, homeblock.maxfiles).AppendLine();
sb.AppendFormat(Localization._0_reserved_files, homeblock.resfiles).AppendLine();
- if(homeblock is { rvn: > 0, setcount: > 0 } &&
- StringHandlers.CToString(homeblock.strucname) != " ")
+ if(homeblock is { rvn: > 0, setcount: > 0 } && StringHandlers.CToString(homeblock.strucname) != " ")
{
sb.AppendFormat(Localization.Volume_is_0_of_1_in_set_2, homeblock.rvn, homeblock.setcount,
- StringHandlers.SpacePaddedToString(homeblock.strucname, encoding)).AppendLine();
+ StringHandlers.SpacePaddedToString(homeblock.strucname, encoding)).
+ AppendLine();
}
sb.AppendFormat(Localization.Volume_owner_is_0_ID_1,
diff --git a/Aaru.Filesystems/Opera/Dir.cs b/Aaru.Filesystems/Opera/Dir.cs
index bc845fb85..1cc754fe9 100644
--- a/Aaru.Filesystems/Opera/Dir.cs
+++ b/Aaru.Filesystems/Opera/Dir.cs
@@ -48,8 +48,7 @@ public sealed partial class OperaFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(string.IsNullOrWhiteSpace(path) ||
- path == "/")
+ if(string.IsNullOrWhiteSpace(path) || path == "/")
{
node = new OperaDirNode
{
@@ -77,7 +76,10 @@ public sealed partial class OperaFS
return ErrorNumber.NoError;
}
- string[] pieces = cutPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pieces = cutPath.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
KeyValuePair entry =
_rootDirectoryCache.FirstOrDefault(t => t.Key.Equals(pieces[0], StringComparison.CurrentCultureIgnoreCase));
@@ -94,8 +96,9 @@ public sealed partial class OperaFS
for(var p = 0; p < pieces.Length; p++)
{
- entry = currentDirectory.FirstOrDefault(
- t => t.Key.Equals(pieces[p], StringComparison.CurrentCultureIgnoreCase));
+ entry =
+ currentDirectory.FirstOrDefault(t => t.Key.Equals(pieces[p],
+ StringComparison.CurrentCultureIgnoreCase));
if(string.IsNullOrEmpty(entry.Key))
return ErrorNumber.NoSuchFile;
diff --git a/Aaru.Filesystems/Opera/File.cs b/Aaru.Filesystems/Opera/File.cs
index 7e786b66b..d7e91fcb5 100644
--- a/Aaru.Filesystems/Opera/File.cs
+++ b/Aaru.Filesystems/Opera/File.cs
@@ -71,8 +71,7 @@ public sealed partial class OperaFS
if(err != ErrorNumber.NoError)
return err;
- if((entry.Entry.flags & FLAGS_MASK) == (uint)FileFlags.Directory &&
- !_debug)
+ if((entry.Entry.flags & FLAGS_MASK) == (uint)FileFlags.Directory && !_debug)
return ErrorNumber.IsDirectory;
if(entry.Pointers.Length < 1)
@@ -109,8 +108,7 @@ public sealed partial class OperaFS
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(buffer is null ||
- buffer.Length < length)
+ if(buffer is null || buffer.Length < length)
return ErrorNumber.InvalidArgument;
if(node is not OperaFileNode mynode)
@@ -204,7 +202,10 @@ public sealed partial class OperaFS
? path[1..].ToLower(CultureInfo.CurrentUICulture)
: path.ToLower(CultureInfo.CurrentUICulture);
- string[] pieces = cutPath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pieces = cutPath.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pieces.Length == 0)
return ErrorNumber.InvalidArgument;
diff --git a/Aaru.Filesystems/Opera/Info.cs b/Aaru.Filesystems/Opera/Info.cs
index 9fc8d2fb7..d53b034a8 100644
--- a/Aaru.Filesystems/Opera/Info.cs
+++ b/Aaru.Filesystems/Opera/Info.cs
@@ -57,8 +57,7 @@ public sealed partial class OperaFS
Array.Copy(sbSector, 0x001, syncBytes, 0, 5);
byte recordVersion = sbSector[0x006];
- if(recordType != 1 ||
- recordVersion != 1)
+ if(recordType != 1 || recordVersion != 1)
return false;
return Encoding.ASCII.GetString(syncBytes) == SYNC;
@@ -81,8 +80,7 @@ public sealed partial class OperaFS
SuperBlock sb = Marshal.ByteArrayToStructureBigEndian(sbSector);
- if(sb.record_type != 1 ||
- sb.record_version != 1)
+ if(sb.record_type != 1 || sb.record_version != 1)
return;
if(Encoding.ASCII.GetString(sb.sync_bytes) != SYNC)
@@ -112,17 +110,15 @@ public sealed partial class OperaFS
if(sb.block_size != 2048)
{
superBlockmetadata.
- AppendFormat(
- Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
- sb.block_size, 2048);
+ AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
+ sb.block_size, 2048);
}
}
else if(imagePlugin.Info.SectorSize != sb.block_size)
{
superBlockmetadata.
- AppendFormat(
- Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
- sb.block_size, imagePlugin.Info.SectorSize);
+ AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
+ sb.block_size, imagePlugin.Info.SectorSize);
}
superBlockmetadata.
@@ -140,7 +136,8 @@ public sealed partial class OperaFS
superBlockmetadata.AppendFormat(Localization.Root_directory_block_size_0_bytes, sb.rootdir_bsize).AppendLine();
superBlockmetadata.AppendFormat(Localization.Root_directory_size_0_blocks_1_bytes, sb.rootdir_blocks,
- sb.rootdir_bsize * sb.rootdir_blocks).AppendLine();
+ sb.rootdir_bsize * sb.rootdir_blocks).
+ AppendLine();
superBlockmetadata.AppendFormat(Localization.Last_root_directory_copy_0, sb.last_root_copy).AppendLine();
diff --git a/Aaru.Filesystems/Opera/Opera.cs b/Aaru.Filesystems/Opera/Opera.cs
index ba2cfd5d1..be66ed0bb 100644
--- a/Aaru.Filesystems/Opera/Opera.cs
+++ b/Aaru.Filesystems/Opera/Opera.cs
@@ -93,6 +93,8 @@ public sealed partial class OperaFS : IReadOnlyFilesystem
static Dictionary GetDefaultOptions() => new()
{
- { "debug", false.ToString() }
+ {
+ "debug", false.ToString()
+ }
};
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/Opera/Super.cs b/Aaru.Filesystems/Opera/Super.cs
index e833d9869..d6ca19cba 100644
--- a/Aaru.Filesystems/Opera/Super.cs
+++ b/Aaru.Filesystems/Opera/Super.cs
@@ -60,8 +60,7 @@ public sealed partial class OperaFS
SuperBlock sb = Marshal.ByteArrayToStructureBigEndian(sbSector);
- if(sb.record_type != 1 ||
- sb.record_version != 1)
+ if(sb.record_type != 1 || sb.record_version != 1)
return ErrorNumber.InvalidArgument;
if(Encoding.ASCII.GetString(sb.sync_bytes) != SYNC)
diff --git a/Aaru.Filesystems/PCFX/Info.cs b/Aaru.Filesystems/PCFX/Info.cs
index 680ffc2b2..3861edbb1 100644
--- a/Aaru.Filesystems/PCFX/Info.cs
+++ b/Aaru.Filesystems/PCFX/Info.cs
@@ -50,8 +50,7 @@ public sealed partial class PCFX
///
public bool Identify(IMediaImage imagePlugin, Partition partition)
{
- if(2 + partition.Start >= partition.End ||
- imagePlugin.Info.MetadataMediaType != MetadataMediaType.OpticalDisc)
+ if(2 + partition.Start >= partition.End || imagePlugin.Info.MetadataMediaType != MetadataMediaType.OpticalDisc)
return false;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, 2, out byte[] sector);
diff --git a/Aaru.Filesystems/PFS/Info.cs b/Aaru.Filesystems/PFS/Info.cs
index 8f9f39b8d..e9d5186d3 100644
--- a/Aaru.Filesystems/PFS/Info.cs
+++ b/Aaru.Filesystems/PFS/Info.cs
@@ -112,7 +112,8 @@ public sealed partial class PFS
sbInformation.AppendFormat(Localization.Volume_created_on_0,
DateHandlers.AmigaToDateTime(rootBlock.creationday, rootBlock.creationminute,
- rootBlock.creationtick)).AppendLine();
+ rootBlock.creationtick)).
+ AppendLine();
if(rootBlock.extension > 0)
{
diff --git a/Aaru.Filesystems/ProDOS/Info.cs b/Aaru.Filesystems/ProDOS/Info.cs
index 06fadf034..7795e8594 100644
--- a/Aaru.Filesystems/ProDOS/Info.cs
+++ b/Aaru.Filesystems/ProDOS/Info.cs
@@ -75,10 +75,14 @@ public sealed partial class ProDOSPlugin
if(errno != ErrorNumber.NoError)
return false;
- foreach(int offset in new[] { 0, 0x200, 0x400, 0x600, 0x800, 0xA00 }.Where(
- offset => tmp.Length > offset + 0x200 && BitConverter.ToUInt16(tmp, offset) == 0 &&
+ foreach(int offset in new[]
+ {
+ 0, 0x200, 0x400, 0x600, 0x800, 0xA00
+ }.Where(offset => tmp.Length > offset + 0x200 &&
+ BitConverter.ToUInt16(tmp, offset) == 0 &&
(byte)((tmp[offset + 0x04] & STORAGE_TYPE_MASK) >> 4) == ROOT_DIRECTORY_TYPE &&
- tmp[offset + 0x23] == ENTRY_LENGTH && tmp[offset + 0x24] == ENTRIES_PER_BLOCK))
+ tmp[offset + 0x23] == ENTRY_LENGTH &&
+ tmp[offset + 0x24] == ENTRIES_PER_BLOCK))
{
Array.Copy(tmp, offset, rootDirectoryKeyBlock, 0, 0x200);
apmFromHddOnCd = true;
@@ -154,10 +158,13 @@ public sealed partial class ProDOSPlugin
if(errno != ErrorNumber.NoError)
return;
- foreach(int offset in new[] { 0, 0x200, 0x400, 0x600, 0x800, 0xA00 }.Where(
- offset => BitConverter.ToUInt16(tmp, offset) == 0 &&
+ foreach(int offset in new[]
+ {
+ 0, 0x200, 0x400, 0x600, 0x800, 0xA00
+ }.Where(offset => BitConverter.ToUInt16(tmp, offset) == 0 &&
(byte)((tmp[offset + 0x04] & STORAGE_TYPE_MASK) >> 4) == ROOT_DIRECTORY_TYPE &&
- tmp[offset + 0x23] == ENTRY_LENGTH && tmp[offset + 0x24] == ENTRIES_PER_BLOCK))
+ tmp[offset + 0x23] == ENTRY_LENGTH &&
+ tmp[offset + 0x24] == ENTRIES_PER_BLOCK))
{
Array.Copy(tmp, offset, rootDirectoryKeyBlockBytes, 0, 0x200);
apmFromHddOnCd = true;
@@ -203,9 +210,8 @@ public sealed partial class ProDOSPlugin
AaruConsole.DebugWriteLine(MODULE_NAME, "temp_timestamp_right = 0x{0:X4}", tempTimestampRight);
AaruConsole.DebugWriteLine(MODULE_NAME, "temp_timestamp = 0x{0:X8}", tempTimestamp);
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Datetime_field_year_0_month_1_day_2_hour_3_minute_4, year, month,
- day, hour, minute);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Datetime_field_year_0_month_1_day_2_hour_3_minute_4,
+ year, month, day, hour, minute);
rootDirectoryKeyBlock.header.creation_time = new DateTime(year, month, day, hour, minute, 0);
dateCorrect = true;
@@ -231,8 +237,7 @@ public sealed partial class ProDOSPlugin
AppendLine();
}
- if(rootDirectoryKeyBlock.header.version != VERSION1 ||
- rootDirectoryKeyBlock.header.min_version != VERSION1)
+ if(rootDirectoryKeyBlock.header.version != VERSION1 || rootDirectoryKeyBlock.header.min_version != VERSION1)
{
sbInformation.AppendLine(Localization.Warning_Detected_unknown_ProDOS_version_ProDOS_filesystem);
sbInformation.AppendLine(Localization.All_of_the_following_information_may_be_incorrect);
@@ -243,7 +248,8 @@ public sealed partial class ProDOSPlugin
else
{
sbInformation.AppendFormat(Localization.Unknown_ProDOS_version_with_field_0_used_to_create_this_volume,
- rootDirectoryKeyBlock.header.version).AppendLine();
+ rootDirectoryKeyBlock.header.version).
+ AppendLine();
}
if(rootDirectoryKeyBlock.header.min_version == VERSION1)
@@ -251,9 +257,9 @@ public sealed partial class ProDOSPlugin
else
{
sbInformation.
- AppendFormat(
- Localization.Unknown_ProDOS_version_with_field_0_is_at_least_required_for_reading_this_volume,
- rootDirectoryKeyBlock.header.min_version).AppendLine();
+ AppendFormat(Localization.Unknown_ProDOS_version_with_field_0_is_at_least_required_for_reading_this_volume,
+ rootDirectoryKeyBlock.header.min_version).
+ AppendLine();
}
sbInformation.AppendFormat(Localization.Volume_name_is_0, rootDirectoryKeyBlock.header.volume_name).
@@ -314,8 +320,8 @@ public sealed partial class ProDOSPlugin
Type = FS_TYPE
};
- metadata.ClusterSize = (uint)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize /
- metadata.Clusters);
+ metadata.ClusterSize =
+ (uint)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / metadata.Clusters);
if(!dateCorrect)
return;
diff --git a/Aaru.Filesystems/QNX4/Info.cs b/Aaru.Filesystems/QNX4/Info.cs
index c0da96083..d9e694c56 100644
--- a/Aaru.Filesystems/QNX4/Info.cs
+++ b/Aaru.Filesystems/QNX4/Info.cs
@@ -79,7 +79,8 @@ public sealed partial class QNX4
return false;
// Check inodes are in use
- return (qnxSb.rootDir.di_status & 0x01) == 0x01 && (qnxSb.inode.di_status & 0x01) == 0x01 &&
+ return (qnxSb.rootDir.di_status & 0x01) == 0x01 &&
+ (qnxSb.inode.di_status & 0x01) == 0x01 &&
(qnxSb.boot.di_status & 0x01) == 0x01;
// All hail filesystems without identification marks
@@ -176,9 +177,11 @@ public sealed partial class QNX4
AaruConsole.DebugWriteLine(MODULE_NAME, "qnxSb.altBoot.di_status = {0}", qnxSb.altBoot.di_status);
*/
- information = Localization.QNX4_filesystem + "\n" +
+ information = Localization.QNX4_filesystem +
+ "\n" +
string.Format(Localization.Created_on_0,
- DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime)) + "\n";
+ DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime)) +
+ "\n";
metadata = new FileSystem
{
diff --git a/Aaru.Filesystems/QNX6/Info.cs b/Aaru.Filesystems/QNX6/Info.cs
index 12bbe45f7..d7216c39a 100644
--- a/Aaru.Filesystems/QNX6/Info.cs
+++ b/Aaru.Filesystems/QNX6/Info.cs
@@ -109,7 +109,8 @@ public sealed partial class QNX6
sb.AppendFormat(Localization._0_blocks_1_bytes_free_of_2_3_bytes, audiSb.freeBlocks,
audiSb.freeBlocks * audiSb.blockSize, audiSb.numBlocks,
- audiSb.numBlocks * audiSb.blockSize).AppendLine();
+ audiSb.numBlocks * audiSb.blockSize).
+ AppendLine();
metadata = new FileSystem
{
diff --git a/Aaru.Filesystems/RBF/Info.cs b/Aaru.Filesystems/RBF/Info.cs
index dea4028bc..3a4860c9f 100644
--- a/Aaru.Filesystems/RBF/Info.cs
+++ b/Aaru.Filesystems/RBF/Info.cs
@@ -51,7 +51,10 @@ public sealed partial class RBF : IFilesystem
// Documentation says ID should be sector 0
// I've found that OS-9/X68000 has it on sector 4
// I've read OS-9/Apple2 has it on sector 15
- foreach(int i in new[] { 0, 4, 15 })
+ foreach(int i in new[]
+ {
+ 0, 4, 15
+ })
{
var location = (ulong)i;
@@ -77,8 +80,7 @@ public sealed partial class RBF : IFilesystem
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.magic_at_0_equals_1_or_2_expected_3_or_4, location,
rbfSb.dd_sync, rbf9000Sb.rid_sync, RBF_SYNC, RBF_CNYS);
- if(rbfSb.dd_sync == RBF_SYNC ||
- rbf9000Sb.rid_sync is RBF_SYNC or RBF_CNYS)
+ if(rbfSb.dd_sync == RBF_SYNC || rbf9000Sb.rid_sync is RBF_SYNC or RBF_CNYS)
return true;
}
@@ -99,7 +101,10 @@ public sealed partial class RBF : IFilesystem
var rbfSb = new IdSector();
var rbf9000Sb = new NewIdSector();
- foreach(int i in new[] { 0, 4, 15 })
+ foreach(int i in new[]
+ {
+ 0, 4, 15
+ })
{
var location = (ulong)i;
var sbSize = (uint)(Marshal.SizeOf() / imagePlugin.Info.SectorSize);
@@ -121,14 +126,11 @@ public sealed partial class RBF : IFilesystem
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.magic_at_0_equals_1_or_2_expected_3_or_4, location,
rbfSb.dd_sync, rbf9000Sb.rid_sync, RBF_SYNC, RBF_CNYS);
- if(rbfSb.dd_sync == RBF_SYNC ||
- rbf9000Sb.rid_sync is RBF_SYNC or RBF_CNYS)
+ if(rbfSb.dd_sync == RBF_SYNC || rbf9000Sb.rid_sync is RBF_SYNC or RBF_CNYS)
break;
}
- if(rbfSb.dd_sync != RBF_SYNC &&
- rbf9000Sb.rid_sync != RBF_SYNC &&
- rbf9000Sb.rid_sync != RBF_CNYS)
+ if(rbfSb.dd_sync != RBF_SYNC && rbf9000Sb.rid_sync != RBF_SYNC && rbf9000Sb.rid_sync != RBF_CNYS)
return;
if(rbf9000Sb.rid_sync == RBF_CNYS)
@@ -167,7 +169,8 @@ public sealed partial class RBF : IFilesystem
sb.AppendLine(Localization.Disk_is_48_TPI);
sb.AppendFormat(Localization.Allocation_bitmap_descriptor_starts_at_block_0,
- rbf9000Sb.rid_bitmap == 0 ? 1 : rbf9000Sb.rid_bitmap).AppendLine();
+ rbf9000Sb.rid_bitmap == 0 ? 1 : rbf9000Sb.rid_bitmap).
+ AppendLine();
if(rbf9000Sb.rid_firstboot > 0)
{
@@ -191,7 +194,8 @@ public sealed partial class RBF : IFilesystem
AppendLine();
sb.AppendFormat(Localization.Volume_identification_block_was_last_written_on_0,
- DateHandlers.UnixToDateTime(rbf9000Sb.rid_mtime)).AppendLine();
+ DateHandlers.UnixToDateTime(rbf9000Sb.rid_mtime)).
+ AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(rbf9000Sb.rid_name, encoding)).
AppendLine();
@@ -217,7 +221,8 @@ public sealed partial class RBF : IFilesystem
sb.AppendFormat(Localization._0_bytes_per_sector, 256 << rbfSb.dd_lsnsize).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_cluster_1_bytes, rbfSb.dd_bit,
- rbfSb.dd_bit * (256 << rbfSb.dd_lsnsize)).AppendLine();
+ rbfSb.dd_bit * (256 << rbfSb.dd_lsnsize)).
+ AppendLine();
// TODO: Convert to flags?
sb.AppendLine((rbfSb.dd_fmt & 0x01) == 0x01
@@ -238,15 +243,16 @@ public sealed partial class RBF : IFilesystem
sb.AppendLine(Localization.Disk_is_48_TPI);
sb.AppendFormat(Localization.Allocation_bitmap_descriptor_starts_at_block_0,
- rbfSb.dd_maplsn == 0 ? 1 : rbfSb.dd_maplsn).AppendLine();
+ rbfSb.dd_maplsn == 0 ? 1 : rbfSb.dd_maplsn).
+ AppendLine();
sb.AppendFormat(Localization._0_bytes_in_allocation_bitmap, rbfSb.dd_map).AppendLine();
- if(LSNToUInt32(rbfSb.dd_bt) > 0 &&
- rbfSb.dd_bsz > 0)
+ if(LSNToUInt32(rbfSb.dd_bt) > 0 && rbfSb.dd_bsz > 0)
{
sb.AppendFormat(Localization.Boot_file_starts_at_block_0_and_has_1_bytes, LSNToUInt32(rbfSb.dd_bt),
- rbfSb.dd_bsz).AppendLine();
+ rbfSb.dd_bsz).
+ AppendLine();
}
sb.AppendFormat(Localization.Root_directory_descriptor_starts_at_block_0, LSNToUInt32(rbfSb.dd_dir)).
diff --git a/Aaru.Filesystems/RT11/Info.cs b/Aaru.Filesystems/RT11/Info.cs
index 900cddcac..2a4882a30 100644
--- a/Aaru.Filesystems/RT11/Info.cs
+++ b/Aaru.Filesystems/RT11/Info.cs
@@ -102,7 +102,8 @@ public sealed partial class RT11
check += BitConverter.ToUInt16(hbSector, i);
sb.AppendFormat(Localization.Volume_format_is_0,
- StringHandlers.SpacePaddedToString(homeblock.format, Encoding.ASCII)).AppendLine();
+ StringHandlers.SpacePaddedToString(homeblock.format, Encoding.ASCII)).
+ AppendLine();
sb.AppendFormat(Localization._0_sectors_per_cluster_1_bytes, homeblock.cluster, homeblock.cluster * 512).
AppendLine();
diff --git a/Aaru.Filesystems/ReFS/Consts.cs b/Aaru.Filesystems/ReFS/Consts.cs
index d96e3767c..93d775c6b 100644
--- a/Aaru.Filesystems/ReFS/Consts.cs
+++ b/Aaru.Filesystems/ReFS/Consts.cs
@@ -34,6 +34,9 @@ public sealed partial class ReFS
{
const uint FSRS = 0x53525346;
- const string FS_TYPE = "refs";
- readonly byte[] _signature = { 0x52, 0x65, 0x46, 0x53, 0x00, 0x00, 0x00, 0x00 };
+ const string FS_TYPE = "refs";
+ readonly byte[] _signature =
+ {
+ 0x52, 0x65, 0x46, 0x53, 0x00, 0x00, 0x00, 0x00
+ };
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/ReFS/Info.cs b/Aaru.Filesystems/ReFS/Info.cs
index b221d3dae..b727bd3b7 100644
--- a/Aaru.Filesystems/ReFS/Info.cs
+++ b/Aaru.Filesystems/ReFS/Info.cs
@@ -65,7 +65,8 @@ public sealed partial class ReFS : IFilesystem
VolumeHeader vhdr = Marshal.ByteArrayToStructureLittleEndian(sector);
- return vhdr.identifier == FSRS && ArrayHelpers.ArrayIsNullOrEmpty(vhdr.mustBeZero) &&
+ return vhdr.identifier == FSRS &&
+ ArrayHelpers.ArrayIsNullOrEmpty(vhdr.mustBeZero) &&
vhdr.signature.SequenceEqual(_signature);
}
@@ -132,7 +133,8 @@ public sealed partial class ReFS : IFilesystem
sb.AppendFormat(Localization.Volume_uses_0_bytes_per_sector, vhdr.bytesPerSector).AppendLine();
sb.AppendFormat(Localization.Volume_uses_0_sectors_per_cluster_1_bytes, vhdr.sectorsPerCluster,
- vhdr.sectorsPerCluster * vhdr.bytesPerSector).AppendLine();
+ vhdr.sectorsPerCluster * vhdr.bytesPerSector).
+ AppendLine();
sb.AppendFormat(Localization.Volume_has_0_sectors_1_bytes, vhdr.sectors, vhdr.sectors * vhdr.bytesPerSector).
AppendLine();
diff --git a/Aaru.Filesystems/Reiser/Consts.cs b/Aaru.Filesystems/Reiser/Consts.cs
index 1bc191a35..8609e02d8 100644
--- a/Aaru.Filesystems/Reiser/Consts.cs
+++ b/Aaru.Filesystems/Reiser/Consts.cs
@@ -36,7 +36,16 @@ public sealed partial class Reiser
const string FS_TYPE = "reiserfs";
- readonly byte[] _magic35 = { 0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x46, 0x73, 0x00, 0x00 };
- readonly byte[] _magic36 = { 0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x32, 0x46, 0x73, 0x00 };
- readonly byte[] _magicJr = { 0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x33, 0x46, 0x73, 0x00 };
+ readonly byte[] _magic35 =
+ {
+ 0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x46, 0x73, 0x00, 0x00
+ };
+ readonly byte[] _magic36 =
+ {
+ 0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x32, 0x46, 0x73, 0x00
+ };
+ readonly byte[] _magicJr =
+ {
+ 0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x33, 0x46, 0x73, 0x00
+ };
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/Reiser/Info.cs b/Aaru.Filesystems/Reiser/Info.cs
index 94d8725df..44ed2962c 100644
--- a/Aaru.Filesystems/Reiser/Info.cs
+++ b/Aaru.Filesystems/Reiser/Info.cs
@@ -71,7 +71,8 @@ public sealed partial class Reiser : IFilesystem
Superblock reiserSb = Marshal.ByteArrayToStructureLittleEndian(sector);
- return _magic35.SequenceEqual(reiserSb.magic) || _magic36.SequenceEqual(reiserSb.magic) ||
+ return _magic35.SequenceEqual(reiserSb.magic) ||
+ _magic36.SequenceEqual(reiserSb.magic) ||
_magicJr.SequenceEqual(reiserSb.magic);
}
@@ -121,7 +122,8 @@ public sealed partial class Reiser : IFilesystem
sb.AppendLine(Localization.Reiser_Jr_filesystem);
sb.AppendFormat(Localization.Volume_has_0_blocks_with_1_blocks_free, reiserSb.block_count,
- reiserSb.free_blocks).AppendLine();
+ reiserSb.free_blocks).
+ AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, reiserSb.blocksize).AppendLine();
sb.AppendFormat(Localization.Root_directory_resides_on_block_0, reiserSb.root_block).AppendLine();
@@ -130,7 +132,8 @@ public sealed partial class Reiser : IFilesystem
sb.AppendLine(Localization.Volume_has_not_been_cleanly_umounted);
sb.AppendFormat(Localization.Volume_last_checked_on_0,
- DateHandlers.UnixUnsignedToDateTime(reiserSb.last_check)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(reiserSb.last_check)).
+ AppendLine();
if(reiserSb.version >= 2)
{
diff --git a/Aaru.Filesystems/SFS/Info.cs b/Aaru.Filesystems/SFS/Info.cs
index f8dde3225..1d20519fd 100644
--- a/Aaru.Filesystems/SFS/Info.cs
+++ b/Aaru.Filesystems/SFS/Info.cs
@@ -77,13 +77,16 @@ public sealed partial class SFS
sbInformation.AppendFormat(Localization.Volume_version_0, rootBlock.version).AppendLine();
sbInformation.AppendFormat(Localization.Volume_starts_on_device_byte_0_and_ends_on_byte_1, rootBlock.firstbyte,
- rootBlock.lastbyte).AppendLine();
+ rootBlock.lastbyte).
+ AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_blocks_of_1_bytes_each, rootBlock.totalblocks,
- rootBlock.blocksize).AppendLine();
+ rootBlock.blocksize).
+ AppendLine();
sbInformation.AppendFormat(Localization.Volume_created_on_0,
- DateHandlers.UnixUnsignedToDateTime(rootBlock.datecreated).AddYears(8)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(rootBlock.datecreated).AddYears(8)).
+ AppendLine();
sbInformation.AppendFormat(Localization.Bitmap_starts_at_block_0, rootBlock.bitmapbase).AppendLine();
diff --git a/Aaru.Filesystems/SolarFS/Info.cs b/Aaru.Filesystems/SolarFS/Info.cs
index a08a5f183..a0fc225ca 100644
--- a/Aaru.Filesystems/SolarFS/Info.cs
+++ b/Aaru.Filesystems/SolarFS/Info.cs
@@ -108,8 +108,8 @@ public sealed partial class SolarFS
Array.Copy(bpbSector, 0x1B, bpb.unk3, 0, 10);
bpb.unk4 = BitConverter.ToUInt32(bpbSector, 0x26);
- AaruConsole.DebugWriteLine(MODULE_NAME, "BPB.x86_jump: 0x{0:X2}{1:X2}{2:X2}", bpb.x86_jump[0],
- bpb.x86_jump[1], bpb.x86_jump[2]);
+ AaruConsole.DebugWriteLine(MODULE_NAME, "BPB.x86_jump: 0x{0:X2}{1:X2}{2:X2}", bpb.x86_jump[0], bpb.x86_jump[1],
+ bpb.x86_jump[2]);
AaruConsole.DebugWriteLine(MODULE_NAME, "BPB.OEMName: \"{0}\"", bpb.OEMName);
AaruConsole.DebugWriteLine(MODULE_NAME, "BPB.bps: {0}", bpb.bps);
@@ -141,18 +141,17 @@ public sealed partial class SolarFS
if(bpb.bps != imagePlugin.Info.SectorSize)
{
sb.
- AppendFormat(
- Localization.
- WARNING_Filesystem_describes_a_0_bytes_sector_while_device_describes_a_1_bytes_sector,
- bpb.bps, 2048).AppendLine();
+ AppendFormat(Localization.WARNING_Filesystem_describes_a_0_bytes_sector_while_device_describes_a_1_bytes_sector,
+ bpb.bps, 2048).
+ AppendLine();
}
}
else if(bpb.bps != imagePlugin.Info.SectorSize)
{
sb.
- AppendFormat(
- Localization.WARNING_Filesystem_describes_a_0_bytes_sector_while_device_describes_a_1_bytes_sector,
- bpb.bps, imagePlugin.Info.SectorSize).AppendLine();
+ AppendFormat(Localization.WARNING_Filesystem_describes_a_0_bytes_sector_while_device_describes_a_1_bytes_sector,
+ bpb.bps, imagePlugin.Info.SectorSize).
+ AppendLine();
}
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, bpb.sectors, bpb.sectors * bpb.bps).AppendLine();
diff --git a/Aaru.Filesystems/SysV/Info.cs b/Aaru.Filesystems/SysV/Info.cs
index e01e2810a..8e1c71df8 100644
--- a/Aaru.Filesystems/SysV/Info.cs
+++ b/Aaru.Filesystems/SysV/Info.cs
@@ -65,7 +65,8 @@ public sealed partial class SysVfs
sb_size_in_sectors = 1; // If not a single sector can store it
if(partition.End <=
- partition.Start + 4 * (ulong)sb_size_in_sectors +
+ partition.Start +
+ 4 * (ulong)sb_size_in_sectors +
sb_size_in_sectors) // Device must be bigger than SB location + SB size + offset
return false;
@@ -87,8 +88,7 @@ public sealed partial class SysVfs
ErrorNumber errno =
imagePlugin.ReadSectors((ulong)i + partition.Start, sb_size_in_sectors, out byte[] sb_sector);
- if(errno != ErrorNumber.NoError ||
- sb_sector.Length < 0x400)
+ if(errno != ErrorNumber.NoError || sb_sector.Length < 0x400)
continue;
var magic = BitConverter.ToUInt32(sb_sector, 0x3F8);
@@ -122,31 +122,25 @@ public sealed partial class SysVfs
var s_nfree = BitConverter.ToUInt16(sb_sector, 0x006);
var s_ninode = BitConverter.ToUInt16(sb_sector, 0x0D0);
- if(s_fsize is <= 0 or >= 0xFFFFFFFF ||
- s_nfree is <= 0 or >= 0xFFFF ||
- s_ninode is <= 0 or >= 0xFFFF)
+ if(s_fsize is <= 0 or >= 0xFFFFFFFF || s_nfree is <= 0 or >= 0xFFFF || s_ninode is <= 0 or >= 0xFFFF)
continue;
- if((s_fsize & 0xFF) == 0x00 &&
- (s_nfree & 0xFF) == 0x00 &&
- (s_ninode & 0xFF) == 0x00)
+ if((s_fsize & 0xFF) == 0x00 && (s_nfree & 0xFF) == 0x00 && (s_ninode & 0xFF) == 0x00)
{
// Byteswap
- s_fsize = ((s_fsize & 0xFF) << 24) + ((s_fsize & 0xFF00) << 8) + ((s_fsize & 0xFF0000) >> 8) +
+ s_fsize = ((s_fsize & 0xFF) << 24) +
+ ((s_fsize & 0xFF00) << 8) +
+ ((s_fsize & 0xFF0000) >> 8) +
((s_fsize & 0xFF000000) >> 24);
s_nfree = (ushort)(s_nfree >> 8);
s_ninode = (ushort)(s_ninode >> 8);
}
- if((s_fsize & 0xFF000000) != 0x00 ||
- (s_nfree & 0xFF00) != 0x00 ||
- (s_ninode & 0xFF00) != 0x00)
+ if((s_fsize & 0xFF000000) != 0x00 || (s_nfree & 0xFF00) != 0x00 || (s_ninode & 0xFF00) != 0x00)
continue;
- if(s_fsize >= V7_MAXSIZE ||
- s_nfree >= V7_NICFREE ||
- s_ninode >= V7_NICINOD)
+ if(s_fsize >= V7_MAXSIZE || s_nfree >= V7_NICFREE || s_ninode >= V7_NICINOD)
continue;
if(s_fsize * 1024 == (partition.End - partition.Start) * imagePlugin.Info.SectorSize ||
@@ -297,31 +291,25 @@ public sealed partial class SysVfs
var s_nfree = BitConverter.ToUInt16(sb_sector, 0x006);
var s_ninode = BitConverter.ToUInt16(sb_sector, 0x0D0);
- if(s_fsize is <= 0 or >= 0xFFFFFFFF ||
- s_nfree is <= 0 or >= 0xFFFF ||
- s_ninode is <= 0 or >= 0xFFFF)
+ if(s_fsize is <= 0 or >= 0xFFFFFFFF || s_nfree is <= 0 or >= 0xFFFF || s_ninode is <= 0 or >= 0xFFFF)
continue;
- if((s_fsize & 0xFF) == 0x00 &&
- (s_nfree & 0xFF) == 0x00 &&
- (s_ninode & 0xFF) == 0x00)
+ if((s_fsize & 0xFF) == 0x00 && (s_nfree & 0xFF) == 0x00 && (s_ninode & 0xFF) == 0x00)
{
// Byteswap
- s_fsize = ((s_fsize & 0xFF) << 24) + ((s_fsize & 0xFF00) << 8) + ((s_fsize & 0xFF0000) >> 8) +
+ s_fsize = ((s_fsize & 0xFF) << 24) +
+ ((s_fsize & 0xFF00) << 8) +
+ ((s_fsize & 0xFF0000) >> 8) +
((s_fsize & 0xFF000000) >> 24);
s_nfree = (ushort)(s_nfree >> 8);
s_ninode = (ushort)(s_ninode >> 8);
}
- if((s_fsize & 0xFF000000) != 0x00 ||
- (s_nfree & 0xFF00) != 0x00 ||
- (s_ninode & 0xFF00) != 0x00)
+ if((s_fsize & 0xFF000000) != 0x00 || (s_nfree & 0xFF00) != 0x00 || (s_ninode & 0xFF00) != 0x00)
continue;
- if(s_fsize >= V7_MAXSIZE ||
- s_nfree >= V7_NICFREE ||
- s_ninode >= V7_NICINOD)
+ if(s_fsize >= V7_MAXSIZE || s_nfree >= V7_NICFREE || s_ninode >= V7_NICINOD)
continue;
if(s_fsize * 1024 != (partition.End - partition.Start) * imagePlugin.Info.SectorSize &&
@@ -334,11 +322,7 @@ public sealed partial class SysVfs
break;
}
- if(!sys7th &&
- !sysv &&
- !coherent &&
- !xenix &&
- !xenix3)
+ if(!sys7th && !sysv && !coherent && !xenix && !xenix3)
return;
metadata = new FileSystem();
@@ -454,10 +438,9 @@ public sealed partial class SysVfs
if(bs != 2048)
{
sb.
- AppendFormat(
- Localization.
- WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
- bs, 2048).AppendLine();
+ AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
+ bs, 2048).
+ AppendLine();
}
}
else
@@ -465,10 +448,9 @@ public sealed partial class SysVfs
if(bs != imagePlugin.Info.SectorSize)
{
sb.
- AppendFormat(
- Localization.
- WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
- bs, imagePlugin.Info.SectorSize).AppendLine();
+ AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
+ bs, imagePlugin.Info.SectorSize).
+ AppendLine();
}
}
@@ -675,7 +657,8 @@ public sealed partial class SysVfs
sb.AppendLine(Localization.Volume_is_mounted_read_only);
sb.AppendFormat(Localization.Superblock_last_updated_on_0,
- DateHandlers.UnixUnsignedToDateTime(sysv_sb.s_time)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(sysv_sb.s_time)).
+ AppendLine();
if(sysv_sb.s_time != 0)
metadata.ModificationDate = DateHandlers.UnixUnsignedToDateTime(sysv_sb.s_time);
@@ -730,9 +713,9 @@ public sealed partial class SysVfs
if(imagePlugin.Info.SectorSize != 512)
{
sb.
- AppendFormat(
- Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
- 512, 2048).AppendLine();
+ AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
+ 512, 2048).
+ AppendLine();
}
sb.AppendFormat(Localization._0_zones_in_volume_1_bytes, coh_sb.s_fsize, coh_sb.s_fsize * 512).AppendLine();
@@ -760,7 +743,8 @@ public sealed partial class SysVfs
sb.AppendLine(Localization.Volume_is_mounted_read_only);
sb.AppendFormat(Localization.Superblock_last_updated_on_0,
- DateHandlers.UnixUnsignedToDateTime(coh_sb.s_time)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(coh_sb.s_time)).
+ AppendLine();
if(coh_sb.s_time != 0)
metadata.ModificationDate = DateHandlers.UnixUnsignedToDateTime(coh_sb.s_time);
@@ -806,9 +790,9 @@ public sealed partial class SysVfs
if(imagePlugin.Info.SectorSize != 512)
{
sb.
- AppendFormat(
- Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
- 512, 2048).AppendLine();
+ AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
+ 512, 2048).
+ AppendLine();
}
sb.AppendFormat(Localization._0_zones_in_volume_1_bytes, v7_sb.s_fsize, v7_sb.s_fsize * 512).AppendLine();
@@ -836,7 +820,8 @@ public sealed partial class SysVfs
sb.AppendLine(Localization.Volume_is_mounted_read_only);
sb.AppendFormat(Localization.Superblock_last_updated_on_0,
- DateHandlers.UnixUnsignedToDateTime(v7_sb.s_time)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(v7_sb.s_time)).
+ AppendLine();
if(v7_sb.s_time != 0)
metadata.ModificationDate = DateHandlers.UnixUnsignedToDateTime(v7_sb.s_time);
diff --git a/Aaru.Filesystems/UCSDPascal/Dir.cs b/Aaru.Filesystems/UCSDPascal/Dir.cs
index ba006d099..f841b8f24 100644
--- a/Aaru.Filesystems/UCSDPascal/Dir.cs
+++ b/Aaru.Filesystems/UCSDPascal/Dir.cs
@@ -51,12 +51,10 @@ public sealed partial class PascalPlugin
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(!string.IsNullOrEmpty(path) &&
- string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
+ if(!string.IsNullOrEmpty(path) && string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
return ErrorNumber.NotSupported;
- var contents = _fileEntries.Select(ent => StringHandlers.PascalToString(ent.Filename, _encoding)).
- ToList();
+ var contents = _fileEntries.Select(ent => StringHandlers.PascalToString(ent.Filename, _encoding)).ToList();
if(_debug)
{
diff --git a/Aaru.Filesystems/UCSDPascal/File.cs b/Aaru.Filesystems/UCSDPascal/File.cs
index 7e8a0b378..ccb7782f2 100644
--- a/Aaru.Filesystems/UCSDPascal/File.cs
+++ b/Aaru.Filesystems/UCSDPascal/File.cs
@@ -48,7 +48,10 @@ public sealed partial class PascalPlugin
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -71,15 +74,19 @@ public sealed partial class PascalPlugin
if(!_mounted)
return ErrorNumber.AccessDenied;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
byte[] file;
- if(_debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
- string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0))
+ if(_debug &&
+ (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
+ string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0))
file = string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ? _catalogBlocks : _bootBlocks;
else
{
@@ -133,8 +140,7 @@ public sealed partial class PascalPlugin
if(!_mounted)
return ErrorNumber.AccessDenied;
- if(buffer is null ||
- buffer.Length < length)
+ if(buffer is null || buffer.Length < length)
return ErrorNumber.InvalidArgument;
if(node is not PascalFileNode mynode)
@@ -156,7 +162,10 @@ public sealed partial class PascalPlugin
{
stat = null;
- string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ string[] pathElements = path.Split(new[]
+ {
+ '/'
+ }, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -218,7 +227,8 @@ public sealed partial class PascalPlugin
StringHandlers.PascalToString(ent.Filename,
_encoding),
StringComparison.
- InvariantCultureIgnoreCase) == 0))
+ InvariantCultureIgnoreCase) ==
+ 0))
{
entry = ent;
diff --git a/Aaru.Filesystems/UCSDPascal/Info.cs b/Aaru.Filesystems/UCSDPascal/Info.cs
index e81c51d27..af4ebd35f 100644
--- a/Aaru.Filesystems/UCSDPascal/Info.cs
+++ b/Aaru.Filesystems/UCSDPascal/Info.cs
@@ -104,8 +104,7 @@ public sealed partial class PascalPlugin
return false;
// Volume record entry type must be volume or secure
- if(volEntry.EntryType != PascalFileKind.Volume &&
- volEntry.EntryType != PascalFileKind.Secure)
+ if(volEntry.EntryType != PascalFileKind.Volume && volEntry.EntryType != PascalFileKind.Secure)
return false;
// Volume name is max 7 characters
@@ -113,8 +112,7 @@ public sealed partial class PascalPlugin
return false;
// Volume blocks is equal to volume sectors
- if(volEntry.Blocks < 0 ||
- (ulong)volEntry.Blocks != imagePlugin.Info.Sectors / _multiplier)
+ if(volEntry.Blocks < 0 || (ulong)volEntry.Blocks != imagePlugin.Info.Sectors / _multiplier)
return false;
// There can be not less than zero files
@@ -171,8 +169,7 @@ public sealed partial class PascalPlugin
return;
// Volume record entry type must be volume or secure
- if(volEntry.EntryType != PascalFileKind.Volume &&
- volEntry.EntryType != PascalFileKind.Secure)
+ if(volEntry.EntryType != PascalFileKind.Volume && volEntry.EntryType != PascalFileKind.Secure)
return;
// Volume name is max 7 characters
@@ -180,8 +177,7 @@ public sealed partial class PascalPlugin
return;
// Volume blocks is equal to volume sectors
- if(volEntry.Blocks < 0 ||
- (ulong)volEntry.Blocks != imagePlugin.Info.Sectors / _multiplier)
+ if(volEntry.Blocks < 0 || (ulong)volEntry.Blocks != imagePlugin.Info.Sectors / _multiplier)
return;
// There can be not less than zero files
@@ -189,7 +185,8 @@ public sealed partial class PascalPlugin
return;
sbInformation.AppendFormat(Localization.Volume_record_spans_from_block_0_to_block_1, volEntry.FirstBlock,
- volEntry.LastBlock).AppendLine();
+ volEntry.LastBlock).
+ AppendLine();
sbInformation.
AppendFormat(Localization.Volume_name_0, StringHandlers.PascalToString(volEntry.VolumeName, encoding)).
diff --git a/Aaru.Filesystems/UCSDPascal/Super.cs b/Aaru.Filesystems/UCSDPascal/Super.cs
index f17d0f871..83c0e4d93 100644
--- a/Aaru.Filesystems/UCSDPascal/Super.cs
+++ b/Aaru.Filesystems/UCSDPascal/Super.cs
@@ -87,14 +87,13 @@ public sealed partial class PascalPlugin
_mountedVolEntry.LastBoot = BigEndianBitConverter.ToInt16(_catalogBlocks, 0x14);
_mountedVolEntry.Tail = BigEndianBitConverter.ToInt32(_catalogBlocks, 0x16);
- if(_mountedVolEntry.FirstBlock != 0 ||
- _mountedVolEntry.LastBlock <= _mountedVolEntry.FirstBlock ||
- (ulong)_mountedVolEntry.LastBlock > _device.Info.Sectors / _multiplier - 2 ||
- _mountedVolEntry.EntryType != PascalFileKind.Volume &&
- _mountedVolEntry.EntryType != PascalFileKind.Secure ||
- _mountedVolEntry.VolumeName[0] > 7 ||
- _mountedVolEntry.Blocks < 0 ||
- (ulong)_mountedVolEntry.Blocks != _device.Info.Sectors / _multiplier ||
+ if(_mountedVolEntry.FirstBlock != 0 ||
+ _mountedVolEntry.LastBlock <= _mountedVolEntry.FirstBlock ||
+ (ulong)_mountedVolEntry.LastBlock > _device.Info.Sectors / _multiplier - 2 ||
+ _mountedVolEntry.EntryType != PascalFileKind.Volume && _mountedVolEntry.EntryType != PascalFileKind.Secure ||
+ _mountedVolEntry.VolumeName[0] > 7 ||
+ _mountedVolEntry.Blocks < 0 ||
+ (ulong)_mountedVolEntry.Blocks != _device.Info.Sectors / _multiplier ||
_mountedVolEntry.Files < 0)
return ErrorNumber.InvalidArgument;
@@ -123,8 +122,7 @@ public sealed partial class PascalPlugin
Array.Copy(_catalogBlocks, offset + 0x06, entry.Filename, 0, 16);
- if(entry.Filename[0] <= 15 &&
- entry.Filename[0] > 0)
+ if(entry.Filename[0] <= 15 && entry.Filename[0] > 0)
_fileEntries.Add(entry);
offset += 26;
diff --git a/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs b/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs
index d539a5358..f7fc3f503 100644
--- a/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs
+++ b/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs
@@ -100,6 +100,8 @@ public sealed partial class PascalPlugin : IReadOnlyFilesystem
static Dictionary GetDefaultOptions() => new()
{
- { "debug", false.ToString() }
+ {
+ "debug", false.ToString()
+ }
};
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/UDF/Info.cs b/Aaru.Filesystems/UDF/Info.cs
index 3c4dca965..3899d3284 100644
--- a/Aaru.Filesystems/UDF/Info.cs
+++ b/Aaru.Filesystems/UDF/Info.cs
@@ -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
{
diff --git a/Aaru.Filesystems/UNICOS/Info.cs b/Aaru.Filesystems/UNICOS/Info.cs
index 9f3ecd3da..8316228d7 100644
--- a/Aaru.Filesystems/UNICOS/Info.cs
+++ b/Aaru.Filesystems/UNICOS/Info.cs
@@ -74,8 +74,7 @@ public sealed partial class UNICOS
Superblock unicosSb = Marshal.ByteArrayToStructureBigEndian(sector);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.magic_equals_0_expected_1, unicosSb.s_magic,
- UNICOS_MAGIC);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.magic_equals_0_expected_1, unicosSb.s_magic, UNICOS_MAGIC);
return unicosSb.s_magic == UNICOS_MAGIC;
}
diff --git a/Aaru.Filesystems/UNIXBFS/Info.cs b/Aaru.Filesystems/UNIXBFS/Info.cs
index 14335c184..2112f6595 100644
--- a/Aaru.Filesystems/UNIXBFS/Info.cs
+++ b/Aaru.Filesystems/UNIXBFS/Info.cs
@@ -105,7 +105,8 @@ public sealed partial class BFS
sb.AppendLine(Localization.UNIX_Boot_Filesystem);
sb.AppendFormat(Localization.Volume_goes_from_byte_0_to_byte_1_for_2_bytes, bfsSb.s_start, bfsSb.s_end,
- bfsSb.s_end - bfsSb.s_start).AppendLine();
+ bfsSb.s_end - bfsSb.s_start).
+ AppendLine();
sb.AppendFormat(Localization.Filesystem_name_0, bfsSb.s_fsname).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, bfsSb.s_volume).AppendLine();
diff --git a/Aaru.Filesystems/VMfs/Info.cs b/Aaru.Filesystems/VMfs/Info.cs
index 3dde32e8c..61a1da616 100644
--- a/Aaru.Filesystems/VMfs/Info.cs
+++ b/Aaru.Filesystems/VMfs/Info.cs
@@ -102,10 +102,12 @@ public sealed partial class VMfs
sbInformation.AppendFormat(Localization.Volume_UUID_0, volInfo.uuid).AppendLine();
sbInformation.AppendFormat(Localization.Volume_created_on_0,
- DateHandlers.UnixUnsignedToDateTime(ctimeSecs, ctimeNanoSecs)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(ctimeSecs, ctimeNanoSecs)).
+ AppendLine();
sbInformation.AppendFormat(Localization.Volume_last_modified_on_0,
- DateHandlers.UnixUnsignedToDateTime(mtimeSecs, mtimeNanoSecs)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(mtimeSecs, mtimeNanoSecs)).
+ AppendLine();
information = sbInformation.ToString();
diff --git a/Aaru.Filesystems/VxFS/Info.cs b/Aaru.Filesystems/VxFS/Info.cs
index b99ac6cde..63da51199 100644
--- a/Aaru.Filesystems/VxFS/Info.cs
+++ b/Aaru.Filesystems/VxFS/Info.cs
@@ -92,10 +92,12 @@ public sealed partial class VxFS
sbInformation.AppendFormat(Localization.Volume_has_0_free_blocks, vxSb.vs_free).AppendLine();
sbInformation.AppendFormat(Localization.Volume_created_on_0,
- DateHandlers.UnixUnsignedToDateTime(vxSb.vs_ctime, vxSb.vs_cutime)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(vxSb.vs_ctime, vxSb.vs_cutime)).
+ AppendLine();
sbInformation.AppendFormat(Localization.Volume_last_modified_on_0,
- DateHandlers.UnixUnsignedToDateTime(vxSb.vs_wtime, vxSb.vs_wutime)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(vxSb.vs_wtime, vxSb.vs_wutime)).
+ AppendLine();
if(vxSb.vs_clean != 0)
sbInformation.AppendLine(Localization.Volume_is_dirty);
diff --git a/Aaru.Filesystems/XFS/Info.cs b/Aaru.Filesystems/XFS/Info.cs
index c9a28aaf5..02bec98b7 100644
--- a/Aaru.Filesystems/XFS/Info.cs
+++ b/Aaru.Filesystems/XFS/Info.cs
@@ -67,7 +67,10 @@ public sealed partial class XFS
var sbpiece = new byte[Marshal.SizeOf()];
- foreach(int location in new[] { 0, 0x200, 0x400 })
+ foreach(int location in new[]
+ {
+ 0, 0x200, 0x400
+ })
{
Array.Copy(sector, location, sbpiece, 0, Marshal.SizeOf());
@@ -82,7 +85,10 @@ public sealed partial class XFS
}
else
{
- foreach(int i in new[] { 0, 1, 2 })
+ foreach(int i in new[]
+ {
+ 0, 1, 2
+ })
{
var location = (ulong)i;
@@ -135,13 +141,15 @@ public sealed partial class XFS
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sbSize, out byte[] sector);
- if(errno != ErrorNumber.NoError ||
- sector.Length < Marshal.SizeOf())
+ if(errno != ErrorNumber.NoError || sector.Length < Marshal.SizeOf())
return;
var sbpiece = new byte[Marshal.SizeOf()];
- foreach(int location in new[] { 0, 0x200, 0x400 })
+ foreach(int location in new[]
+ {
+ 0, 0x200, 0x400
+ })
{
Array.Copy(sector, location, sbpiece, 0, Marshal.SizeOf());
@@ -156,7 +164,10 @@ public sealed partial class XFS
}
else
{
- foreach(int i in new[] { 0, 1, 2 })
+ foreach(int i in new[]
+ {
+ 0, 1, 2
+ })
{
var location = (ulong)i;
var sbSize = (uint)(Marshal.SizeOf() / imagePlugin.Info.SectorSize);
@@ -166,8 +177,7 @@ public sealed partial class XFS
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + location, sbSize, out byte[] sector);
- if(errno != ErrorNumber.NoError ||
- sector.Length < Marshal.SizeOf())
+ if(errno != ErrorNumber.NoError || sector.Length < Marshal.SizeOf())
return;
xfsSb = Marshal.ByteArrayToStructureBigEndian(sector);
diff --git a/Aaru.Filesystems/Xia/Info.cs b/Aaru.Filesystems/Xia/Info.cs
index afa5e2321..8ddb9e5c3 100644
--- a/Aaru.Filesystems/Xia/Info.cs
+++ b/Aaru.Filesystems/Xia/Info.cs
@@ -99,13 +99,16 @@ public sealed partial class Xia
sb.AppendFormat(Localization._0_inodes, supblk.s_ninodes).AppendLine();
sb.AppendFormat(Localization._0_data_zones_1_bytes, supblk.s_ndatazones,
- supblk.s_ndatazones * supblk.s_zone_size).AppendLine();
+ supblk.s_ndatazones * supblk.s_zone_size).
+ AppendLine();
sb.AppendFormat(Localization._0_imap_zones_1_bytes, supblk.s_imap_zones,
- supblk.s_imap_zones * supblk.s_zone_size).AppendLine();
+ supblk.s_imap_zones * supblk.s_zone_size).
+ AppendLine();
sb.AppendFormat(Localization._0_zmap_zones_1_bytes, supblk.s_zmap_zones,
- supblk.s_zmap_zones * supblk.s_zone_size).AppendLine();
+ supblk.s_zmap_zones * supblk.s_zone_size).
+ AppendLine();
sb.AppendFormat(Localization.First_data_zone_0, supblk.s_firstdatazone).AppendLine();
@@ -113,7 +116,8 @@ public sealed partial class Xia
AppendLine();
sb.AppendFormat(Localization._0_zones_reserved_for_kernel_images_1_bytes, supblk.s_kernzones,
- supblk.s_kernzones * supblk.s_zone_size).AppendLine();
+ supblk.s_kernzones * supblk.s_zone_size).
+ AppendLine();
sb.AppendFormat(Localization.First_kernel_zone_0, supblk.s_firstkernzone).AppendLine();
diff --git a/Aaru.Filesystems/ZFS/Helpers.cs b/Aaru.Filesystems/ZFS/Helpers.cs
index a46bab103..19b6584a3 100644
--- a/Aaru.Filesystems/ZFS/Helpers.cs
+++ b/Aaru.Filesystems/ZFS/Helpers.cs
@@ -76,8 +76,7 @@ public sealed partial class ZFS
{
decodedNvList = new Dictionary();
- if(nvlist == null ||
- nvlist.Length < 16)
+ if(nvlist == null || nvlist.Length < 16)
return false;
if(!xdr)
@@ -593,7 +592,8 @@ public sealed partial class ZFS
else
{
sb.AppendFormat(Localization._0_equals_1_elements_nvlist_array_unable_to_print, item.name,
- item.elements).AppendLine();
+ item.elements).
+ AppendLine();
}
break;
diff --git a/Aaru.Filesystems/dump/Info.cs b/Aaru.Filesystems/dump/Info.cs
index 186bb4b55..081bd6c89 100644
--- a/Aaru.Filesystems/dump/Info.cs
+++ b/Aaru.Filesystems/dump/Info.cs
@@ -81,9 +81,14 @@ public sealed partial class dump
AaruConsole.DebugWriteLine(MODULE_NAME, "aix magic = 0x{0:X8}", aixHdr.c_magic);
AaruConsole.DebugWriteLine(MODULE_NAME, "new magic = 0x{0:X8}", newHdr.c_magic);
- return oldHdr.c_magic == OFS_MAGIC || aixHdr.c_magic is XIX_MAGIC or XIX_CIGAM || newHdr.c_magic == OFS_MAGIC ||
- newHdr.c_magic == NFS_MAGIC || newHdr.c_magic == OFS_CIGAM || newHdr.c_magic == NFS_CIGAM ||
- newHdr.c_magic == UFS2_MAGIC || newHdr.c_magic == UFS2_CIGAM;
+ return oldHdr.c_magic == OFS_MAGIC ||
+ aixHdr.c_magic is XIX_MAGIC or XIX_CIGAM ||
+ newHdr.c_magic == OFS_MAGIC ||
+ newHdr.c_magic == NFS_MAGIC ||
+ newHdr.c_magic == OFS_CIGAM ||
+ newHdr.c_magic == NFS_CIGAM ||
+ newHdr.c_magic == UFS2_MAGIC ||
+ newHdr.c_magic == UFS2_CIGAM;
}
///
@@ -126,9 +131,7 @@ public sealed partial class dump
newHdr.c_magic == UFS2_MAGIC ||
newHdr.c_magic == UFS2_CIGAM)
{
- if(newHdr.c_magic == OFS_CIGAM ||
- newHdr.c_magic == NFS_CIGAM ||
- newHdr.c_magic == UFS2_CIGAM)
+ if(newHdr.c_magic == OFS_CIGAM || newHdr.c_magic == NFS_CIGAM || newHdr.c_magic == UFS2_CIGAM)
newHdr = Marshal.ByteArrayToStructureBigEndian(sector);
}
else if(aixHdr.c_magic is XIX_MAGIC or XIX_CIGAM)
diff --git a/Aaru.Filesystems/exFAT/Info.cs b/Aaru.Filesystems/exFAT/Info.cs
index dd02327da..f09749d16 100644
--- a/Aaru.Filesystems/exFAT/Info.cs
+++ b/Aaru.Filesystems/exFAT/Info.cs
@@ -102,10 +102,12 @@ public sealed partial class exFAT
sb.AppendFormat(Localization.Partition_offset_0, vbr.offset).AppendLine();
sb.AppendFormat(Localization.Volume_has_0_sectors_of_1_bytes_each_for_a_total_of_2_bytes, vbr.sectors,
- 1 << vbr.sectorShift, vbr.sectors * (ulong)(1 << vbr.sectorShift)).AppendLine();
+ 1 << vbr.sectorShift, vbr.sectors * (ulong)(1 << vbr.sectorShift)).
+ AppendLine();
sb.AppendFormat(Localization.Volume_uses_clusters_of_0_sectors_1_bytes_each, 1 << vbr.clusterShift,
- (1 << vbr.sectorShift) * (1 << vbr.clusterShift)).AppendLine();
+ (1 << vbr.sectorShift) * (1 << vbr.clusterShift)).
+ AppendLine();
sb.AppendFormat(Localization.First_FAT_starts_at_sector_0_and_runs_for_1_sectors, vbr.fatOffset, vbr.fatLength).
AppendLine();
@@ -113,7 +115,8 @@ public sealed partial class exFAT
sb.AppendFormat(Localization.Volume_uses_0_FATs, vbr.fats).AppendLine();
sb.AppendFormat(Localization.Cluster_heap_starts_at_sector_0_contains_1_clusters_and_is_2_used,
- vbr.clusterHeapOffset, vbr.clusterHeapLength, vbr.heapUsage).AppendLine();
+ vbr.clusterHeapOffset, vbr.clusterHeapLength, vbr.heapUsage).
+ AppendLine();
sb.AppendFormat(Localization.Root_directory_starts_at_cluster_0, vbr.rootDirectoryCluster).AppendLine();
diff --git a/Aaru.Filesystems/ext2FS/Info.cs b/Aaru.Filesystems/ext2FS/Info.cs
index 65cb4cfe1..217a8caec 100644
--- a/Aaru.Filesystems/ext2FS/Info.cs
+++ b/Aaru.Filesystems/ext2FS/Info.cs
@@ -187,7 +187,8 @@ public sealed partial class ext2FS
if(supblk.mkfs_t > 0)
{
sb.AppendFormat(Localization.Volume_was_created_on_0_for_1,
- DateHandlers.UnixUnsignedToDateTime(supblk.mkfs_t), extOs).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(supblk.mkfs_t), extOs).
+ AppendLine();
metadata.CreationDate = DateHandlers.UnixUnsignedToDateTime(supblk.mkfs_t);
}
@@ -246,13 +247,13 @@ public sealed partial class ext2FS
supblk.block_size = 1024;
sb.AppendFormat(Localization.Volume_has_0_blocks_of_1_bytes_for_a_total_of_2_bytes, blocks,
- 1024 << (int)supblk.block_size, blocks * (ulong)(1024 << (int)supblk.block_size)).AppendLine();
+ 1024 << (int)supblk.block_size, blocks * (ulong)(1024 << (int)supblk.block_size)).
+ AppendLine();
metadata.Clusters = blocks;
metadata.ClusterSize = (uint)(1024 << (int)supblk.block_size);
- if(supblk.mount_t > 0 ||
- supblk.mount_c > 0)
+ if(supblk.mount_t > 0 || supblk.mount_c > 0)
{
if(supblk.mount_t > 0)
{
@@ -263,26 +264,29 @@ public sealed partial class ext2FS
if(supblk.max_mount_c != -1)
{
sb.AppendFormat(Localization.Volume_has_been_mounted_0_times_of_a_maximum_of_1_mounts_before_checking,
- supblk.mount_c, supblk.max_mount_c).AppendLine();
+ supblk.mount_c, supblk.max_mount_c).
+ AppendLine();
}
else
{
sb.
- AppendFormat(
- Localization.Volume_has_been_mounted_0_times_with_no_maximum_no_of_mounts_before_checking,
- supblk.mount_c).AppendLine();
+ AppendFormat(Localization.Volume_has_been_mounted_0_times_with_no_maximum_no_of_mounts_before_checking,
+ supblk.mount_c).
+ AppendLine();
}
if(!string.IsNullOrEmpty(StringHandlers.CToString(supblk.last_mount_dir, encoding)))
{
sb.AppendFormat(Localization.Last_mounted_at_0,
- StringHandlers.CToString(supblk.last_mount_dir, encoding)).AppendLine();
+ StringHandlers.CToString(supblk.last_mount_dir, encoding)).
+ AppendLine();
}
if(!string.IsNullOrEmpty(StringHandlers.CToString(supblk.mount_options, encoding)))
{
sb.AppendFormat(Localization.Last_used_mount_options_were_0,
- StringHandlers.CToString(supblk.mount_options, encoding)).AppendLine();
+ StringHandlers.CToString(supblk.mount_options, encoding)).
+ AppendLine();
}
}
else
@@ -303,7 +307,8 @@ public sealed partial class ext2FS
if(supblk.check_inv > 0)
{
sb.AppendFormat(Localization.Last_checked_on_0_should_check_every_1_seconds,
- DateHandlers.UnixUnsignedToDateTime(supblk.check_t), supblk.check_inv).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(supblk.check_t), supblk.check_inv).
+ AppendLine();
}
else
{
@@ -400,7 +405,8 @@ public sealed partial class ext2FS
metadata.FreeClusters = free;
sb.AppendFormat(Localization._0_inodes_with_1_free_inodes_2, supblk.inodes, supblk.free_inodes,
- supblk.free_inodes * 100 / supblk.inodes).AppendLine();
+ supblk.free_inodes * 100 / supblk.inodes).
+ AppendLine();
if(supblk.first_inode > 0)
sb.AppendFormat(Localization.First_inode_is_0, supblk.first_inode).AppendLine();
@@ -408,11 +414,11 @@ public sealed partial class ext2FS
if(supblk.frag_size > 0)
sb.AppendFormat(Localization._0_bytes_per_fragment, supblk.frag_size).AppendLine();
- if(supblk.blocks_per_grp > 0 &&
- supblk is { flags_per_grp: > 0, inodes_per_grp: > 0 })
+ if(supblk.blocks_per_grp > 0 && supblk is { flags_per_grp: > 0, inodes_per_grp: > 0 })
{
sb.AppendFormat(Localization._0_blocks_1_flags_and_2_inodes_per_group, supblk.blocks_per_grp,
- supblk.flags_per_grp, supblk.inodes_per_grp).AppendLine();
+ supblk.flags_per_grp, supblk.inodes_per_grp).
+ AppendLine();
}
if(supblk.first_block > 0)
@@ -438,7 +444,8 @@ public sealed partial class ext2FS
if(supblk is { mmp_interval: > 0, mmp_block: > 0 })
{
sb.AppendFormat(Localization._0_seconds_for_multi_mount_protection_wait_on_block_1, supblk.mmp_interval,
- supblk.mmp_block).AppendLine();
+ supblk.mmp_block).
+ AppendLine();
}
if(supblk.flex_bg_grp_size > 0)
@@ -447,7 +454,8 @@ public sealed partial class ext2FS
if(supblk is { hash_seed_1: > 0, hash_seed_2: > 0 } and { hash_seed_3: > 0, hash_seed_4: > 0 })
{
sb.AppendFormat(Localization.Hash_seed_0_1_2_3_version_4, supblk.hash_seed_1, supblk.hash_seed_2,
- supblk.hash_seed_3, supblk.hash_seed_4, supblk.hash_version).AppendLine();
+ supblk.hash_seed_3, supblk.hash_seed_4, supblk.hash_version).
+ AppendLine();
}
if((supblk.ftr_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) == EXT3_FEATURE_COMPAT_HAS_JOURNAL ||
@@ -478,11 +486,10 @@ public sealed partial class ext2FS
if(supblk.snapshot_id > 0)
{
sb.
- AppendFormat(
- Localization.
- Active_snapshot_has_ID_0_on_inode_1_with_2_blocks_reserved_list_starting_on_block_3,
- supblk.snapshot_id, supblk.snapshot_inum, supblk.snapshot_blocks,
- supblk.snapshot_list).AppendLine();
+ AppendFormat(Localization.Active_snapshot_has_ID_0_on_inode_1_with_2_blocks_reserved_list_starting_on_block_3,
+ supblk.snapshot_id, supblk.snapshot_inum, supblk.snapshot_blocks,
+ supblk.snapshot_list).
+ AppendLine();
}
if(supblk.error_count > 0)
@@ -491,16 +498,20 @@ public sealed partial class ext2FS
sb.AppendFormat(Localization.First_error_occurred_on_0_last_on_1,
DateHandlers.UnixUnsignedToDateTime(supblk.first_error_t),
- DateHandlers.UnixUnsignedToDateTime(supblk.last_error_t)).AppendLine();
+ DateHandlers.UnixUnsignedToDateTime(supblk.last_error_t)).
+ AppendLine();
sb.AppendFormat(Localization.First_error_inode_is_0_last_is_1, supblk.first_error_inode,
- supblk.last_error_inode).AppendLine();
+ supblk.last_error_inode).
+ AppendLine();
sb.AppendFormat(Localization.First_error_block_is_0_last_is_1, supblk.first_error_block,
- supblk.last_error_block).AppendLine();
+ supblk.last_error_block).
+ AppendLine();
sb.AppendFormat(Localization.First_error_function_is_0_last_is_1, supblk.first_error_func,
- supblk.last_error_func).AppendLine();
+ supblk.last_error_func).
+ AppendLine();
}
}
diff --git a/Aaru.Filters/AppleDouble.cs b/Aaru.Filters/AppleDouble.cs
index 86a9857d0..240758e1d 100644
--- a/Aaru.Filters/AppleDouble.cs
+++ b/Aaru.Filters/AppleDouble.cs
@@ -133,8 +133,7 @@ public sealed class AppleDouble : IFilter
parentFolder ??= "";
- if(filename is null ||
- filenameNoExt is null)
+ if(filename is null || filenameNoExt is null)
return false;
// Prepend data fork name with "R."
@@ -314,8 +313,7 @@ public sealed class AppleDouble : IFilter
parentFolder ??= "";
- if(filename is null ||
- filenameNoExt is null)
+ if(filename is null || filenameNoExt is null)
return ErrorNumber.InvalidArgument;
// Prepend data fork name with "R."
diff --git a/Aaru.Filters/AppleSingle.cs b/Aaru.Filters/AppleSingle.cs
index e07dac53c..408016731 100644
--- a/Aaru.Filters/AppleSingle.cs
+++ b/Aaru.Filters/AppleSingle.cs
@@ -159,8 +159,7 @@ public sealed class AppleSingle : IFilter
///
public bool Identify(byte[] buffer)
{
- if(buffer == null ||
- buffer.Length < 26)
+ if(buffer == null || buffer.Length < 26)
return false;
var hdrB = new byte[26];
@@ -173,8 +172,7 @@ public sealed class AppleSingle : IFilter
///
public bool Identify(Stream stream)
{
- if(stream == null ||
- stream.Length < 26)
+ if(stream == null || stream.Length < 26)
return false;
var hdrB = new byte[26];
diff --git a/Aaru.Filters/BZip2.cs b/Aaru.Filters/BZip2.cs
index ac6e9076d..4ec84d8a6 100644
--- a/Aaru.Filters/BZip2.cs
+++ b/Aaru.Filters/BZip2.cs
@@ -83,11 +83,7 @@ public class BZip2 : IFilter
///
public bool Identify(byte[] buffer)
{
- if(buffer[0] != 0x42 ||
- buffer[1] != 0x5A ||
- buffer[2] != 0x68 ||
- buffer[3] < 0x31 ||
- buffer[3] > 0x39)
+ if(buffer[0] != 0x42 || buffer[1] != 0x5A || buffer[2] != 0x68 || buffer[3] < 0x31 || buffer[3] > 0x39)
return false;
if(buffer.Length <= 512)
@@ -105,11 +101,7 @@ public class BZip2 : IFilter
stream.EnsureRead(buffer, 0, 4);
stream.Seek(0, SeekOrigin.Begin);
- if(buffer[0] != 0x42 ||
- buffer[1] != 0x5A ||
- buffer[2] != 0x68 ||
- buffer[3] < 0x31 ||
- buffer[3] > 0x39)
+ if(buffer[0] != 0x42 || buffer[1] != 0x5A || buffer[2] != 0x68 || buffer[3] < 0x31 || buffer[3] > 0x39)
return false;
if(stream.Length <= 512)
@@ -136,11 +128,7 @@ public class BZip2 : IFilter
stream.EnsureRead(buffer, 0, 4);
stream.Seek(0, SeekOrigin.Begin);
- if(buffer[0] != 0x42 ||
- buffer[1] != 0x5A ||
- buffer[2] != 0x68 ||
- buffer[3] < 0x31 ||
- buffer[3] > 0x39)
+ if(buffer[0] != 0x42 || buffer[1] != 0x5A || buffer[2] != 0x68 || buffer[3] < 0x31 || buffer[3] > 0x39)
return false;
if(stream.Length <= 512)
diff --git a/Aaru.Filters/LZip.cs b/Aaru.Filters/LZip.cs
index a5c8c6749..508ce5ff0 100644
--- a/Aaru.Filters/LZip.cs
+++ b/Aaru.Filters/LZip.cs
@@ -82,8 +82,11 @@ public sealed class LZip : IFilter
public bool HasResourceFork => false;
///
- public bool Identify(byte[] buffer) => buffer[0] == 0x4C && buffer[1] == 0x5A && buffer[2] == 0x49 &&
- buffer[3] == 0x50 && buffer[4] == 0x01;
+ public bool Identify(byte[] buffer) => buffer[0] == 0x4C &&
+ buffer[1] == 0x5A &&
+ buffer[2] == 0x49 &&
+ buffer[3] == 0x50 &&
+ buffer[4] == 0x01;
///
public bool Identify(Stream stream)
diff --git a/Aaru.Filters/MacBinary.cs b/Aaru.Filters/MacBinary.cs
index 8bc5f1bda..93e76e702 100644
--- a/Aaru.Filters/MacBinary.cs
+++ b/Aaru.Filters/MacBinary.cs
@@ -150,24 +150,26 @@ public sealed class MacBinary : IFilter
///
public bool Identify(byte[] buffer)
{
- if(buffer == null ||
- buffer.Length < 128)
+ if(buffer == null || buffer.Length < 128)
return false;
var hdrB = new byte[128];
Array.Copy(buffer, 0, hdrB, 0, 128);
_header = Marshal.ByteArrayToStructureBigEndian(hdrB);
- return _header.magic == MAGIC || _header.version == 0 && _header.filename[0] > 0 && _header.filename[0] < 64 &&
- _header.zero1 == 0 && _header is { zero2: 0, reserved: 0 } &&
+ return _header.magic == MAGIC ||
+ _header.version == 0 &&
+ _header.filename[0] > 0 &&
+ _header.filename[0] < 64 &&
+ _header.zero1 == 0 &&
+ _header is { zero2: 0, reserved: 0 } &&
(_header.dataLength > 0 || _header.resourceLength > 0);
}
///
public bool Identify(Stream stream)
{
- if(stream == null ||
- stream.Length < 128)
+ if(stream == null || stream.Length < 128)
return false;
var hdrB = new byte[128];
@@ -175,8 +177,12 @@ public sealed class MacBinary : IFilter
stream.EnsureRead(hdrB, 0, 128);
_header = Marshal.ByteArrayToStructureBigEndian(hdrB);
- return _header.magic == MAGIC || _header.version == 0 && _header.filename[0] > 0 && _header.filename[0] < 64 &&
- _header.zero1 == 0 && _header is { zero2: 0, reserved: 0 } &&
+ return _header.magic == MAGIC ||
+ _header.version == 0 &&
+ _header.filename[0] > 0 &&
+ _header.filename[0] < 64 &&
+ _header.zero1 == 0 &&
+ _header is { zero2: 0, reserved: 0 } &&
(_header.dataLength > 0 || _header.resourceLength > 0);
}
@@ -197,8 +203,12 @@ public sealed class MacBinary : IFilter
fstream.Close();
- return _header.magic == MAGIC || _header.version == 0 && _header.filename[0] > 0 && _header.filename[0] < 64 &&
- _header.zero1 == 0 && _header is { zero2: 0, reserved: 0 } &&
+ return _header.magic == MAGIC ||
+ _header.version == 0 &&
+ _header.filename[0] > 0 &&
+ _header.filename[0] < 64 &&
+ _header.zero1 == 0 &&
+ _header is { zero2: 0, reserved: 0 } &&
(_header.dataLength > 0 || _header.resourceLength > 0);
}
diff --git a/Aaru.Filters/OffsetStream.cs b/Aaru.Filters/OffsetStream.cs
index 8854ff365..03ca9790d 100644
--- a/Aaru.Filters/OffsetStream.cs
+++ b/Aaru.Filters/OffsetStream.cs
@@ -205,8 +205,7 @@ public sealed class OffsetStream : Stream
/// Start position
/// Last readable position
/// Invalid range
- public OffsetStream(SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync, long start,
- long end)
+ public OffsetStream(SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync, long start, long end)
{
if(start < 0)
throw new ArgumentOutOfRangeException(nameof(start), Localization.Start_cant_be_a_negative_number);
@@ -248,8 +247,8 @@ public sealed class OffsetStream : Stream
/// Start position
/// Last readable position
/// Invalid range
- public OffsetStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize,
- bool useAsync, long start, long end)
+ public OffsetStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool useAsync,
+ long start, long end)
{
if(start < 0)
throw new ArgumentOutOfRangeException(nameof(start), Localization.Start_cant_be_a_negative_number);
@@ -422,8 +421,7 @@ public sealed class OffsetStream : Stream
/// Start position
/// Last readable position
/// Invalid range
- public OffsetStream(byte[] buffer, int index, int count, bool writable, bool publiclyVisible, long start,
- long end)
+ public OffsetStream(byte[] buffer, int index, int count, bool writable, bool publiclyVisible, long start, long end)
{
if(start < 0)
throw new ArgumentOutOfRangeException(nameof(start), Localization.Start_cant_be_a_negative_number);
@@ -593,8 +591,7 @@ public sealed class OffsetStream : Stream
}
///
- public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback,
- object state)
+ public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
if(_baseStream.Position + count > _streamEnd)
throw new IOException(Localization.Cannot_read_past_stream_end);
@@ -603,8 +600,7 @@ public sealed class OffsetStream : Stream
}
///
- public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback,
- object state)
+ public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
if(_baseStream.Position + count > _streamEnd)
throw new IOException(Localization.Cannot_write_past_stream_end);
diff --git a/Aaru.Filters/PCExchange.cs b/Aaru.Filters/PCExchange.cs
index b81dcc5bd..c6c4978c0 100644
--- a/Aaru.Filters/PCExchange.cs
+++ b/Aaru.Filters/PCExchange.cs
@@ -147,14 +147,13 @@ public sealed class PcExchange : IFilter
Array.Copy(datEntry.dosName, 0, tmpDosNameB, 0, 8);
Array.Copy(datEntry.dosName, 8, tmpDosExtB, 0, 3);
- string dosName = Encoding.ASCII.GetString(tmpDosNameB).Trim() + "." +
+ string dosName = Encoding.ASCII.GetString(tmpDosNameB).Trim() +
+ "." +
Encoding.ASCII.GetString(tmpDosExtB).Trim();
string dosNameLow = dosName.ToLower(CultureInfo.CurrentCulture);
- if(baseFilename != macName &&
- baseFilename != dosName &&
- baseFilename != dosNameLow)
+ if(baseFilename != macName && baseFilename != dosName && baseFilename != dosNameLow)
continue;
dataFound |=
@@ -204,14 +203,13 @@ public sealed class PcExchange : IFilter
Array.Copy(datEntry.dosName, 0, tmpDosNameB, 0, 8);
Array.Copy(datEntry.dosName, 8, tmpDosExtB, 0, 3);
- string dosName = Encoding.ASCII.GetString(tmpDosNameB).Trim() + "." +
+ string dosName = Encoding.ASCII.GetString(tmpDosNameB).Trim() +
+ "." +
Encoding.ASCII.GetString(tmpDosExtB).Trim();
string dosNameLow = dosName.ToLower(CultureInfo.CurrentCulture);
- if(baseFilename != macName &&
- baseFilename != dosName &&
- baseFilename != dosNameLow)
+ if(baseFilename != macName && baseFilename != dosName && baseFilename != dosNameLow)
continue;
if(File.Exists(System.IO.Path.Combine(parentFolder, macName ?? throw new InvalidOperationException())))
diff --git a/Aaru.Filters/XZ.cs b/Aaru.Filters/XZ.cs
index a3954acab..04c92781a 100644
--- a/Aaru.Filters/XZ.cs
+++ b/Aaru.Filters/XZ.cs
@@ -81,9 +81,14 @@ public sealed class XZ : IFilter
public bool HasResourceFork => false;
///
- public bool Identify(byte[] buffer) => buffer[0] == 0xFD && buffer[1] == 0x37 && buffer[2] == 0x7A &&
- buffer[3] == 0x58 && buffer[4] == 0x5A && buffer[5] == 0x00 &&
- buffer[^2] == 0x59 && buffer[^1] == 0x5A;
+ public bool Identify(byte[] buffer) => buffer[0] == 0xFD &&
+ buffer[1] == 0x37 &&
+ buffer[2] == 0x7A &&
+ buffer[3] == 0x58 &&
+ buffer[4] == 0x5A &&
+ buffer[5] == 0x00 &&
+ buffer[^2] == 0x59 &&
+ buffer[^1] == 0x5A;
///
public bool Identify(Stream stream)
@@ -100,8 +105,14 @@ public sealed class XZ : IFilter
stream.EnsureRead(footer, 0, 2);
stream.Seek(0, SeekOrigin.Begin);
- return buffer[0] == 0xFD && buffer[1] == 0x37 && buffer[2] == 0x7A && buffer[3] == 0x58 && buffer[4] == 0x5A &&
- buffer[5] == 0x00 && footer[0] == 0x59 && footer[1] == 0x5A;
+ return buffer[0] == 0xFD &&
+ buffer[1] == 0x37 &&
+ buffer[2] == 0x7A &&
+ buffer[3] == 0x58 &&
+ buffer[4] == 0x5A &&
+ buffer[5] == 0x00 &&
+ footer[0] == 0x59 &&
+ footer[1] == 0x5A;
}
///
@@ -123,8 +134,14 @@ public sealed class XZ : IFilter
stream.EnsureRead(footer, 0, 2);
stream.Seek(0, SeekOrigin.Begin);
- return buffer[0] == 0xFD && buffer[1] == 0x37 && buffer[2] == 0x7A && buffer[3] == 0x58 && buffer[4] == 0x5A &&
- buffer[5] == 0x00 && footer[0] == 0x59 && footer[1] == 0x5A;
+ return buffer[0] == 0xFD &&
+ buffer[1] == 0x37 &&
+ buffer[2] == 0x7A &&
+ buffer[3] == 0x58 &&
+ buffer[4] == 0x5A &&
+ buffer[5] == 0x00 &&
+ footer[0] == 0x59 &&
+ footer[1] == 0x5A;
}
///
@@ -248,8 +265,7 @@ public sealed class XZ : IFilter
while((buf[i++] & 0x80) == 0x80)
{
- if(i >= sizeMax ||
- buf[i] == 0x00)
+ if(i >= sizeMax || buf[i] == 0x00)
return 0;
num |= (ulong)(buf[i] & 0x7F) << i * 7;
diff --git a/Aaru.Generators/PluginRegisterGenerator.cs b/Aaru.Generators/PluginRegisterGenerator.cs
index f2ebabba4..9defc1151 100644
--- a/Aaru.Generators/PluginRegisterGenerator.cs
+++ b/Aaru.Generators/PluginRegisterGenerator.cs
@@ -301,39 +301,51 @@ public class PluginRegisterGenerator : ISourceGenerator
return;
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
- ValueText == "IPluginRegister") == true)
+ ValueText ==
+ "IPluginRegister") ==
+ true)
Register = plugin;
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
- ValueText == "IArchive") == true)
+ ValueText ==
+ "IArchive") ==
+ true)
{
if(!Archives.Contains(plugin.Identifier.Text))
Archives.Add(plugin.Identifier.Text);
}
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
- ValueText == "IChecksum") == true)
+ ValueText ==
+ "IChecksum") ==
+ true)
{
if(!Checksums.Contains(plugin.Identifier.Text))
Checksums.Add(plugin.Identifier.Text);
}
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
- ValueText == "IFilesystem") == true)
+ ValueText ==
+ "IFilesystem") ==
+ true)
{
if(!FileSystems.Contains(plugin.Identifier.Text))
FileSystems.Add(plugin.Identifier.Text);
}
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
- ValueText == "IFilter") == true)
+ ValueText ==
+ "IFilter") ==
+ true)
{
if(!Filters.Contains(plugin.Identifier.Text))
Filters.Add(plugin.Identifier.Text);
}
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
- ValueText == "IFloppyImage") == true)
+ ValueText ==
+ "IFloppyImage") ==
+ true)
{
if(!FloppyImagePlugins.Contains(plugin.Identifier.Text))
FloppyImagePlugins.Add(plugin.Identifier.Text);
@@ -341,28 +353,35 @@ public class PluginRegisterGenerator : ISourceGenerator
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
ValueText is "IMediaImage" or "IOpticalMediaImage" or "IFloppyImage"
- or "ITapeImage") == true)
+ or "ITapeImage") ==
+ true)
{
if(!MediaImagePlugins.Contains(plugin.Identifier.Text))
MediaImagePlugins.Add(plugin.Identifier.Text);
}
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
- ValueText == "IPartition") == true)
+ ValueText ==
+ "IPartition") ==
+ true)
{
if(!PartitionPlugins.Contains(plugin.Identifier.Text))
PartitionPlugins.Add(plugin.Identifier.Text);
}
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
- ValueText == "IReadOnlyFilesystem") == true)
+ ValueText ==
+ "IReadOnlyFilesystem") ==
+ true)
{
if(!ReadOnlyFileSystems.Contains(plugin.Identifier.Text))
ReadOnlyFileSystems.Add(plugin.Identifier.Text);
}
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
- ValueText == "IWritableFloppyImage") == true)
+ ValueText ==
+ "IWritableFloppyImage") ==
+ true)
{
if(!WritableFloppyImagePlugins.Contains(plugin.Identifier.Text))
WritableFloppyImagePlugins.Add(plugin.Identifier.Text);
@@ -370,14 +389,17 @@ public class PluginRegisterGenerator : ISourceGenerator
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
ValueText is "IWritableImage" or "IWritableOpticalImage"
- or "IWritableTapeImage" or "IByteAddressableImage") == true)
+ or "IWritableTapeImage" or "IByteAddressableImage") ==
+ true)
{
if(!WritableImagePlugins.Contains(plugin.Identifier.Text))
WritableImagePlugins.Add(plugin.Identifier.Text);
}
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
- ValueText == "IByteAddressableImage") == true)
+ ValueText ==
+ "IByteAddressableImage") ==
+ true)
{
if(!ByteAddressableImagePlugins.Contains(plugin.Identifier.Text))
ByteAddressableImagePlugins.Add(plugin.Identifier.Text);
diff --git a/Aaru.Gui/ConsoleHandler.cs b/Aaru.Gui/ConsoleHandler.cs
index f71516dd9..d014e6be5 100644
--- a/Aaru.Gui/ConsoleHandler.cs
+++ b/Aaru.Gui/ConsoleHandler.cs
@@ -88,8 +88,7 @@ static class ConsoleHandler
static void OnWriteHandler([CanBeNull] string format, [CanBeNull] params object[] arg)
{
- if(format == null ||
- arg == null)
+ if(format == null || arg == null)
return;
Entries.Add(new LogEntry
@@ -103,8 +102,7 @@ static class ConsoleHandler
static void OnErrorWriteHandler([CanBeNull] string format, [CanBeNull] params object[] arg)
{
- if(format == null ||
- arg == null)
+ if(format == null || arg == null)
return;
Entries.Add(new LogEntry
@@ -118,8 +116,7 @@ static class ConsoleHandler
static void OnVerboseWriteHandler([CanBeNull] string format, [CanBeNull] params object[] arg)
{
- if(format == null ||
- arg == null)
+ if(format == null || arg == null)
return;
Entries.Add(new LogEntry
@@ -133,8 +130,7 @@ static class ConsoleHandler
static void OnDebugWriteHandler(string module, [CanBeNull] string format, [CanBeNull] params object[] arg)
{
- if(format == null ||
- arg == null)
+ if(format == null || arg == null)
return;
Entries.Add(new LogEntry
diff --git a/Aaru.Gui/Main.cs b/Aaru.Gui/Main.cs
index 6f9ede373..a34d0a821 100644
--- a/Aaru.Gui/Main.cs
+++ b/Aaru.Gui/Main.cs
@@ -43,6 +43,6 @@ public static class Main
}
// Avalonia configuration, don't remove; also used by visual designer.
- public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure().UsePlatformDetect().
- UseReactiveUI().UseManagedSystemDialogs();
+ public static AppBuilder BuildAvaloniaApp() =>
+ AppBuilder.Configure().UsePlatformDetect().UseReactiveUI().UseManagedSystemDialogs();
}
\ No newline at end of file
diff --git a/Aaru.Gui/ViewModels/Dialogs/AboutViewModel.cs b/Aaru.Gui/ViewModels/Dialogs/AboutViewModel.cs
index 8b6ec3a80..df653b468 100644
--- a/Aaru.Gui/ViewModels/Dialogs/AboutViewModel.cs
+++ b/Aaru.Gui/ViewModels/Dialogs/AboutViewModel.cs
@@ -75,8 +75,7 @@ public sealed class AboutViewModel : ViewModelBase
(Attribute.GetCustomAttribute(assembly, typeof(AssemblyInformationalVersionAttribute)) as
AssemblyInformationalVersionAttribute)?.InformationalVersion;
- if(name is null ||
- version is null)
+ if(name is null || version is null)
continue;
Assemblies.Add(new AssemblyModel
diff --git a/Aaru.Gui/ViewModels/Dialogs/ConsoleViewModel.cs b/Aaru.Gui/ViewModels/Dialogs/ConsoleViewModel.cs
index 99019ab72..08ec47260 100644
--- a/Aaru.Gui/ViewModels/Dialogs/ConsoleViewModel.cs
+++ b/Aaru.Gui/ViewModels/Dialogs/ConsoleViewModel.cs
@@ -99,8 +99,11 @@ public sealed class ConsoleViewModel : ViewModelBase
dlgSave.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "log" }),
- Name = UI.Dialog_Log_files
+ Extensions = new List(new[]
+ {
+ "log"
+ }),
+ Name = UI.Dialog_Log_files
});
string result = await dlgSave.ShowAsync(_view);
@@ -158,10 +161,8 @@ public sealed class ConsoleViewModel : ViewModelBase
{
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Exception_0_trying_to_save_logfile_details_has_been_sent_to_console,
- exception.Message), ButtonEnum.Ok, Icon.Error).
+ Format(UI.Exception_0_trying_to_save_logfile_details_has_been_sent_to_console,
+ exception.Message), ButtonEnum.Ok, Icon.Error).
ShowWindowDialogAsync(_view);
AaruConsole.ErrorWriteLine("Console", exception.Message);
diff --git a/Aaru.Gui/ViewModels/Dialogs/EncodingsViewModel.cs b/Aaru.Gui/ViewModels/Dialogs/EncodingsViewModel.cs
index 98f8b9312..886e3a3f5 100644
--- a/Aaru.Gui/ViewModels/Dialogs/EncodingsViewModel.cs
+++ b/Aaru.Gui/ViewModels/Dialogs/EncodingsViewModel.cs
@@ -55,17 +55,20 @@ public sealed class EncodingsViewModel : ViewModelBase
Task.Run(() =>
{
- var encodings = Encoding.GetEncodings().Select(info => new EncodingModel
- {
- Name = info.Name,
- DisplayName = info.GetEncoding().EncodingName
- }).ToList();
+ var encodings = Encoding.GetEncodings().
+ Select(info => new EncodingModel
+ {
+ Name = info.Name,
+ DisplayName = info.GetEncoding().EncodingName
+ }).
+ ToList();
- encodings.AddRange(Claunia.Encoding.Encoding.GetEncodings().Select(info => new EncodingModel
- {
- Name = info.Name,
- DisplayName = info.DisplayName
- }));
+ encodings.AddRange(Claunia.Encoding.Encoding.GetEncodings().
+ Select(info => new EncodingModel
+ {
+ Name = info.Name,
+ DisplayName = info.DisplayName
+ }));
foreach(EncodingModel encoding in encodings.OrderBy(t => t.DisplayName))
Encodings.Add(encoding);
diff --git a/Aaru.Gui/ViewModels/Dialogs/StatisticsViewModel.cs b/Aaru.Gui/ViewModels/Dialogs/StatisticsViewModel.cs
index 915a8f2a6..2e16ca45c 100644
--- a/Aaru.Gui/ViewModels/Dialogs/StatisticsViewModel.cs
+++ b/Aaru.Gui/ViewModels/Dialogs/StatisticsViewModel.cs
@@ -132,7 +132,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "fs-info"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "fs-info" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "fs-info" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "fs-info" && !c.Synchronized);
@@ -143,7 +144,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "checksum"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "checksum" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "checksum" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "checksum" && !c.Synchronized);
@@ -154,7 +156,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "compare"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "compare" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "compare" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "compare" && !c.Synchronized);
@@ -165,7 +168,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "convert-image"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "convert-image" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "convert-image" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "convert-image" && !c.Synchronized);
@@ -177,7 +181,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "create-sidecar"))
{
ulong count = ctx.Commands.Where(c => c.Name == "create-sidecar" && c.Synchronized).
- Select(c => c.Count).FirstOrDefault();
+ Select(c => c.Count).
+ FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "create-sidecar" && !c.Synchronized);
@@ -187,7 +192,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "decode"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "decode" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "decode" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "decode" && !c.Synchronized);
@@ -198,7 +204,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "device-info"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "device-info" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "device-info" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "device-info" && !c.Synchronized);
@@ -209,7 +216,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "device-report"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "device-report" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "device-report" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "device-report" && !c.Synchronized);
@@ -220,7 +228,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "dump-media"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "dump-media" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "dump-media" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "dump-media" && !c.Synchronized);
@@ -231,7 +240,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "entropy"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "entropy" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "entropy" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "entropy" && !c.Synchronized);
@@ -242,7 +252,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "formats"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "formats" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "formats" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "formats" && !c.Synchronized);
@@ -253,7 +264,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "image-info"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "image-info" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "image-info" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "image-info" && !c.Synchronized);
@@ -264,7 +276,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "media-info"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "media-info" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "media-info" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "media-info" && !c.Synchronized);
@@ -275,7 +288,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "media-scan"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "media-scan" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "media-scan" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "media-scan" && !c.Synchronized);
@@ -286,7 +300,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "printhex"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "printhex" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "printhex" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "printhex" && !c.Synchronized);
@@ -297,7 +312,8 @@ public sealed class StatisticsViewModel : ViewModelBase
if(ctx.Commands.Any(c => c.Name == "verify"))
{
- ulong count = ctx.Commands.Where(c => c.Name == "verify" && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Commands.Where(c => c.Name == "verify" && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Commands.LongCount(c => c.Name == "verify" && !c.Synchronized);
@@ -306,10 +322,22 @@ public sealed class StatisticsViewModel : ViewModelBase
VerifyText = string.Format(UI.You_have_called_the_Verify_command_0_times, count);
}
- CommandsVisible = FsInfoVisible || ChecksumVisible || CompareVisible || ConvertImageVisible ||
- CreateSidecarVisible || DecodeVisible || DeviceInfoVisible || DeviceReportVisible ||
- DumpMediaVisible || EntropyVisible || FormatsCommandVisible || ImageInfoVisible ||
- MediaInfoVisible || MediaScanVisible || PrintHexVisible || VerifyVisible;
+ CommandsVisible = FsInfoVisible ||
+ ChecksumVisible ||
+ CompareVisible ||
+ ConvertImageVisible ||
+ CreateSidecarVisible ||
+ DecodeVisible ||
+ DeviceInfoVisible ||
+ DeviceReportVisible ||
+ DumpMediaVisible ||
+ EntropyVisible ||
+ FormatsCommandVisible ||
+ ImageInfoVisible ||
+ MediaInfoVisible ||
+ MediaScanVisible ||
+ PrintHexVisible ||
+ VerifyVisible;
}
if(ctx.Filters.Any())
@@ -318,7 +346,8 @@ public sealed class StatisticsViewModel : ViewModelBase
foreach(string nvs in ctx.Filters.Select(n => n.Name).Distinct())
{
- ulong count = ctx.Filters.Where(c => c.Name == nvs && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Filters.Where(c => c.Name == nvs && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Filters.LongCount(c => c.Name == nvs && !c.Synchronized);
@@ -337,7 +366,8 @@ public sealed class StatisticsViewModel : ViewModelBase
foreach(string nvs in ctx.MediaFormats.Select(n => n.Name).Distinct())
{
- ulong count = ctx.MediaFormats.Where(c => c.Name == nvs && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.MediaFormats.Where(c => c.Name == nvs && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.MediaFormats.LongCount(c => c.Name == nvs && !c.Synchronized);
@@ -356,7 +386,8 @@ public sealed class StatisticsViewModel : ViewModelBase
foreach(string nvs in ctx.Partitions.Select(n => n.Name).Distinct())
{
- ulong count = ctx.Partitions.Where(c => c.Name == nvs && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Partitions.Where(c => c.Name == nvs && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Partitions.LongCount(c => c.Name == nvs && !c.Synchronized);
@@ -375,7 +406,8 @@ public sealed class StatisticsViewModel : ViewModelBase
foreach(string nvs in ctx.Filesystems.Select(n => n.Name).Distinct())
{
- ulong count = ctx.Filesystems.Where(c => c.Name == nvs && c.Synchronized).Select(c => c.Count).
+ ulong count = ctx.Filesystems.Where(c => c.Name == nvs && c.Synchronized).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Filesystems.LongCount(c => c.Name == nvs && !c.Synchronized);
@@ -392,8 +424,10 @@ public sealed class StatisticsViewModel : ViewModelBase
{
DevicesVisible = true;
- foreach(DeviceStat ds in ctx.SeenDevices.OrderBy(n => n.Manufacturer).ThenBy(n => n.Manufacturer).
- ThenBy(n => n.Revision).ThenBy(n => n.Bus))
+ foreach(DeviceStat ds in ctx.SeenDevices.OrderBy(n => n.Manufacturer).
+ ThenBy(n => n.Manufacturer).
+ ThenBy(n => n.Revision).
+ ThenBy(n => n.Bus))
{
Devices.Add(new DeviceStatsModel
{
@@ -412,7 +446,8 @@ public sealed class StatisticsViewModel : ViewModelBase
foreach(string media in ctx.Medias.OrderBy(ms => ms.Type).Select(ms => ms.Type).Distinct())
{
- ulong count = ctx.Medias.Where(c => c.Type == media && c.Synchronized && c.Real).Select(c => c.Count).
+ ulong count = ctx.Medias.Where(c => c.Type == media && c.Synchronized && c.Real).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Medias.LongCount(c => c.Type == media && !c.Synchronized && c.Real);
@@ -427,7 +462,8 @@ public sealed class StatisticsViewModel : ViewModelBase
});
}
- count = ctx.Medias.Where(c => c.Type == media && c.Synchronized && !c.Real).Select(c => c.Count).
+ count = ctx.Medias.Where(c => c.Type == media && c.Synchronized && !c.Real).
+ Select(c => c.Count).
FirstOrDefault();
count += (ulong)ctx.Medias.LongCount(c => c.Type == media && !c.Synchronized && !c.Real);
diff --git a/Aaru.Gui/ViewModels/Panels/DeviceInfoViewModel.cs b/Aaru.Gui/ViewModels/Panels/DeviceInfoViewModel.cs
index 26f16d2ff..ed5b4ef4a 100644
--- a/Aaru.Gui/ViewModels/Panels/DeviceInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Panels/DeviceInfoViewModel.cs
@@ -186,8 +186,7 @@ public sealed class DeviceInfoViewModel : ViewModelBase
};
}
- if(devInfo.AtaIdentify != null ||
- devInfo.AtapiIdentify != null)
+ if(devInfo.AtaIdentify != null || devInfo.AtapiIdentify != null)
{
AtaInfo = new AtaInfo
{
@@ -365,8 +364,7 @@ public sealed class DeviceInfoViewModel : ViewModelBase
MaxBlockSize = blockLimits.Value.maxBlockLen > 0
? string.Format(Localization.Core.Device_maximum_block_size_is_0_bytes,
blockLimits.Value.maxBlockLen)
- : Localization.Core.
- Device_does_not_specify_a_maximum_block_size;
+ : Localization.Core.Device_does_not_specify_a_maximum_block_size;
MinBlockSize = string.Format(Localization.Core.Device_minimum_block_size_is_0_bytes,
blockLimits.Value.minBlockLen);
@@ -1016,8 +1014,11 @@ public sealed class DeviceInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
diff --git a/Aaru.Gui/ViewModels/Panels/FileSystemViewModel.cs b/Aaru.Gui/ViewModels/Panels/FileSystemViewModel.cs
index e38de93e1..f1b79a03e 100644
--- a/Aaru.Gui/ViewModels/Panels/FileSystemViewModel.cs
+++ b/Aaru.Gui/ViewModels/Panels/FileSystemViewModel.cs
@@ -76,9 +76,9 @@ public sealed class FileSystemViewModel([NotNull] FileSystem metadata, string in
public string BackupDateText { get; } =
string.Format(Localization.Core.Volume_last_backed_up_on_0, metadata.BackupDate);
- public string ClustersText { get; } = string.Format(
- Localization.Core.Volume_has_0_clusters_of_1_bytes_each_total_of_2_bytes,
- metadata.Clusters, metadata.ClusterSize, metadata.Clusters * metadata.ClusterSize);
+ public string ClustersText { get; } =
+ string.Format(Localization.Core.Volume_has_0_clusters_of_1_bytes_each_total_of_2_bytes, metadata.Clusters,
+ metadata.ClusterSize, metadata.Clusters * metadata.ClusterSize);
public string FreeClustersText { get; } = string.Format(Localization.Core.Volume_has_0_clusters_free_1,
metadata.FreeClusters,
diff --git a/Aaru.Gui/ViewModels/Panels/ImageInfoViewModel.cs b/Aaru.Gui/ViewModels/Panels/ImageInfoViewModel.cs
index 902faf24b..bfab4109d 100644
--- a/Aaru.Gui/ViewModels/Panels/ImageInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Panels/ImageInfoViewModel.cs
@@ -106,10 +106,13 @@ public sealed class ImageInfoViewModel : ViewModelBase
MediaLogo = AssetLoader.Exists(mediaResource)
? new Bitmap(AssetLoader.Open(mediaResource))
- : imageFormat.Info.MetadataMediaType == MetadataMediaType.BlockMedia
+ :
+ imageFormat.Info.MetadataMediaType == MetadataMediaType.BlockMedia
? genericHddIcon
- : imageFormat.Info.MetadataMediaType == MetadataMediaType.OpticalDisc
- ? genericOpticalIcon
+ :
+ imageFormat.Info.MetadataMediaType == MetadataMediaType.OpticalDisc
+ ?
+ genericOpticalIcon
: genericFolderIcon;
ImagePathText = string.Format(UI.Path_0, imagePath);
@@ -154,8 +157,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
string.Format(Localization.Core.Last_modified_on_0, imageFormat.Info.LastModificationTime);
}
- if(imageFormat.Info.MediaSequence != 0 &&
- imageFormat.Info.LastMediaSequence != 0)
+ if(imageFormat.Info.MediaSequence != 0 && imageFormat.Info.LastMediaSequence != 0)
{
MediaSequenceText = string.Format(Localization.Core.Media_is_number_0_on_a_set_of_1_medias,
imageFormat.Info.MediaSequence, imageFormat.Info.LastMediaSequence);
@@ -297,8 +299,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
{
errno = imageFormat.ReadMediaTag(MediaTagType.CD_TOC, out toc);
- if(errno == ErrorNumber.NoError &&
- toc.Length > 0)
+ if(errno == ErrorNumber.NoError && toc.Length > 0)
{
ushort dataLen = Swapping.Swap(BitConverter.ToUInt16(toc, 0));
@@ -319,8 +320,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
{
errno = imageFormat.ReadMediaTag(MediaTagType.CD_FullTOC, out fullToc);
- if(errno == ErrorNumber.NoError &&
- fullToc.Length > 0)
+ if(errno == ErrorNumber.NoError && fullToc.Length > 0)
{
ushort dataLen = Swapping.Swap(BitConverter.ToUInt16(fullToc, 0));
@@ -341,8 +341,7 @@ public sealed class ImageInfoViewModel : ViewModelBase
{
errno = imageFormat.ReadMediaTag(MediaTagType.CD_PMA, out pma);
- if(errno == ErrorNumber.NoError &&
- pma.Length > 0)
+ if(errno == ErrorNumber.NoError && pma.Length > 0)
{
ushort dataLen = Swapping.Swap(BitConverter.ToUInt16(pma, 0));
@@ -748,13 +747,18 @@ public sealed class ImageInfoViewModel : ViewModelBase
public ReactiveCommand ViewSectorsCommand { get; }
public ReactiveCommand DecodeMediaTagCommand { get; }
- public bool DriveInformationVisible => DriveManufacturerText != null || DriveModelText != null ||
- DriveSerialNumberText != null || DriveFirmwareRevisionText != null ||
- MediaGeometryText != null;
+ public bool DriveInformationVisible => DriveManufacturerText != null ||
+ DriveModelText != null ||
+ DriveSerialNumberText != null ||
+ DriveFirmwareRevisionText != null ||
+ MediaGeometryText != null;
- public bool MediaInformationVisible => MediaSequenceText != null || MediaTitleText != null ||
- MediaManufacturerText != null || MediaModelText != null ||
- MediaSerialNumberText != null || MediaBarcodeText != null ||
+ public bool MediaInformationVisible => MediaSequenceText != null ||
+ MediaTitleText != null ||
+ MediaManufacturerText != null ||
+ MediaModelText != null ||
+ MediaSerialNumberText != null ||
+ MediaBarcodeText != null ||
MediaPartNumberText != null;
public string ImageInformationLabel => UI.Title_Image_information;
diff --git a/Aaru.Gui/ViewModels/Panels/MediaInfoViewModel.cs b/Aaru.Gui/ViewModels/Panels/MediaInfoViewModel.cs
index e299c74ff..941fd746e 100644
--- a/Aaru.Gui/ViewModels/Panels/MediaInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Panels/MediaInfoViewModel.cs
@@ -102,8 +102,7 @@ public sealed class MediaInfoViewModel : ViewModelBase
MediaType = scsiInfo.MediaType.ToString();
- if(scsiInfo.Blocks != 0 &&
- scsiInfo.BlockSize != 0)
+ if(scsiInfo.Blocks != 0 && scsiInfo.BlockSize != 0)
{
MediaSize = string.Format(Localization.Core.Media_has_0_blocks_of_1_bytes_each_for_a_total_of_2,
scsiInfo.Blocks, scsiInfo.BlockSize,
@@ -128,7 +127,8 @@ public sealed class MediaInfoViewModel : ViewModelBase
SaveRecognizedFormatLayersVisible = scsiInfo.RecognizedFormatLayers != null;
SaveWriteProtectionStatusVisible = scsiInfo.WriteProtectionStatus != null;
- MmcVisible = SaveGetConfigurationVisible || SaveRecognizedFormatLayersVisible ||
+ MmcVisible = SaveGetConfigurationVisible ||
+ SaveRecognizedFormatLayersVisible ||
SaveWriteProtectionStatusVisible;
if(scsiInfo.DensitySupportHeader.HasValue)
@@ -362,8 +362,11 @@ public sealed class MediaInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -400,8 +403,9 @@ public sealed class MediaInfoViewModel : ViewModelBase
case CommonTypes.MediaType.GDR or CommonTypes.MediaType.GDROM:
await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
- Localization.Core.GD_ROM_dump_support_is_not_yet_implemented,
- ButtonEnum.Ok, Icon.Error).ShowWindowDialogAsync(_view);
+ Localization.Core.GD_ROM_dump_support_is_not_yet_implemented, ButtonEnum.Ok,
+ Icon.Error).
+ ShowWindowDialogAsync(_view);
return;
case CommonTypes.MediaType.XGD or CommonTypes.MediaType.XGD2 or CommonTypes.MediaType.XGD3
@@ -410,7 +414,8 @@ public sealed class MediaInfoViewModel : ViewModelBase
GetMessageBoxStandard(UI.Title_Error,
Localization.Core.
Dumping_Xbox_Game_Discs_requires_a_drive_with_Kreon_firmware,
- ButtonEnum.Ok, Icon.Error).ShowWindowDialogAsync(_view);
+ ButtonEnum.Ok, Icon.Error).
+ ShowWindowDialogAsync(_view);
return;
}
@@ -432,8 +437,9 @@ public sealed class MediaInfoViewModel : ViewModelBase
case CommonTypes.MediaType.GDROM:
await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
- Localization.Core.GD_ROM_scan_support_is_not_yet_implemented,
- ButtonEnum.Ok, Icon.Error).ShowWindowDialogAsync(_view);
+ Localization.Core.GD_ROM_scan_support_is_not_yet_implemented, ButtonEnum.Ok,
+ Icon.Error).
+ ShowWindowDialogAsync(_view);
return;
@@ -444,7 +450,8 @@ public sealed class MediaInfoViewModel : ViewModelBase
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
Localization.Core.
Scanning_Xbox_discs_is_not_yet_supported,
- ButtonEnum.Ok, Icon.Error).ShowWindowDialogAsync(_view);
+ ButtonEnum.Ok, Icon.Error).
+ ShowWindowDialogAsync(_view);
return;
}
diff --git a/Aaru.Gui/ViewModels/Panels/PartitionViewModel.cs b/Aaru.Gui/ViewModels/Panels/PartitionViewModel.cs
index fb922030a..b413c8a19 100644
--- a/Aaru.Gui/ViewModels/Panels/PartitionViewModel.cs
+++ b/Aaru.Gui/ViewModels/Panels/PartitionViewModel.cs
@@ -43,8 +43,7 @@ public sealed class PartitionViewModel(Partition partition)
string.Format(Localization.Core.Partition_start_sector_0_byte_1, partition.Start, partition.Offset);
public string LengthText { get; } = string.Format(Localization.Core.Partition_length_0_sectors_1_bytes,
- partition.Length,
- partition.Size);
+ partition.Length, partition.Size);
public string DescriptionLabelText { get; } = Localization.Core.Title_Partition_description;
public string DescriptionText { get; } = partition.Description;
diff --git a/Aaru.Gui/ViewModels/Panels/SubdirectoryViewModel.cs b/Aaru.Gui/ViewModels/Panels/SubdirectoryViewModel.cs
index 4453f0861..7db67dedb 100644
--- a/Aaru.Gui/ViewModels/Panels/SubdirectoryViewModel.cs
+++ b/Aaru.Gui/ViewModels/Panels/SubdirectoryViewModel.cs
@@ -79,8 +79,7 @@ public sealed class SubdirectoryViewModel
return;
}
- while(model.Plugin.ReadDir(node, out string dirent) == ErrorNumber.NoError &&
- dirent is not null)
+ while(model.Plugin.ReadDir(node, out string dirent) == ErrorNumber.NoError && dirent is not null)
{
errno = model.Plugin.Stat(model.Path + "/" + dirent, out FileEntryInfo stat);
@@ -93,8 +92,7 @@ public sealed class SubdirectoryViewModel
continue;
}
- if(stat.Attributes.HasFlag(FileAttributes.Directory) &&
- !model.Listed)
+ if(stat.Attributes.HasFlag(FileAttributes.Directory) && !model.Listed)
{
model.Subdirectories.Add(new SubdirectoryModel
{
@@ -197,8 +195,7 @@ public sealed class SubdirectoryViewModel
{
char[] chars;
- if(filename.Last() == '.' ||
- filename.Last() == ' ')
+ if(filename.Last() == '.' || filename.Last() == ' ')
chars = new char[filename.Length - 1];
else
chars = new char[filename.Length];
@@ -272,9 +269,7 @@ public sealed class SubdirectoryViewModel
mboxResult = await MessageBoxManager.GetMessageBoxStandard(UI.Unsupported_filename,
string.
- Format(
- UI.
- Filename_0_not_supported_want_to_rename_to_1,
+ Format(UI.Filename_0_not_supported_want_to_rename_to_1,
filename, corrected),
ButtonEnum.YesNoCancel, Icon.Warning).
ShowWindowDialogAsync(_view);
@@ -298,9 +293,9 @@ public sealed class SubdirectoryViewModel
if(File.Exists(outputPath))
{
mboxResult = await MessageBoxManager.GetMessageBoxStandard(UI.Existing_file,
- string.Format(
- UI.File_named_0_exists_overwrite_Q,
- filename),
+ string.
+ Format(UI.File_named_0_exists_overwrite_Q,
+ filename),
ButtonEnum.YesNoCancel, Icon.Warning).
ShowWindowDialogAsync(_view);
@@ -318,8 +313,10 @@ public sealed class SubdirectoryViewModel
catch(IOException)
{
mboxResult = await MessageBoxManager.GetMessageBoxStandard(UI.Cannot_delete,
- UI.Could_note_delete_existe_file_continue_Q, ButtonEnum.YesNo,
- Icon.Error).ShowWindowDialogAsync(_view);
+ UI.Could_note_delete_existe_file_continue_Q,
+ ButtonEnum.YesNo,
+ Icon.Error).
+ ShowWindowDialogAsync(_view);
if(mboxResult == ButtonResult.No)
return;
@@ -344,10 +341,11 @@ public sealed class SubdirectoryViewModel
if(error != ErrorNumber.NoError)
{
mboxResult = await MessageBoxManager.GetMessageBoxStandard(UI.Error_reading_file,
- string.Format(
- UI.Error_0_reading_file_continue_Q,
- error), ButtonEnum.YesNo,
- Icon.Error).ShowWindowDialogAsync(_view);
+ string.
+ Format(UI.Error_0_reading_file_continue_Q,
+ error), ButtonEnum.YesNo,
+ Icon.Error).
+ ShowWindowDialogAsync(_view);
if(mboxResult == ButtonResult.No)
return;
diff --git a/Aaru.Gui/ViewModels/Tabs/AtaInfoViewModel.cs b/Aaru.Gui/ViewModels/Tabs/AtaInfoViewModel.cs
index b0b63f99a..f3145aeb3 100644
--- a/Aaru.Gui/ViewModels/Tabs/AtaInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Tabs/AtaInfoViewModel.cs
@@ -58,8 +58,7 @@ public sealed class AtaInfoViewModel : ViewModelBase
_atapi = atapiIdentify;
_view = view;
- if(ataIdentify == null &&
- atapiIdentify == null)
+ if(ataIdentify == null && atapiIdentify == null)
return;
if(ataIdentify != null)
@@ -83,8 +82,7 @@ public sealed class AtaInfoViewModel : ViewModelBase
AtaMcptWriteProtectionChecked = (ataMcptError.Value.DeviceHead & 0x08) == 0x08;
- var specificData =
- (ushort)(ataMcptError.Value.CylinderHigh * 0x100 + ataMcptError.Value.CylinderLow);
+ var specificData = (ushort)(ataMcptError.Value.CylinderHigh * 0x100 + ataMcptError.Value.CylinderLow);
AtaMcptSpecificDataText = string.Format(Localization.Core.Card_specific_data_0, specificData);
}
@@ -120,8 +118,11 @@ public sealed class AtaInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -145,8 +146,11 @@ public sealed class AtaInfoViewModel : ViewModelBase
dlgSaveText.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.txt" }),
- Name = UI.Dialog_Text_files
+ Extensions = new List(new[]
+ {
+ "*.txt"
+ }),
+ Name = UI.Dialog_Text_files
});
string result = await dlgSaveText.ShowAsync(_view);
diff --git a/Aaru.Gui/ViewModels/Tabs/BlurayInfoViewModel.cs b/Aaru.Gui/ViewModels/Tabs/BlurayInfoViewModel.cs
index 1cf40ccc6..16bd039d7 100644
--- a/Aaru.Gui/ViewModels/Tabs/BlurayInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Tabs/BlurayInfoViewModel.cs
@@ -179,8 +179,11 @@ public sealed class BlurayInfoViewModel
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
diff --git a/Aaru.Gui/ViewModels/Tabs/CompactDiscInfoViewModel.cs b/Aaru.Gui/ViewModels/Tabs/CompactDiscInfoViewModel.cs
index 725d65f9b..f067eff81 100644
--- a/Aaru.Gui/ViewModels/Tabs/CompactDiscInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Tabs/CompactDiscInfoViewModel.cs
@@ -159,8 +159,11 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -180,8 +183,11 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -201,8 +207,11 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -222,8 +231,11 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -243,8 +255,11 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -264,8 +279,11 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -285,8 +303,11 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
diff --git a/Aaru.Gui/ViewModels/Tabs/DvdInfoViewModel.cs b/Aaru.Gui/ViewModels/Tabs/DvdInfoViewModel.cs
index 8efb2c36c..ebaebb7ad 100644
--- a/Aaru.Gui/ViewModels/Tabs/DvdInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Tabs/DvdInfoViewModel.cs
@@ -132,8 +132,11 @@ public sealed class DvdInfoViewModel
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
diff --git a/Aaru.Gui/ViewModels/Tabs/DvdWritableInfoViewModel.cs b/Aaru.Gui/ViewModels/Tabs/DvdWritableInfoViewModel.cs
index 0c1e0f5e9..da7299b44 100644
--- a/Aaru.Gui/ViewModels/Tabs/DvdWritableInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Tabs/DvdWritableInfoViewModel.cs
@@ -260,8 +260,11 @@ public sealed class DvdWritableInfoViewModel
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
diff --git a/Aaru.Gui/ViewModels/Tabs/PcmciaInfoViewModel.cs b/Aaru.Gui/ViewModels/Tabs/PcmciaInfoViewModel.cs
index 6434ea74a..b3f796f19 100644
--- a/Aaru.Gui/ViewModels/Tabs/PcmciaInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Tabs/PcmciaInfoViewModel.cs
@@ -182,8 +182,11 @@ public class PcmciaInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
diff --git a/Aaru.Gui/ViewModels/Tabs/ScsiInfoViewModel.cs b/Aaru.Gui/ViewModels/Tabs/ScsiInfoViewModel.cs
index 36af44a61..0ecb3afa7 100644
--- a/Aaru.Gui/ViewModels/Tabs/ScsiInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Tabs/ScsiInfoViewModel.cs
@@ -82,8 +82,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
SaveEvpdPageCommand = ReactiveCommand.Create(ExecuteSaveEvpdPageCommand);
SaveMmcFeaturesCommand = ReactiveCommand.Create(ExecuteSaveMmcFeaturesCommand);
- if(InquiryData == null ||
- !scsiInquiry.HasValue)
+ if(InquiryData == null || !scsiInquiry.HasValue)
return;
ScsiInquiryText = Decoders.SCSI.Inquiry.Prettify(scsiInquiry);
@@ -110,8 +109,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
{
case 0x00:
{
- if(scsiType == PeripheralDeviceTypes.MultiMediaDevice &&
- page.Subpage == 0)
+ if(scsiType == PeripheralDeviceTypes.MultiMediaDevice && page.Subpage == 0)
decodedText = Modes.PrettifyModePage_00_SFF(page.PageResponse);
else
decodedText = UI.Undecoded;
@@ -515,40 +513,52 @@ public sealed class ScsiInfoViewModel : ViewModelBase
evpdDecodedPage = EVPD.DecodePageB4(page.Value);
break;
- case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
- Trim() == "quantum":
+ case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
+ ToLowerInvariant().
+ Trim() ==
+ "quantum":
evpdPageTitle = UI.Quantum_Firmware_Build_Information_page;
evpdDecodedPage = EVPD.PrettifyPage_C0_Quantum(page.Value);
break;
- case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
- Trim() == "seagate":
+ case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
+ ToLowerInvariant().
+ Trim() ==
+ "seagate":
evpdPageTitle = UI.Seagate_Firmware_Numbers_page;
evpdDecodedPage = EVPD.PrettifyPage_C0_Seagate(page.Value);
break;
- case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
- Trim() == "ibm":
+ case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
+ ToLowerInvariant().
+ Trim() ==
+ "ibm":
evpdPageTitle = UI.IBM_Drive_Component_Revision_Levels_page;
evpdDecodedPage = EVPD.PrettifyPage_C0_IBM(page.Value);
break;
- case 0xC1 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
- Trim() == "ibm":
+ case 0xC1 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
+ ToLowerInvariant().
+ Trim() ==
+ "ibm":
evpdPageTitle = UI.IBM_Drive_Serial_Numbers_page;
evpdDecodedPage = EVPD.PrettifyPage_C1_IBM(page.Value);
break;
case 0xC0 or 0xC1
- when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
- Trim() == "certance":
+ when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
+ ToLowerInvariant().
+ Trim() ==
+ "certance":
evpdPageTitle = UI.Certance_Drive_Component_Revision_Levels_page;
evpdDecodedPage = EVPD.PrettifyPage_C0_C1_Certance(page.Value);
break;
case 0xC2 or 0xC3 or 0xC4 or 0xC5 or 0xC6
- when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
- Trim() == "certance":
+ when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
+ ToLowerInvariant().
+ Trim() ==
+ "certance":
evpdPageTitle = page.Key switch
{
0xC2 => UI.Head_Assembly_Serial_Number,
@@ -563,8 +573,10 @@ public sealed class ScsiInfoViewModel : ViewModelBase
break;
case 0xC0 or 0xC1 or 0xC2 or 0xC3 or 0xC4 or 0xC5
- when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
- Trim() == "hp":
+ when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
+ ToLowerInvariant().
+ Trim() ==
+ "hp":
evpdPageTitle = page.Key switch
{
0xC0 => UI.HP_Drive_Firmware_Revision_Levels_page,
@@ -579,8 +591,10 @@ public sealed class ScsiInfoViewModel : ViewModelBase
evpdDecodedPage = EVPD.PrettifyPage_C0_to_C5_HP(page.Value);
break;
- case 0xDF when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
- Trim() == "certance":
+ case 0xDF when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).
+ ToLowerInvariant().
+ Trim() ==
+ "certance":
evpdPageTitle = UI.Certance_drive_status_page;
evpdDecodedPage = EVPD.PrettifyPage_DF_Certance(page.Value);
@@ -593,8 +607,8 @@ public sealed class ScsiInfoViewModel : ViewModelBase
evpdPageTitle = string.Format(UI.Page_0_h, page.Key);
evpdDecodedPage = UI.Undecoded;
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Core.Found_undecoded_SCSI_VPD_page_0, page.Key);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.Found_undecoded_SCSI_VPD_page_0,
+ page.Key);
break;
}
@@ -614,8 +628,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
Features.SeparatedFeatures ftr = Features.Separate(_configuration);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.GET_CONFIGURATION_length_is_0,
- ftr.DataLength);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.GET_CONFIGURATION_length_is_0, ftr.DataLength);
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Core.GET_CONFIGURATION_current_profile_is_0,
ftr.CurrentProfile);
@@ -799,8 +812,11 @@ public sealed class ScsiInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -820,8 +836,11 @@ public sealed class ScsiInfoViewModel : ViewModelBase
dlgSaveText.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.txt" }),
- Name = UI.Dialog_Text_files
+ Extensions = new List(new[]
+ {
+ "*.txt"
+ }),
+ Name = UI.Dialog_Text_files
});
string result = await dlgSaveText.ShowAsync(_view);
@@ -841,8 +860,11 @@ public sealed class ScsiInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -862,8 +884,11 @@ public sealed class ScsiInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -886,8 +911,11 @@ public sealed class ScsiInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
@@ -907,8 +935,11 @@ public sealed class ScsiInfoViewModel : ViewModelBase
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
diff --git a/Aaru.Gui/ViewModels/Tabs/XboxInfoViewModel.cs b/Aaru.Gui/ViewModels/Tabs/XboxInfoViewModel.cs
index e97c3f4eb..ae8b660d0 100644
--- a/Aaru.Gui/ViewModels/Tabs/XboxInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Tabs/XboxInfoViewModel.cs
@@ -108,8 +108,11 @@ public sealed class XboxInfoViewModel
dlgSaveBinary.Filters?.Add(new FileDialogFilter
{
- Extensions = new List(new[] { "*.bin" }),
- Name = UI.Dialog_Binary_files
+ Extensions = new List(new[]
+ {
+ "*.bin"
+ }),
+ Name = UI.Dialog_Binary_files
});
string result = await dlgSaveBinary.ShowAsync(_view);
diff --git a/Aaru.Gui/ViewModels/Windows/ImageChecksumViewModel.cs b/Aaru.Gui/ViewModels/Windows/ImageChecksumViewModel.cs
index c6d9f891a..4c2d32955 100644
--- a/Aaru.Gui/ViewModels/Windows/ImageChecksumViewModel.cs
+++ b/Aaru.Gui/ViewModels/Windows/ImageChecksumViewModel.cs
@@ -419,9 +419,7 @@ public sealed class ImageChecksumViewModel : ViewModelBase
ProgressMax = 1;
Progress2Max = (int)(_inputFormat.Info.Sectors / SECTORS_TO_READ);
- if(formatHasTracks &&
- ChecksumTracksChecked &&
- opticalMediaImage != null)
+ if(formatHasTracks && ChecksumTracksChecked && opticalMediaImage != null)
ProgressMax += opticalMediaImage.Tracks.Count;
else
{
@@ -775,14 +773,10 @@ public sealed class ImageChecksumViewModel : ViewModelBase
}
if(ChecksumTracksChecked)
- {
await Dispatcher.UIThread.InvokeAsync(() => { TrackChecksumsVisible = true; });
- }
if(ChecksumMediaChecked)
- {
await Dispatcher.UIThread.InvokeAsync(() => { MediaChecksumsVisible = true; });
- }
Statistics.AddCommand("checksum");
diff --git a/Aaru.Gui/ViewModels/Windows/ImageConvertViewModel.cs b/Aaru.Gui/ViewModels/Windows/ImageConvertViewModel.cs
index 560dfdd83..36c6d6537 100644
--- a/Aaru.Gui/ViewModels/Windows/ImageConvertViewModel.cs
+++ b/Aaru.Gui/ViewModels/Windows/ImageConvertViewModel.cs
@@ -597,7 +597,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
if(SelectedPlugin is null)
{
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Error_trying_to_find_selected_plugin,
- icon: Icon.Error).ShowWindowDialogAsync(_view);
+ icon: Icon.Error).
+ ShowWindowDialogAsync(_view);
return;
}
@@ -613,7 +614,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
if(plugin is not IWritableImage outputFormat)
{
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Error_trying_to_find_selected_plugin,
- icon: Icon.Error).ShowWindowDialogAsync(_view);
+ icon: Icon.Error).
+ ShowWindowDialogAsync(_view);
return;
}
@@ -714,16 +716,13 @@ public sealed class ImageConvertViewModel : ViewModelBase
});
foreach(MediaTagType mediaTag in _inputFormat.Info.ReadableMediaTags.Where(mediaTag =>
- !outputFormat.SupportedMediaTags.Contains(mediaTag) && !ForceChecked))
+ !outputFormat.SupportedMediaTags.Contains(mediaTag) && !ForceChecked))
{
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Converting_image_will_lose_media_tag_0,
- mediaTag),
- icon: Icon.Error).
+ Format(UI.Converting_image_will_lose_media_tag_0,
+ mediaTag), icon: Icon.Error).
ShowWindowDialogAsync(_view));
return;
@@ -732,7 +731,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
bool useLong = _inputFormat.Info.ReadableSectorTags.Count != 0;
foreach(SectorTagType sectorTag in _inputFormat.Info.ReadableSectorTags.Where(sectorTag =>
- !outputFormat.SupportedSectorTags.Contains(sectorTag)))
+ !outputFormat.SupportedSectorTags.Contains(sectorTag)))
{
if(ForceChecked)
{
@@ -747,11 +746,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Converting_image_will_lose_sector_tag_0,
- sectorTag),
- icon: Icon.Error).
+ Format(UI.Converting_image_will_lose_sector_tag_0,
+ sectorTag), icon: Icon.Error).
ShowWindowDialogAsync(_view));
return;
@@ -805,8 +801,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
GetMessageBoxStandard(UI.Title_Error,
string.
Format(UI.Error_0_creating_output_image,
- outputFormat.
- ErrorMessage),
+ outputFormat.ErrorMessage),
icon: Icon.Error).
ShowWindowDialogAsync(_view));
@@ -852,9 +847,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_setting_metadata_not_continuing,
+ Format(UI.Error_0_setting_metadata_not_continuing,
outputFormat.
ErrorMessage),
icon: Icon.Error).
@@ -870,9 +863,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
}
}
- if(tracks != null &&
- !_cancel &&
- outputOptical != null)
+ if(tracks != null && !_cancel && outputOptical != null)
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
@@ -887,9 +878,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_sending_tracks_list_to_output_image,
+ Format(UI.Error_0_sending_tracks_list_to_output_image,
outputFormat.
ErrorMessage),
icon: Icon.Error).
@@ -918,8 +907,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
errno = _inputFormat.ReadMediaTag(mediaTag, out byte[] tag);
- if(errno == ErrorNumber.NoError &&
- outputFormat.WriteMediaTag(tag, mediaTag))
+ if(errno == ErrorNumber.NoError && outputFormat.WriteMediaTag(tag, mediaTag))
continue;
if(ForceChecked)
@@ -935,29 +923,26 @@ public sealed class ImageConvertViewModel : ViewModelBase
{
if(errno == ErrorNumber.NoError)
{
- await Dispatcher.UIThread.InvokeAsync(async () =>
- await MessageBoxManager.
- GetMessageBoxStandard(UI.Title_Error,
- string.
- Format(
- UI.
- Error_0_writing_media_tag_not_continuing,
- outputFormat.ErrorMessage),
- icon: Icon.Error).ShowWindowDialogAsync(_view));
+ await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
+ GetMessageBoxStandard(UI.Title_Error,
+ string.
+ Format(UI.Error_0_writing_media_tag_not_continuing,
+ outputFormat.
+ ErrorMessage),
+ icon: Icon.Error).
+ ShowWindowDialogAsync(_view));
AaruConsole.ErrorWriteLine(UI.Error_0_writing_media_tag_not_continuing, outputFormat.ErrorMessage);
}
else
{
- await Dispatcher.UIThread.InvokeAsync(async () =>
- await MessageBoxManager.
- GetMessageBoxStandard(UI.Title_Error,
- string.
- Format(
- UI.
- Error_0_reading_media_tag_not_continuing,
- errno), icon: Icon.Error).
- ShowWindowDialogAsync(_view));
+ await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
+ GetMessageBoxStandard(UI.Title_Error,
+ string.
+ Format(UI.Error_0_reading_media_tag_not_continuing,
+ errno),
+ icon: Icon.Error).
+ ShowWindowDialogAsync(_view));
AaruConsole.ErrorWriteLine(UI.Error_0_reading_media_tag_not_continuing, errno);
}
@@ -968,8 +953,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
ulong doneSectors = 0;
- if(tracks == null &&
- !_cancel)
+ if(tracks == null && !_cancel)
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
@@ -1053,10 +1037,9 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_reading_sector_1_not_continuing,
- errno, doneSectors),
+ Format(UI.Error_0_reading_sector_1_not_continuing,
+ errno,
+ doneSectors),
icon: Icon.Error).
ShowWindowDialogAsync(_view));
@@ -1093,10 +1076,9 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_reading_sector_1_not_continuing,
- errno, doneSectors),
+ Format(UI.Error_0_reading_sector_1_not_continuing,
+ errno,
+ doneSectors),
icon: Icon.Error).
ShowWindowDialogAsync(_view));
@@ -1121,10 +1103,9 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_writing_sector_1_not_continuing,
- outputFormat.ErrorMessage,
+ Format(UI.Error_0_writing_sector_1_not_continuing,
+ outputFormat.
+ ErrorMessage,
doneSectors),
icon: Icon.Error).
ShowWindowDialogAsync(_view));
@@ -1154,7 +1135,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
Dictionary smallestPregapLbaPerTrack = new();
foreach(SectorTagType tag in _inputFormat.Info.ReadableSectorTags.
- Where(t => t == SectorTagType.CdTrackIsrc).OrderBy(t => t))
+ Where(t => t == SectorTagType.CdTrackIsrc).
+ OrderBy(t => t))
{
foreach(Track track in inputOptical.Tracks)
{
@@ -1168,7 +1150,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
}
foreach(SectorTagType tag in _inputFormat.Info.ReadableSectorTags.
- Where(t => t == SectorTagType.CdTrackFlags).OrderBy(t => t))
+ Where(t => t == SectorTagType.CdTrackFlags).
+ OrderBy(t => t))
{
foreach(Track track in inputOptical.Tracks)
{
@@ -1255,8 +1238,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
{
Track track = tracks.LastOrDefault(t => t.StartSector >= doneSectors);
- if(tag == SectorTagType.CdSectorSubchannel &&
- track != null)
+ if(tag == SectorTagType.CdSectorSubchannel && track != null)
{
bool indexesChanged = CompactDisc.WriteSubchannelToImage(MmcSubchannel.Raw,
MmcSubchannel.Raw, sector, doneSectors, 1, null, isrcs, (byte)track.Sequence,
@@ -1287,9 +1269,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_reading_sector_1_not_continuing,
+ Format(UI.Error_0_reading_sector_1_not_continuing,
errno, doneSectors),
icon: Icon.Error).
ShowWindowDialogAsync(_view));
@@ -1309,8 +1289,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
{
Track track = tracks.LastOrDefault(t => t.StartSector >= doneSectors);
- if(tag == SectorTagType.CdSectorSubchannel &&
- track != null)
+ if(tag == SectorTagType.CdSectorSubchannel && track != null)
{
bool indexesChanged = CompactDisc.WriteSubchannelToImage(MmcSubchannel.Raw,
@@ -1342,9 +1321,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_reading_sector_1_not_continuing,
+ Format(UI.Error_0_reading_sector_1_not_continuing,
errno, doneSectors),
icon: Icon.Error).
ShowWindowDialogAsync(_view));
@@ -1371,9 +1348,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_writing_sector_1_not_continuing,
+ Format(UI.Error_0_writing_sector_1_not_continuing,
outputFormat.
ErrorMessage,
doneSectors),
@@ -1410,9 +1385,10 @@ public sealed class ImageConvertViewModel : ViewModelBase
if(trackFlags.Count > 0)
{
foreach(KeyValuePair flags in trackFlags)
- {
- outputOptical.WriteSectorTag(new[] { flags.Value }, flags.Key, SectorTagType.CdTrackFlags);
- }
+ outputOptical.WriteSectorTag(new[]
+ {
+ flags.Value
+ }, flags.Key, SectorTagType.CdTrackFlags);
}
if(mcn != null)
@@ -1493,9 +1469,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_reading_sector_1_not_continuing,
+ Format(UI.Error_0_reading_sector_1_not_continuing,
errno, doneSectors),
icon: Icon.Error).
ShowWindowDialogAsync(_view));
@@ -1533,9 +1507,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_reading_sector_1_not_continuing,
+ Format(UI.Error_0_reading_sector_1_not_continuing,
errno, doneSectors),
icon: Icon.Error).
ShowWindowDialogAsync(_view));
@@ -1559,9 +1531,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_writing_sector_1_not_continuing,
+ Format(UI.Error_0_writing_sector_1_not_continuing,
outputFormat.
ErrorMessage,
doneSectors),
@@ -1639,16 +1609,13 @@ public sealed class ImageConvertViewModel : ViewModelBase
}
else
{
- await Dispatcher.UIThread.InvokeAsync(async () =>
- await MessageBoxManager.
- GetMessageBoxStandard(UI.Title_Error,
- string.
- Format(
- UI.
- Error_0_reading_media_tag_not_continuing,
- errno),
- icon: Icon.Error).
- ShowWindowDialogAsync(_view));
+ await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
+ GetMessageBoxStandard(UI.Title_Error,
+ string.
+ Format(UI.Error_0_reading_media_tag_not_continuing,
+ errno),
+ icon: Icon.Error).
+ ShowWindowDialogAsync(_view));
return;
}
@@ -1667,17 +1634,14 @@ public sealed class ImageConvertViewModel : ViewModelBase
}
else
{
- await Dispatcher.UIThread.InvokeAsync(async () =>
- await MessageBoxManager.
- GetMessageBoxStandard(UI.Title_Error,
- string.
- Format(
- UI.
- Error_0_writing_tag_not_continuing,
- outputFormat.
- ErrorMessage),
- icon: Icon.Error).
- ShowWindowDialogAsync(_view));
+ await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
+ GetMessageBoxStandard(UI.Title_Error,
+ string.
+ Format(UI.Error_0_writing_tag_not_continuing,
+ outputFormat.
+ ErrorMessage),
+ icon: Icon.Error).
+ ShowWindowDialogAsync(_view));
return;
}
@@ -1739,9 +1703,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_reading_tag_for_sector_1_not_continuing,
+ Format(UI.Error_0_reading_tag_for_sector_1_not_continuing,
errno, doneSectors),
icon: Icon.Error).
ShowWindowDialogAsync(_view));
@@ -1764,9 +1726,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_writing_tag_for_sector_1_not_continuing,
+ Format(UI.Error_0_writing_tag_for_sector_1_not_continuing,
outputFormat.
ErrorMessage,
doneSectors),
@@ -1791,8 +1751,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
bool ret;
- if(_dumpHardware != null &&
- !_cancel)
+ if(_dumpHardware != null && !_cancel)
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
@@ -1808,8 +1767,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
ret = false;
- if(_aaruMetadata != null &&
- !_cancel)
+ if(_aaruMetadata != null && !_cancel)
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
@@ -1835,7 +1793,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
{
await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error, UI.Operation_canceled_the_output_file_is_not_correct,
- icon: Icon.Error).ShowWindowDialogAsync(_view);
+ icon: Icon.Error).
+ ShowWindowDialogAsync(_view);
CloseVisible = true;
StopVisible = false;
@@ -1850,11 +1809,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () => await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error,
string.
- Format(
- UI.
- Error_0_closing_output_image_Contents_are_not_correct,
- outputFormat.
- ErrorMessage),
+ Format(UI.Error_0_closing_output_image_Contents_are_not_correct,
+ outputFormat.ErrorMessage),
icon: Icon.Error).
ShowWindowDialogAsync(_view));
@@ -1863,12 +1819,12 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(async () =>
{
- await MessageBoxManager.
- GetMessageBoxStandard(warning ? UI.Title_Warning : UI.Title_Conversion_success,
- warning
- ? UI.Some_warnings_happened_Check_console
- : UI.Image_converted_successfully,
- icon: warning ? Icon.Warning : Icon.Info).ShowWindowDialogAsync(_view);
+ await MessageBoxManager.GetMessageBoxStandard(warning ? UI.Title_Warning : UI.Title_Conversion_success,
+ warning
+ ? UI.Some_warnings_happened_Check_console
+ : UI.Image_converted_successfully,
+ icon: warning ? Icon.Warning : Icon.Info).
+ ShowWindowDialogAsync(_view);
CloseVisible = true;
StopVisible = false;
@@ -2038,8 +1994,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
string result = await dlgDestination.ShowAsync(_view);
- if(result is null ||
- result.Length != 1)
+ if(result is null || result.Length != 1)
{
DestinationText = "";
@@ -2098,14 +2053,16 @@ public sealed class ImageConvertViewModel : ViewModelBase
dlgMetadata.Filters?.Add(new FileDialogFilter
{
- Name = UI.Dialog_Aaru_Metadata,
- Extensions = new List(new[] { ".json" })
+ Name = UI.Dialog_Aaru_Metadata,
+ Extensions = new List(new[]
+ {
+ ".json"
+ })
});
string[] result = await dlgMetadata.ShowAsync(_view);
- if(result is null ||
- result.Length != 1)
+ if(result is null || result.Length != 1)
return;
try
@@ -2122,7 +2079,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
catch
{
await MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Incorrect_metadata_sidecar_file,
- icon: Icon.Error).ShowWindowDialogAsync(_view);
+ icon: Icon.Error).
+ ShowWindowDialogAsync(_view);
}
}
@@ -2144,14 +2102,16 @@ public sealed class ImageConvertViewModel : ViewModelBase
dlgMetadata.Filters?.Add(new FileDialogFilter
{
- Name = UI.Dialog_Choose_existing_resume_file,
- Extensions = new List(new[] { ".json" })
+ Name = UI.Dialog_Choose_existing_resume_file,
+ Extensions = new List(new[]
+ {
+ ".json"
+ })
});
string[] result = await dlgMetadata.ShowAsync(_view);
- if(result is null ||
- result.Length != 1)
+ if(result is null || result.Length != 1)
return;
try
@@ -2173,7 +2133,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
{
await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error, UI.Resume_file_does_not_contain_dump_hardware_information,
- icon: Icon.Error).ShowWindowDialogAsync(_view);
+ icon: Icon.Error).
+ ShowWindowDialogAsync(_view);
}
}
catch
diff --git a/Aaru.Gui/ViewModels/Windows/ImageSidecarViewModel.cs b/Aaru.Gui/ViewModels/Windows/ImageSidecarViewModel.cs
index c1d2c8e1d..da60d7026 100644
--- a/Aaru.Gui/ViewModels/Windows/ImageSidecarViewModel.cs
+++ b/Aaru.Gui/ViewModels/Windows/ImageSidecarViewModel.cs
@@ -327,8 +327,11 @@ public sealed class ImageSidecarViewModel : ViewModelBase
dlgDestination.Filters?.Add(new FileDialogFilter
{
- Name = UI.Dialog_Aaru_Metadata,
- Extensions = new List(new[] { "*.json" })
+ Name = UI.Dialog_Aaru_Metadata,
+ Extensions = new List(new[]
+ {
+ "*.json"
+ })
});
string result = await dlgDestination.ShowAsync(_view);
diff --git a/Aaru.Gui/ViewModels/Windows/MainWindowViewModel.cs b/Aaru.Gui/ViewModels/Windows/MainWindowViewModel.cs
index 381d686ff..738e01394 100644
--- a/Aaru.Gui/ViewModels/Windows/MainWindowViewModel.cs
+++ b/Aaru.Gui/ViewModels/Windows/MainWindowViewModel.cs
@@ -147,13 +147,12 @@ public sealed class MainWindowViewModel : ViewModelBase
new Bitmap(AssetLoader.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/inode-directory.png")));
_usbIcon =
- new
- Bitmap(AssetLoader.Open(
- new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media-usb.png")));
+ new Bitmap(AssetLoader.
+ Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media-usb.png")));
_removableIcon =
- new Bitmap(AssetLoader.Open(
- new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media.png")));
+ new Bitmap(AssetLoader.
+ Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media.png")));
_sdIcon =
new Bitmap(AssetLoader.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/media-flash-sd-mmc.png")));
@@ -194,8 +193,8 @@ public sealed class MainWindowViewModel : ViewModelBase
{
get
{
- Window mainWindow = (Application.Current?.ApplicationLifetime as
- IClassicDesktopStyleApplicationLifetime)?.MainWindow;
+ Window mainWindow = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.
+ MainWindow;
return mainWindow is not null && NativeMenu.GetIsNativeMenuExported(mainWindow);
}
}
@@ -559,8 +558,8 @@ public sealed class MainWindowViewModel : ViewModelBase
{
if(ImageFormat.Detect(inputFilter) is not IMediaImage imageFormat)
{
- MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Image_format_not_identified,
- ButtonEnum.Ok, Icon.Error);
+ MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Image_format_not_identified, ButtonEnum.Ok,
+ Icon.Error);
return;
}
@@ -574,8 +573,8 @@ public sealed class MainWindowViewModel : ViewModelBase
if(opened != ErrorNumber.NoError)
{
MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
- string.Format(UI.Error_0_opening_image_format,
- opened), ButtonEnum.Ok, Icon.Error);
+ string.Format(UI.Error_0_opening_image_format, opened),
+ ButtonEnum.Ok, Icon.Error);
AaruConsole.ErrorWriteLine(UI.Unable_to_open_image_format);
AaruConsole.ErrorWriteLine(UI.No_error_given);
@@ -590,10 +589,13 @@ public sealed class MainWindowViewModel : ViewModelBase
Path = result[0],
Icon = AssetLoader.Exists(mediaResource)
? new Bitmap(AssetLoader.Open(mediaResource))
- : imageFormat.Info.MetadataMediaType == MetadataMediaType.BlockMedia
+ :
+ imageFormat.Info.MetadataMediaType == MetadataMediaType.BlockMedia
? _genericHddIcon
- : imageFormat.Info.MetadataMediaType == MetadataMediaType.OpticalDisc
- ? _genericOpticalIcon
+ :
+ imageFormat.Info.MetadataMediaType == MetadataMediaType.OpticalDisc
+ ?
+ _genericOpticalIcon
: _genericFolderIcon,
FileName = Path.GetFileName(result[0]),
Image = imageFormat,
@@ -662,9 +664,8 @@ public sealed class MainWindowViewModel : ViewModelBase
if(rofs != null)
{
- ErrorNumber error =
- rofs.Mount(imageFormat, partition, null,
- new Dictionary(), null);
+ ErrorNumber error = rofs.Mount(imageFormat, partition, null,
+ new Dictionary(), null);
if(error != ErrorNumber.NoError)
rofs = null;
@@ -677,10 +678,9 @@ public sealed class MainWindowViewModel : ViewModelBase
? $"{fsMetadata.Type}"
: $"{fsMetadata.VolumeName} ({fsMetadata.Type})"
: $"{rofs.Metadata.VolumeName} ({rofs.Metadata.Type})",
- Filesystem = fs,
+ Filesystem = fs,
ReadOnlyFilesystem = rofs,
- ViewModel = new FileSystemViewModel(rofs?.Metadata ?? fsMetadata,
- information)
+ ViewModel = new FileSystemViewModel(rofs?.Metadata ?? fsMetadata, information)
};
// TODO: Trap expanding item
@@ -785,8 +785,8 @@ public sealed class MainWindowViewModel : ViewModelBase
}
catch(Exception ex)
{
- MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Unable_to_open_image_format,
- ButtonEnum.Ok, Icon.Error);
+ MessageBoxManager.GetMessageBoxStandard(UI.Title_Error, UI.Unable_to_open_image_format, ButtonEnum.Ok,
+ Icon.Error);
AaruConsole.ErrorWriteLine(UI.Unable_to_open_image_format);
AaruConsole.ErrorWriteLine(Localization.Core.Error_0, ex.Message);
@@ -819,7 +819,9 @@ public sealed class MainWindowViewModel : ViewModelBase
AaruConsole.WriteLine(UI.Refreshing_devices);
_devicesRoot.Devices.Clear();
- foreach(Devices.DeviceInfo device in Device.ListDevices().Where(d => d.Supported).OrderBy(d => d.Vendor).
+ foreach(Devices.DeviceInfo device in Device.ListDevices().
+ Where(d => d.Supported).
+ OrderBy(d => d.Vendor).
ThenBy(d => d.Model))
{
AaruConsole.DebugWriteLine(MODULE_NAME,
diff --git a/Aaru.Gui/ViewModels/Windows/MediaDumpViewModel.cs b/Aaru.Gui/ViewModels/Windows/MediaDumpViewModel.cs
index b4b3b76c4..c080ff2b0 100644
--- a/Aaru.Gui/ViewModels/Windows/MediaDumpViewModel.cs
+++ b/Aaru.Gui/ViewModels/Windows/MediaDumpViewModel.cs
@@ -183,17 +183,19 @@ public sealed class MediaDumpViewModel : ViewModelBase
}
}
- Encodings.AddRange(Encoding.GetEncodings().Select(info => new EncodingModel
- {
- Name = info.Name,
- DisplayName = info.GetEncoding().EncodingName
- }));
+ Encodings.AddRange(Encoding.GetEncodings().
+ Select(info => new EncodingModel
+ {
+ Name = info.Name,
+ DisplayName = info.GetEncoding().EncodingName
+ }));
- Encodings.AddRange(Claunia.Encoding.Encoding.GetEncodings().Select(info => new EncodingModel
- {
- Name = info.Name,
- DisplayName = info.DisplayName
- }));
+ Encodings.AddRange(Claunia.Encoding.Encoding.GetEncodings().
+ Select(info => new EncodingModel
+ {
+ Name = info.Name,
+ DisplayName = info.DisplayName
+ }));
switch(mediaType)
{
@@ -518,8 +520,11 @@ public sealed class MediaDumpViewModel : ViewModelBase
dlgMetadata.Filters?.Add(new FileDialogFilter
{
- Name = UI.Dialog_Aaru_Metadata,
- Extensions = new List(new[] { ".json" })
+ Name = UI.Dialog_Aaru_Metadata,
+ Extensions = new List(new[]
+ {
+ ".json"
+ })
});
string[] result = dlgMetadata.ShowAsync(_view).Result;
@@ -548,7 +553,9 @@ public sealed class MediaDumpViewModel : ViewModelBase
// ReSharper restore AssignmentIsFullyDiscarded
GetMessageBoxStandard(UI.Title_Error, UI.Incorrect_metadata_sidecar_file, ButtonEnum.Ok,
- Icon.Error).ShowWindowDialogAsync(_view).Result;
+ Icon.Error).
+ ShowWindowDialogAsync(_view).
+ Result;
ExistingMetadata = false;
}
@@ -738,22 +745,22 @@ public sealed class MediaDumpViewModel : ViewModelBase
{
await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error, UI.Incorrect_resume_file_cannot_use_it, ButtonEnum.Ok,
- Icon.Error).ShowWindowDialogAsync(_view);
+ Icon.Error).
+ ShowWindowDialogAsync(_view);
Resume = false;
return;
}
- if(_resume == null ||
- _resume.NextBlock <= _resume.LastBlock ||
- _resume.BadBlocks.Count != 0 && !_resume.Tape)
+ if(_resume == null || _resume.NextBlock <= _resume.LastBlock || _resume.BadBlocks.Count != 0 && !_resume.Tape)
return;
await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Warning,
- UI.Media_already_dumped_correctly_please_choose_another_destination,
- ButtonEnum.Ok, Icon.Warning).ShowWindowDialogAsync(_view);
+ UI.Media_already_dumped_correctly_please_choose_another_destination, ButtonEnum.Ok,
+ Icon.Warning).
+ ShowWindowDialogAsync(_view);
Resume = false;
}
diff --git a/Aaru.Gui/ViewModels/Windows/MediaScanViewModel.cs b/Aaru.Gui/ViewModels/Windows/MediaScanViewModel.cs
index c59549c35..6be438ddd 100644
--- a/Aaru.Gui/ViewModels/Windows/MediaScanViewModel.cs
+++ b/Aaru.Gui/ViewModels/Windows/MediaScanViewModel.cs
@@ -337,10 +337,7 @@ public sealed class MediaScanViewModel : ViewModelBase
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
async void DoWork()
{
- if(_devicePath.Length == 2 &&
- _devicePath[1] == ':' &&
- _devicePath[0] != '/' &&
- char.IsLetter(_devicePath[0]))
+ if(_devicePath.Length == 2 && _devicePath[1] == ':' && _devicePath[0] != '/' && char.IsLetter(_devicePath[0]))
_devicePath = "\\\\.\\" + char.ToUpper(_devicePath[0]) + ':';
var dev = Device.Create(_devicePath, out ErrorNumber devErrno);
@@ -350,7 +347,8 @@ public sealed class MediaScanViewModel : ViewModelBase
case null:
await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error, string.Format(UI.Error_0_opening_device, devErrno),
- ButtonEnum.Ok, Icon.Error).ShowWindowDialogAsync(_view);
+ ButtonEnum.Ok, Icon.Error).
+ ShowWindowDialogAsync(_view);
StopVisible = false;
StartVisible = true;
@@ -370,7 +368,8 @@ public sealed class MediaScanViewModel : ViewModelBase
{
await MessageBoxManager.
GetMessageBoxStandard(UI.Title_Error, string.Format(UI.Error_0_opening_device, dev.LastError),
- ButtonEnum.Ok, Icon.Error).ShowWindowDialogAsync(_view);
+ ButtonEnum.Ok, Icon.Error).
+ ShowWindowDialogAsync(_view);
StopVisible = false;
StartVisible = true;
diff --git a/Aaru.Gui/ViewModels/Windows/SplashWindowViewModel.cs b/Aaru.Gui/ViewModels/Windows/SplashWindowViewModel.cs
index bc091a1e7..0f4c5b411 100644
--- a/Aaru.Gui/ViewModels/Windows/SplashWindowViewModel.cs
+++ b/Aaru.Gui/ViewModels/Windows/SplashWindowViewModel.cs
@@ -144,8 +144,7 @@ public sealed class SplashWindowViewModel(SplashWindow view) : ViewModelBase
ctx.Database.EnsureCreated();
ctx.Database.
- ExecuteSqlRaw(
- "CREATE TABLE IF NOT EXISTS \"__EFMigrationsHistory\" (\"MigrationId\" TEXT PRIMARY KEY, \"ProductVersion\" TEXT)");
+ ExecuteSqlRaw("CREATE TABLE IF NOT EXISTS \"__EFMigrationsHistory\" (\"MigrationId\" TEXT PRIMARY KEY, \"ProductVersion\" TEXT)");
foreach(string migration in ctx.Database.GetPendingMigrations())
{
@@ -158,21 +157,29 @@ public sealed class SplashWindowViewModel(SplashWindow view) : ViewModelBase
}
// Remove duplicates
- foreach(var duplicate in ctx.SeenDevices.AsEnumerable().GroupBy(a => new
- {
- a.Manufacturer,
- a.Model,
- a.Revision,
- a.Bus
- }).Where(a => a.Count() > 1).Distinct().Select(a => a.Key))
+ foreach(var duplicate in ctx.SeenDevices.AsEnumerable().
+ GroupBy(a => new
+ {
+ a.Manufacturer,
+ a.Model,
+ a.Revision,
+ a.Bus
+ }).
+ Where(a => a.Count() > 1).
+ Distinct().
+ Select(a => a.Key))
{
ctx.RemoveRange(ctx.SeenDevices.
- Where(d => d.Manufacturer == duplicate.Manufacturer && d.Model == duplicate.Model &&
- d.Revision == duplicate.Revision && d.Bus == duplicate.Bus).Skip(1));
+ Where(d => d.Manufacturer == duplicate.Manufacturer &&
+ d.Model == duplicate.Model &&
+ d.Revision == duplicate.Revision &&
+ d.Bus == duplicate.Bus).
+ Skip(1));
}
// Remove nulls
- ctx.RemoveRange(ctx.SeenDevices.Where(d => d.Manufacturer == null && d.Model == null &&
+ ctx.RemoveRange(ctx.SeenDevices.Where(d => d.Manufacturer == null &&
+ d.Model == null &&
d.Revision == null));
ctx.SaveChanges();
diff --git a/Aaru.Helpers b/Aaru.Helpers
index bfe4402f0..e59bc3822 160000
--- a/Aaru.Helpers
+++ b/Aaru.Helpers
@@ -1 +1 @@
-Subproject commit bfe4402f0a2d448149fd5d36daf0da5d003e7853
+Subproject commit e59bc38221d3ee973fc4b991234d959182f6e502
diff --git a/Aaru.Images/A2R/Helpers.cs b/Aaru.Images/A2R/Helpers.cs
index 5e6f7da9d..32b1f703a 100644
--- a/Aaru.Images/A2R/Helpers.cs
+++ b/Aaru.Images/A2R/Helpers.cs
@@ -111,9 +111,10 @@ public sealed partial class A2R
uint over = ticks / 255;
if(over == 0)
- {
- return new[] { (byte)ticks };
- }
+ return new[]
+ {
+ (byte)ticks
+ };
var expanded = new byte[over + 1];
diff --git a/Aaru.Images/A2R/Properties.cs b/Aaru.Images/A2R/Properties.cs
index 4506f56f9..7fc4b8f21 100644
--- a/Aaru.Images/A2R/Properties.cs
+++ b/Aaru.Images/A2R/Properties.cs
@@ -72,7 +72,10 @@ public sealed partial class A2R
#region IWritableImage Members
///
- public IEnumerable KnownExtensions => new[] { ".a2r" };
+ public IEnumerable KnownExtensions => new[]
+ {
+ ".a2r"
+ };
///
public IEnumerable SupportedMediaTags => null;
diff --git a/Aaru.Images/A2R/Write.cs b/Aaru.Images/A2R/Write.cs
index 32ee5c6eb..b07a98f71 100644
--- a/Aaru.Images/A2R/Write.cs
+++ b/Aaru.Images/A2R/Write.cs
@@ -85,9 +85,8 @@ public sealed partial class A2R
_writingStream.WriteByte(IsCaptureTypeTiming(dataResolution, dataBuffer) ? (byte)1 : (byte)3);
_writingStream.
- Write(
- BitConverter.GetBytes((ushort)HeadTrackSubToA2rLocation(head, track, subTrack, _infoChunkV3.driveType)),
- 0, 2);
+ Write(BitConverter.GetBytes((ushort)HeadTrackSubToA2rLocation(head, track, subTrack, _infoChunkV3.driveType)),
+ 0, 2);
List a2rIndices = FluxRepresentationsToUInt32List(indexBuffer);
@@ -268,7 +267,10 @@ public sealed partial class A2R
_writingStream.WriteByte(1);
_writingStream.Write(BitConverter.GetBytes(_currentResolution), 0, 4);
- byte[] reserved = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ byte[] reserved =
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
_writingStream.Write(reserved, 0, 11);
@@ -316,7 +318,8 @@ public sealed partial class A2R
_writingStream.Write(_metaChunkSignature, 0, 4);
byte[] metaString = Encoding.UTF8.GetBytes(Meta.Select(static m => $"{m.Key}\t{m.Value}").
- Aggregate(static (concat, str) => $"{concat}\n{str}") + '\n');
+ Aggregate(static (concat, str) => $"{concat}\n{str}") +
+ '\n');
_writingStream.Write(BitConverter.GetBytes((uint)metaString.Length), 0, 4);
_writingStream.Write(metaString, 0, metaString.Length);
diff --git a/Aaru.Images/AaruFormat/CdEcc.cs b/Aaru.Images/AaruFormat/CdEcc.cs
index 84f42ac53..820f27c27 100644
--- a/Aaru.Images/AaruFormat/CdEcc.cs
+++ b/Aaru.Images/AaruFormat/CdEcc.cs
@@ -164,8 +164,7 @@ public sealed partial class AaruFormat
eccA = _eccBTable[_eccFTable[eccA] ^ eccB];
- if(ecc[major + eccOffset] != eccA ||
- ecc[major + majorCount + eccOffset] != (eccA ^ eccB))
+ if(ecc[major + eccOffset] != eccA || ecc[major + majorCount + eccOffset] != (eccA ^ eccB))
return false;
}
diff --git a/Aaru.Images/AaruFormat/Helpers.cs b/Aaru.Images/AaruFormat/Helpers.cs
index d8589ec36..ce670da5f 100644
--- a/Aaru.Images/AaruFormat/Helpers.cs
+++ b/Aaru.Images/AaruFormat/Helpers.cs
@@ -534,7 +534,8 @@ public sealed partial class AaruFormat
DataType.CompactDiscLeadIn,
MediaTagType.DVD_DiscKey_Decrypted => DataType.
DvdDiscKeyDecrypted,
- _ => throw new ArgumentOutOfRangeException(
- nameof(tag), tag, null)
+ _ => throw new
+ ArgumentOutOfRangeException(nameof(tag),
+ tag, null)
};
}
\ No newline at end of file
diff --git a/Aaru.Images/AaruFormat/Properties.cs b/Aaru.Images/AaruFormat/Properties.cs
index 79b008108..fcb5b0b71 100644
--- a/Aaru.Images/AaruFormat/Properties.cs
+++ b/Aaru.Images/AaruFormat/Properties.cs
@@ -115,17 +115,19 @@ public sealed partial class AaruFormat
("md5", typeof(bool), Localization.Calculate_and_store_MD5_of_image_user_data, false),
("sha1", typeof(bool), Localization.Calculate_and_store_SHA1_of_image_user_data, false),
("sha256", typeof(bool), Localization.Calculate_and_store_SHA256_of_image_user_data, false),
- ("spamsum", typeof(bool), Localization.Calculate_and_store_SpamSum_of_image_user_data, false), ("deduplicate",
- typeof(bool),
- Localization.
- Store_only_unique_sectors_This_consumes_more_memory_and_is_slower_but_its_enabled_by_default,
- true),
+ ("spamsum", typeof(bool), Localization.Calculate_and_store_SpamSum_of_image_user_data, false),
+ ("deduplicate", typeof(bool),
+ Localization.Store_only_unique_sectors_This_consumes_more_memory_and_is_slower_but_its_enabled_by_default,
+ true),
("compress", typeof(bool), Localization.Compress_user_data_blocks_Other_blocks_will_always_be_compressed,
(object)true)
};
///
- public IEnumerable KnownExtensions => new[] { ".dicf", ".aaru", ".aaruformat", ".aaruf", ".aif" };
+ public IEnumerable KnownExtensions => new[]
+ {
+ ".dicf", ".aaru", ".aaruformat", ".aaruf", ".aif"
+ };
///
public bool IsWriting { get; private set; }
diff --git a/Aaru.Images/AaruFormat/Read.cs b/Aaru.Images/AaruFormat/Read.cs
index f8f871290..28ef33daa 100644
--- a/Aaru.Images/AaruFormat/Read.cs
+++ b/Aaru.Images/AaruFormat/Read.cs
@@ -68,8 +68,7 @@ public sealed partial class AaruFormat
///
public ErrorNumber Open(IFilter imageFilter)
{
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
- GC.GetTotalMemory(false));
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false));
_imageStream = imageFilter.GetDataForkStream();
_imageStream.Seek(0, SeekOrigin.Begin);
@@ -94,8 +93,7 @@ public sealed partial class AaruFormat
_imageInfo.Version = $"{_header.imageMajorVersion}.{_header.imageMinorVersion}";
_imageInfo.MediaType = _header.mediaType;
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
- GC.GetTotalMemory(false));
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false));
// Read the index header
_imageStream.Position = (long)_header.indexOffset;
@@ -103,8 +101,7 @@ public sealed partial class AaruFormat
_imageStream.EnsureRead(_structureBytes, 0, _structureBytes.Length);
IndexHeader idxHeader = Marshal.SpanToStructureLittleEndian(_structureBytes);
- if(idxHeader.identifier != BlockType.Index &&
- idxHeader.identifier != BlockType.Index2)
+ if(idxHeader.identifier != BlockType.Index && idxHeader.identifier != BlockType.Index2)
{
AaruConsole.ErrorWriteLine(Localization.Index_not_found);
@@ -118,11 +115,10 @@ public sealed partial class AaruFormat
_imageStream.EnsureRead(_structureBytes, 0, _structureBytes.Length);
IndexHeader2 idxHeader2 = Marshal.SpanToStructureLittleEndian(_structureBytes);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Index_at_0_contains_1_entries,
- _header.indexOffset, idxHeader2.entries);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Index_at_0_contains_1_entries, _header.indexOffset,
+ idxHeader2.entries);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
- GC.GetTotalMemory(false));
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false));
// Fill in-memory index
_index = new List();
@@ -142,11 +138,10 @@ public sealed partial class AaruFormat
}
else
{
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Index_at_0_contains_1_entries,
- _header.indexOffset, idxHeader.entries);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Index_at_0_contains_1_entries, _header.indexOffset,
+ idxHeader.entries);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
- GC.GetTotalMemory(false));
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false));
// Fill in-memory index
_index = new List();
@@ -165,8 +160,7 @@ public sealed partial class AaruFormat
}
}
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
- GC.GetTotalMemory(false));
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false));
_imageInfo.ImageSize = 0;
@@ -267,8 +261,7 @@ public sealed partial class AaruFormat
decompressStopwatch.Stop();
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Took_0_seconds_to_decompress_block,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Took_0_seconds_to_decompress_block,
decompressStopwatch.Elapsed.TotalSeconds);
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
@@ -294,8 +287,7 @@ public sealed partial class AaruFormat
// Check CRC, if not correct, skip it
Crc64Context.Data(data, out byte[] blockCrc);
- if(BitConverter.ToUInt64(blockCrc, 0) != blockHeader.crc64 &&
- blockHeader.crc64 != 0)
+ if(BitConverter.ToUInt64(blockCrc, 0) != blockHeader.crc64 && blockHeader.crc64 != 0)
{
AaruConsole.DebugWriteLine(MODULE_NAME,
Localization.
@@ -516,8 +508,7 @@ public sealed partial class AaruFormat
Localization.Took_0_seconds_to_decompress_DDT,
ddtStopwatch.Elapsed.TotalSeconds);
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Memory_snapshot_0_bytes,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
GC.GetTotalMemory(false));
break;
@@ -525,17 +516,15 @@ public sealed partial class AaruFormat
_inMemoryDdt = false;
_outMemoryDdtPosition = (long)entry.offset;
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Memory_snapshot_0_bytes,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
GC.GetTotalMemory(false));
break;
default:
AaruConsole.
ErrorWriteLine(string.
- Format(
- Localization.Found_unsupported_compression_algorithm_0,
- (ushort)ddtHeader.compression));
+ Format(Localization.Found_unsupported_compression_algorithm_0,
+ (ushort)ddtHeader.compression));
return ErrorNumber.NotSupported;
}
@@ -582,25 +571,22 @@ public sealed partial class AaruFormat
Localization.Took_0_seconds_to_decompress_DDT,
ddtStopwatch.Elapsed.TotalSeconds);
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Memory_snapshot_0_bytes,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
GC.GetTotalMemory(false));
break;
case CompressionType.None:
_imageStream.EnsureRead(decompressedDdt, 0, decompressedDdt.Length);
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Memory_snapshot_0_bytes,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
GC.GetTotalMemory(false));
break;
default:
AaruConsole.
ErrorWriteLine(string.
- Format(
- Localization.Found_unsupported_compression_algorithm_0,
- (ushort)ddtHeader.compression));
+ Format(Localization.Found_unsupported_compression_algorithm_0,
+ (ushort)ddtHeader.compression));
return ErrorNumber.NotSupported;
}
@@ -691,8 +677,7 @@ public sealed partial class AaruFormat
_imageInfo.Creator = Encoding.Unicode.GetString(metadata, (int)metadataBlock.creatorOffset,
(int)(metadataBlock.creatorLength - 2));
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Setting_creator_0,
- _imageInfo.Creator);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Setting_creator_0, _imageInfo.Creator);
}
if(metadataBlock.commentsOffset > 0 &&
@@ -701,8 +686,7 @@ public sealed partial class AaruFormat
_imageInfo.Comments = Encoding.Unicode.GetString(metadata, (int)metadataBlock.commentsOffset,
(int)(metadataBlock.commentsLength - 2));
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Setting_comments_0,
- _imageInfo.Comments);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Setting_comments_0, _imageInfo.Comments);
}
if(metadataBlock.mediaTitleOffset > 0 &&
@@ -888,12 +872,10 @@ public sealed partial class AaruFormat
_trackIsrcs.Add(trackEntry.sequence, trackEntry.isrc);
}
- if(_trackFlags.Count > 0 &&
- !_imageInfo.ReadableSectorTags.Contains(SectorTagType.CdTrackFlags))
+ if(_trackFlags.Count > 0 && !_imageInfo.ReadableSectorTags.Contains(SectorTagType.CdTrackFlags))
_imageInfo.ReadableSectorTags.Add(SectorTagType.CdTrackFlags);
- if(_trackIsrcs.Count > 0 &&
- !_imageInfo.ReadableSectorTags.Contains(SectorTagType.CdTrackIsrc))
+ if(_trackIsrcs.Count > 0 && !_imageInfo.ReadableSectorTags.Contains(SectorTagType.CdTrackIsrc))
_imageInfo.ReadableSectorTags.Add(SectorTagType.CdTrackIsrc);
_imageInfo.HasPartitions = true;
@@ -915,8 +897,8 @@ public sealed partial class AaruFormat
if(cicmBlock.identifier != BlockType.CicmBlock)
break;
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Found_CICM_XML_metadata_block_at_position_0, entry.offset);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_CICM_XML_metadata_block_at_position_0,
+ entry.offset);
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
GC.GetTotalMemory(false));
@@ -965,8 +947,8 @@ public sealed partial class AaruFormat
if(aaruMetadataBlock.identifier != BlockType.AaruMetadataJsonBlock)
break;
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Found_Aaru_Metadata_block_at_position_0, entry.offset);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_Aaru_Metadata_block_at_position_0,
+ entry.offset);
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
GC.GetTotalMemory(false));
@@ -982,8 +964,8 @@ public sealed partial class AaruFormat
}
catch(JsonException ex)
{
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Exception_0_processing_Aaru_Metadata_block, ex.Message);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Exception_0_processing_Aaru_Metadata_block,
+ ex.Message);
AaruMetadata = null;
}
@@ -1004,8 +986,8 @@ public sealed partial class AaruFormat
if(dumpBlock.identifier != BlockType.DumpHardwareBlock)
break;
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Found_dump_hardware_block_at_position_0, entry.offset);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_dump_hardware_block_at_position_0,
+ entry.offset);
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
GC.GetTotalMemory(false));
@@ -1146,8 +1128,8 @@ public sealed partial class AaruFormat
if(partitionHeader.identifier != BlockType.TapePartitionBlock)
break;
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Found_tape_partition_block_at_position_0, entry.offset);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_tape_partition_block_at_position_0,
+ entry.offset);
var tapePartitionBytes = new byte[partitionHeader.length];
_imageStream.EnsureRead(tapePartitionBytes, 0, tapePartitionBytes.Length);
@@ -1240,8 +1222,7 @@ public sealed partial class AaruFormat
compactDiscIndexes = new List();
- AaruConsole.DebugWriteLine(MODULE_NAME,
- Localization.Found_0_compact_disc_indexes_at_position_1,
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_0_compact_disc_indexes_at_position_1,
indexesHeader.entries, entry.offset);
for(ushort i = 0; i < indexesHeader.entries; i++)
@@ -1272,8 +1253,7 @@ public sealed partial class AaruFormat
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Image_created_on_0, _imageInfo.CreationTime);
_imageInfo.LastModificationTime = DateTime.FromFileTimeUtc(_header.lastWrittenTime);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Image_last_written_on_0,
- _imageInfo.LastModificationTime);
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Image_last_written_on_0, _imageInfo.LastModificationTime);
_imageInfo.MetadataMediaType = GetMetadataMediaType(_header.mediaType);
@@ -1287,8 +1267,7 @@ public sealed partial class AaruFormat
_imageInfo.ReadableMediaTags.AddRange(_mediaTags.Keys);
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
- GC.GetTotalMemory(false));
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false));
// Initialize caches
_blockCache = new Dictionary();
@@ -1298,8 +1277,7 @@ public sealed partial class AaruFormat
if(!_inMemoryDdt)
_ddtEntryCache = new Dictionary();
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
- GC.GetTotalMemory(false));
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false));
// Initialize tracks, sessions and partitions
if(_imageInfo.MetadataMediaType == MetadataMediaType.OpticalDisc)
@@ -1323,8 +1301,7 @@ public sealed partial class AaruFormat
Dictionary leadOutStarts = new(); // Lead-out starts
foreach(FullTOC.TrackDataDescriptor trk in
- decodedFullToc.Value.TrackDescriptors.Where(trk => trk.ADR is 1 or 4 &&
- trk.POINT == 0xA2))
+ decodedFullToc.Value.TrackDescriptors.Where(trk => trk.ADR is 1 or 4 && trk.POINT == 0xA2))
{
int phour, pmin, psec, pframe;
@@ -1419,11 +1396,9 @@ public sealed partial class AaruFormat
}
}
- AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes,
- GC.GetTotalMemory(false));
+ AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Memory_snapshot_0_bytes, GC.GetTotalMemory(false));
- if(Tracks == null ||
- Tracks.Count == 0)
+ if(Tracks == null || Tracks.Count == 0)
{
Tracks = new List