mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Redo Reformat and cleanup.
Rider EAP was having a bug interpreting .editorconfig that didn't generate the code style as we wanted. This is now done with Rider-stable.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<byte>();
|
||||
|
||||
|
||||
@@ -376,7 +376,8 @@ public partial class Device
|
||||
/// <param name="duration">Duration.</param>
|
||||
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);
|
||||
|
||||
/// <summary>Reads a number of fixed-length blocks starting at specified block from the specified partition</summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user