REFACTOR: Remove redundant parentheses.

This commit is contained in:
2017-12-20 17:26:28 +00:00
parent a4650c61aa
commit b0936d51c5
160 changed files with 1096 additions and 1106 deletions

View File

@@ -110,7 +110,7 @@ namespace DiscImageChef.Core
end = DateTime.Now;
results.FillTime = (end - start).TotalSeconds;
results.FillSpeed = (bufferSize / 1048576) / (end - start).TotalSeconds;
results.FillSpeed = bufferSize / 1048576 / (end - start).TotalSeconds;
ms.Seek(0, SeekOrigin.Begin);
mem = GC.GetTotalMemory(false);
@@ -132,7 +132,7 @@ namespace DiscImageChef.Core
if(mem < results.MinMemory) results.MinMemory = mem;
results.ReadTime = (end - start).TotalSeconds;
results.ReadSpeed = (bufferSize / 1048576) / (end - start).TotalSeconds;
results.ReadSpeed = bufferSize / 1048576 / (end - start).TotalSeconds;
#region Adler32
ctx = new Adler32Context();
@@ -162,7 +162,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion Adler32
@@ -195,7 +195,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion CRC16
@@ -228,7 +228,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion CRC32
@@ -261,7 +261,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion CRC64
@@ -294,7 +294,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion MD5
@@ -327,7 +327,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion RIPEMD160
@@ -360,7 +360,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion SHA1
@@ -393,7 +393,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion SHA256
@@ -426,7 +426,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion SHA384
@@ -459,7 +459,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion SHA512
@@ -492,7 +492,7 @@ namespace DiscImageChef.Core
new BenchmarkEntry()
{
TimeSpan = (end - start).TotalSeconds,
Speed = (bufferSize / 1048576) / (end - start).TotalSeconds
Speed = bufferSize / 1048576 / (end - start).TotalSeconds
});
results.SeparateTime += (end - start).TotalSeconds;
#endregion SpamSum
@@ -529,7 +529,7 @@ namespace DiscImageChef.Core
if(mem < results.MinMemory) results.MinMemory = mem;
results.EntropyTime = (end - start).TotalSeconds;
results.EntropySpeed = (bufferSize / 1048576) / (end - start).TotalSeconds;
results.EntropySpeed = bufferSize / 1048576 / (end - start).TotalSeconds;
#endregion Entropy
#region Multitasking
@@ -555,10 +555,10 @@ namespace DiscImageChef.Core
if(mem < results.MinMemory) results.MinMemory = mem;
results.TotalTime = (end - start).TotalSeconds;
results.TotalSpeed = (bufferSize / 1048576) / results.TotalTime;
results.TotalSpeed = bufferSize / 1048576 / results.TotalTime;
#endregion
results.SeparateSpeed = (bufferSize / 1048576) / results.SeparateTime;
results.SeparateSpeed = bufferSize / 1048576 / results.SeparateTime;
return results;
}

View File

@@ -216,10 +216,10 @@ namespace DiscImageChef.Core.Devices.Dumping
dumpLog.WriteLine("Device reports {0} bytes per logical block.", blockSize);
dumpLog.WriteLine("Device reports {0} bytes per physical block.", physicalsectorsize);
bool removable = false || (!dev.IsCompactFlash &&
ataId.GeneralConfiguration.HasFlag(Decoders.ATA.Identify
.GeneralConfigurationBit
.Removable));
bool removable = false || !dev.IsCompactFlash &&
ataId.GeneralConfiguration.HasFlag(Decoders.ATA.Identify
.GeneralConfigurationBit
.Removable);
DumpHardwareType currentTry = null;
ExtentsULong extents = null;
ResumeSupport.Process(ataReader.IsLba, removable, blocks, dev.Manufacturer, dev.Model, dev.Serial,
@@ -248,7 +248,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if((blocks - i) < blocksToRead) blocksToRead = (byte)(blocks - i);
if(blocks - i < blocksToRead) blocksToRead = (byte)(blocks - i);
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
if(currentSpeed > maxSpeed && currentSpeed != 0) maxSpeed = currentSpeed;
@@ -279,7 +279,7 @@ namespace DiscImageChef.Core.Devices.Dumping
}
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (duration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (duration / (double)1000);
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
GC.Collect();
resume.NextBlock = i + blocksToRead;
@@ -290,12 +290,12 @@ namespace DiscImageChef.Core.Devices.Dumping
mhddLog.Close();
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000),
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000),
devicePath);
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000));
#region Error handling
if(resume.BadBlocks.Count > 0 && !aborted)
@@ -401,7 +401,7 @@ namespace DiscImageChef.Core.Devices.Dumping
}
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
currentSpeed = ((double)blockSize / (double)1048576) / (duration / (double)1000);
currentSpeed = (double)blockSize / (double)1048576 / (duration / (double)1000);
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
GC.Collect();
@@ -415,12 +415,12 @@ namespace DiscImageChef.Core.Devices.Dumping
mhddLog.Close();
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000),
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000),
devicePath);
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000));
}
dataChk = new Checksum();
@@ -436,7 +436,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if((blocks - i) < blocksToRead) blocksToRead = (byte)(blocks - i);
if(blocks - i < blocksToRead) blocksToRead = (byte)(blocks - i);
DicConsole.Write("\rChecksumming sector {0} of {1} ({2:F3} MiB/sec.)", i, blocks, currentSpeed);
@@ -449,7 +449,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double chkDuration = (chkEnd - chkStart).TotalMilliseconds;
totalChkDuration += chkDuration;
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (chkDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (chkDuration / (double)1000);
}
DicConsole.WriteLine();
@@ -457,7 +457,7 @@ namespace DiscImageChef.Core.Devices.Dumping
end = DateTime.UtcNow;
dumpLog.WriteLine("Checksum finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average checksum speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalChkDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
PluginBase plugins = new PluginBase();
plugins.RegisterAllPlugins(encoding);
@@ -606,7 +606,7 @@ namespace DiscImageChef.Core.Devices.Dumping
DicConsole.WriteLine("Took a total of {0:F3} seconds ({1:F3} processing commands, {2:F3} checksumming).",
(end - start).TotalSeconds, totalDuration / 1000, totalChkDuration / 1000);
DicConsole.WriteLine("Avegare speed: {0:F3} MiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1048576) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1048576 / (totalDuration / 1000));
DicConsole.WriteLine("Fastest speed burst: {0:F3} MiB/sec.", maxSpeed);
DicConsole.WriteLine("Slowest speed burst: {0:F3} MiB/sec.", minSpeed);
DicConsole.WriteLine("{0} sectors could not be read.", resume.BadBlocks.Count);

View File

@@ -191,7 +191,7 @@ namespace DiscImageChef.Core.Devices.Dumping
AlcoholSession[] sessionsArray = sessions.ToArray();
for(int i = 0; i < sessionsArray.Length; i++)
{
sessionsArray[i].allBlocks = (byte)(((sessionsArray[i].lastTrack - sessionsArray[i].firstTrack) + 1) +
sessionsArray[i].allBlocks = (byte)(sessionsArray[i].lastTrack - sessionsArray[i].firstTrack + 1 +
sessionsArray[i].nonTrackBlocks);
sessionsArray[i].trackOffset = (uint)nextOffset;
nextOffset += sessionsArray[i].allBlocks * 80;

View File

@@ -466,7 +466,7 @@ namespace DiscImageChef.Core.Devices.Dumping
}
#pragma warning disable IDE0004 // Remove Unnecessary Cast
currentSpeed = ((double)blockSize / (double)1048576) / (cmdDuration / (double)1000);
currentSpeed = (double)blockSize / (double)1048576 / (cmdDuration / (double)1000);
#pragma warning restore IDE0004 // Remove Unnecessary Cast
}
@@ -562,7 +562,7 @@ namespace DiscImageChef.Core.Devices.Dumping
}
alcohol.SetTrackSizes((byte)(t + 1), sectorSize, tracks[t].StartSector, dumpFile.Position,
(tracks[t].EndSector - tracks[t].StartSector + 1));
tracks[t].EndSector - tracks[t].StartSector + 1);
bool checkedDataFormat = false;
@@ -577,7 +577,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double cmdDuration = 0;
if(((ulong)tracks[t].EndSector + 1 - i) < blocksToRead)
if((ulong)tracks[t].EndSector + 1 - i < blocksToRead)
blocksToRead = (uint)((ulong)tracks[t].EndSector + 1 - i);
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
@@ -664,7 +664,7 @@ namespace DiscImageChef.Core.Devices.Dumping
}
#pragma warning disable IDE0004 // Remove Unnecessary Cast
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (cmdDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000);
#pragma warning restore IDE0004 // Remove Unnecessary Cast
resume.NextBlock = i + blocksToRead;
}
@@ -708,11 +708,11 @@ namespace DiscImageChef.Core.Devices.Dumping
mhddLog.Close();
#pragma warning disable IDE0004 // Remove Unnecessary Cast
ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000), devicePath);
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath);
#pragma warning restore IDE0004 // Remove Unnecessary Cast
dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000));
#region Compact Disc Error handling
if(resume.BadBlocks.Count > 0 && !aborted)
@@ -746,7 +746,7 @@ namespace DiscImageChef.Core.Devices.Dumping
totalDuration += cmdDuration;
}
if((!sense && !dev.Error) || runningPersistent)
if(!sense && !dev.Error || runningPersistent)
{
if(!sense && !dev.Error)
{
@@ -862,7 +862,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if(((ulong)tracks[t].EndSector + 1 - i) < blocksToRead)
if((ulong)tracks[t].EndSector + 1 - i < blocksToRead)
blocksToRead = (uint)((ulong)tracks[t].EndSector + 1 - i);
DicConsole.Write("\rChecksumming sector {0} of {1} at track {3} ({2:F3} MiB/sec.)", i, blocks,
@@ -896,7 +896,7 @@ namespace DiscImageChef.Core.Devices.Dumping
totalChkDuration += chkDuration;
#pragma warning disable IDE0004 // Remove Unnecessary Cast
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (chkDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (chkDuration / (double)1000);
#pragma warning restore IDE0004 // Remove Unnecessary Cast
}
@@ -910,7 +910,7 @@ namespace DiscImageChef.Core.Devices.Dumping
end = DateTime.UtcNow;
dumpLog.WriteLine("Checksum finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average checksum speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalChkDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
// TODO: Correct this
sidecar.OpticalDisc[0].Checksums = dataChk.End().ToArray();

View File

@@ -308,8 +308,8 @@ namespace DiscImageChef.Core.Devices.Dumping
sense = dev.ScsiInquiry(out byte[] inqBuf, out senseBuf);
if(sense || !Decoders.SCSI.Inquiry.Decode(inqBuf).HasValue ||
(Decoders.SCSI.Inquiry.Decode(inqBuf).HasValue &&
!Decoders.SCSI.Inquiry.Decode(inqBuf).Value.KreonPresent))
Decoders.SCSI.Inquiry.Decode(inqBuf).HasValue &&
!Decoders.SCSI.Inquiry.Decode(inqBuf).Value.KreonPresent)
{
dumpLog.WriteLine("Dumping Xbox Game Discs requires a drive with Kreon firmware.");
throw new

View File

@@ -372,7 +372,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if((blocks - i) < blocksToRead) blocksToRead = (uint)(blocks - i);
if(blocks - i < blocksToRead) blocksToRead = (uint)(blocks - i);
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
if(currentSpeed > maxSpeed && currentSpeed != 0) maxSpeed = currentSpeed;
@@ -410,7 +410,7 @@ namespace DiscImageChef.Core.Devices.Dumping
}
#pragma warning disable IDE0004 // Remove Unnecessary Cast
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (cmdDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000);
#pragma warning restore IDE0004 // Remove Unnecessary Cast
resume.NextBlock = i + blocksToRead;
}
@@ -420,11 +420,11 @@ namespace DiscImageChef.Core.Devices.Dumping
mhddLog.Close();
#pragma warning disable IDE0004 // Remove Unnecessary Cast
ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000), devicePath);
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath);
#pragma warning restore IDE0004 // Remove Unnecessary Cast
dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000));
#region Error handling
if(resume.BadBlocks.Count > 0 && !aborted)
@@ -592,7 +592,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if((blocks - i) < blocksToRead) blocksToRead = (uint)(blocks - i);
if(blocks - i < blocksToRead) blocksToRead = (uint)(blocks - i);
DicConsole.Write("\rChecksumming sector {0} of {1} ({2:F3} MiB/sec.)", i, blocks, currentSpeed);
@@ -606,7 +606,7 @@ namespace DiscImageChef.Core.Devices.Dumping
totalChkDuration += chkDuration;
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (chkDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (chkDuration / (double)1000);
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
}
@@ -615,7 +615,7 @@ namespace DiscImageChef.Core.Devices.Dumping
end = DateTime.UtcNow;
dumpLog.WriteLine("Checksum finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average checksum speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalChkDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
PluginBase plugins = new PluginBase();
plugins.RegisterAllPlugins(encoding);
@@ -844,7 +844,7 @@ namespace DiscImageChef.Core.Devices.Dumping
(end - start).TotalSeconds, totalDuration / 1000, totalChkDuration / 1000);
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
DicConsole.WriteLine("Avegare speed: {0:F3} MiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1048576) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1048576 / (totalDuration / 1000));
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
DicConsole.WriteLine("Fastest speed burst: {0:F3} MiB/sec.", maxSpeed);
DicConsole.WriteLine("Slowest speed burst: {0:F3} MiB/sec.", minSpeed);

View File

@@ -101,7 +101,7 @@ namespace DiscImageChef.Core.Devices.Dumping
fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense);
// And yet, did not rewind!
if(fxSense.HasValue && ((fxSense.Value.ASC == 0x00 && fxSense.Value.ASCQ != 0x04) ||
if(fxSense.HasValue && (fxSense.Value.ASC == 0x00 && fxSense.Value.ASCQ != 0x04 ||
fxSense.Value.ASC != 0x00))
{
DicConsole.WriteLine();
@@ -126,7 +126,7 @@ namespace DiscImageChef.Core.Devices.Dumping
// Anyway, <=SCSI-1 tapes do not support partitions
fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense);
if(fxSense.HasValue && ((fxSense.Value.ASC == 0x20 && fxSense.Value.ASCQ != 0x00) ||
if(fxSense.HasValue && (fxSense.Value.ASC == 0x20 && fxSense.Value.ASCQ != 0x00 ||
fxSense.Value.ASC != 0x20 && fxSense.Value.SenseKey !=
Decoders.SCSI.SenseKeys.IllegalRequest))
{
@@ -171,7 +171,7 @@ namespace DiscImageChef.Core.Devices.Dumping
(fxSense.Value.ASCQ == 0x1A || fxSense.Value.ASCQ == 0x19));
// And yet, did not rewind!
if(fxSense.HasValue && ((fxSense.Value.ASC == 0x00 && fxSense.Value.ASCQ != 0x04) ||
if(fxSense.HasValue && (fxSense.Value.ASC == 0x00 && fxSense.Value.ASCQ != 0x04 ||
fxSense.Value.ASC != 0x00))
{
DicConsole.WriteLine();
@@ -616,7 +616,7 @@ namespace DiscImageChef.Core.Devices.Dumping
totalChkDuration += chkDuration;
if(currentBlock % 10 == 0)
currentSpeed = ((double)blockSize / (double)1048576) / (duration / (double)1000);
currentSpeed = (double)blockSize / (double)1048576 / (duration / (double)1000);
currentBlock++;
currentSize += blockSize;
currentFileSize += blockSize;
@@ -628,18 +628,18 @@ namespace DiscImageChef.Core.Devices.Dumping
end = DateTime.UtcNow;
mhddLog.Close();
ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000), devicePath);
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath);
dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000));
dumpLog.WriteLine("Average checksum speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalChkDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
DicConsole.WriteLine("Took a total of {0:F3} seconds ({1:F3} processing commands, {2:F3} checksumming).",
(end - start).TotalSeconds, totalDuration / 1000, totalChkDuration / 1000);
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
DicConsole.WriteLine("Avegare speed: {0:F3} MiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1048576) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1048576 / (totalDuration / 1000));
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
DicConsole.WriteLine("Fastest speed burst: {0:F3} MiB/sec.", maxSpeed);
DicConsole.WriteLine("Slowest speed burst: {0:F3} MiB/sec.", minSpeed);
@@ -656,7 +656,7 @@ namespace DiscImageChef.Core.Devices.Dumping
Value = outputPrefix + ".bin"
};
sidecar.BlockMedia[0].LogicalBlocks = (long)blocks;
sidecar.BlockMedia[0].Size = (long)(currentSize);
sidecar.BlockMedia[0].Size = (long)currentSize;
sidecar.BlockMedia[0].DumpHardwareArray = new DumpHardwareType[1];
sidecar.BlockMedia[0].DumpHardwareArray[0] = new DumpHardwareType {Extents = new ExtentType[1]};
sidecar.BlockMedia[0].DumpHardwareArray[0].Extents[0] = new ExtentType {Start = 0, End = blocks - 1};

View File

@@ -306,7 +306,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if((blocks - i) < blocksToRead) blocksToRead = (byte)(blocks - i);
if(blocks - i < blocksToRead) blocksToRead = (byte)(blocks - i);
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
if(currentSpeed > maxSpeed && currentSpeed != 0) maxSpeed = currentSpeed;
@@ -338,7 +338,7 @@ namespace DiscImageChef.Core.Devices.Dumping
}
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (duration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (duration / (double)1000);
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
GC.Collect();
resume.NextBlock = i + blocksToRead;
@@ -349,11 +349,11 @@ namespace DiscImageChef.Core.Devices.Dumping
mhddLog.Close();
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000), devicePath);
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath);
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000));
#region Error handling
if(resume.BadBlocks.Count > 0 && !aborted)
@@ -420,7 +420,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if((blocks - i) < blocksToRead) blocksToRead = (byte)(blocks - i);
if(blocks - i < blocksToRead) blocksToRead = (byte)(blocks - i);
DicConsole.Write("\rChecksumming sector {0} of {1} ({2:F3} MiB/sec.)", i, blocks, currentSpeed);
@@ -433,7 +433,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double chkDuration = (chkEnd - chkStart).TotalMilliseconds;
totalChkDuration += chkDuration;
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (chkDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (chkDuration / (double)1000);
}
DicConsole.WriteLine();
@@ -441,7 +441,7 @@ namespace DiscImageChef.Core.Devices.Dumping
end = DateTime.UtcNow;
dumpLog.WriteLine("Checksum finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average checksum speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalChkDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
PluginBase plugins = new PluginBase();
plugins.RegisterAllPlugins(encoding);
@@ -582,7 +582,7 @@ namespace DiscImageChef.Core.Devices.Dumping
DicConsole.WriteLine("Took a total of {0:F3} seconds ({1:F3} processing commands, {2:F3} checksumming).",
(end - start).TotalSeconds, totalDuration / 1000, totalChkDuration / 1000);
DicConsole.WriteLine("Avegare speed: {0:F3} MiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1048576) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1048576 / (totalDuration / 1000));
DicConsole.WriteLine("Fastest speed burst: {0:F3} MiB/sec.", maxSpeed);
DicConsole.WriteLine("Slowest speed burst: {0:F3} MiB/sec.", minSpeed);
DicConsole.WriteLine("{0} sectors could not be read.", resume.BadBlocks.Count);

View File

@@ -134,7 +134,7 @@ namespace DiscImageChef.Core.Devices.Dumping
return;
}
totalSize = (ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + (readBuffer[3]));
totalSize = (ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + readBuffer[3]);
dumpLog.WriteLine("Reading Physical Format Information.");
sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
MmcDiscStructureFormat.PhysicalInformation, 0, 0, out duration);
@@ -198,7 +198,7 @@ namespace DiscImageChef.Core.Devices.Dumping
return;
}
gameSize = (ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + (readBuffer[3])) +
gameSize = (ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + readBuffer[3]) +
1;
DicConsole.DebugWriteLine("Dump-media command", "Game partition total size: {0} sectors", gameSize);
@@ -222,7 +222,7 @@ namespace DiscImageChef.Core.Devices.Dumping
return;
}
totalSize = (ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + (readBuffer[3]));
totalSize = (ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + readBuffer[3]);
dumpLog.WriteLine("Reading Physical Format Information.");
sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
MmcDiscStructureFormat.PhysicalInformation, 0, 0, out duration);
@@ -389,7 +389,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if((extentStart - i) < blocksToRead) blocksToRead = (uint)(extentStart - i);
if(extentStart - i < blocksToRead) blocksToRead = (uint)(extentStart - i);
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
if(currentSpeed > maxSpeed && currentSpeed != 0) maxSpeed = currentSpeed;
@@ -435,7 +435,7 @@ namespace DiscImageChef.Core.Devices.Dumping
}
#pragma warning disable IDE0004 // Remove Unnecessary Cast
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (cmdDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000);
#pragma warning restore IDE0004 // Remove Unnecessary Cast
blocksToRead = saveBlocksToRead;
currentSector = i + 1;
@@ -452,7 +452,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if((extentEnd - i) < blocksToRead) blocksToRead = (uint)(extentEnd - i) + 1;
if(extentEnd - i < blocksToRead) blocksToRead = (uint)(extentEnd - i) + 1;
mhddLog.Write(i, cmdDuration);
ibgLog.Write(i, currentSpeed * 1024);
@@ -468,7 +468,7 @@ namespace DiscImageChef.Core.Devices.Dumping
// Middle Zone D
dumpLog.WriteLine("Writing Middle Zone D (empty).");
for(ulong middle = currentSector - blocks - 1; middle < (middleZone - 1); middle += blocksToRead)
for(ulong middle = currentSector - blocks - 1; middle < middleZone - 1; middle += blocksToRead)
{
if(aborted)
{
@@ -477,7 +477,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if(((middleZone - 1) - middle) < blocksToRead) blocksToRead = (uint)((middleZone - 1) - middle);
if(middleZone - 1 - middle < blocksToRead) blocksToRead = (uint)(middleZone - 1 - middle);
DicConsole.Write("\rReading sector {0} of {1} ({2:F3} MiB/sec.)", middle + currentSector, totalSize,
currentSpeed);
@@ -511,7 +511,7 @@ namespace DiscImageChef.Core.Devices.Dumping
// Video Layer 1
dumpLog.WriteLine("Reading Video Layer 1.");
for(ulong l1 = currentSector - blocks - middleZone + l0Video; l1 < (l0Video + l1Video); l1 += blocksToRead)
for(ulong l1 = currentSector - blocks - middleZone + l0Video; l1 < l0Video + l1Video; l1 += blocksToRead)
{
if(aborted)
{
@@ -520,7 +520,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if(((l0Video + l1Video) - l1) < blocksToRead) blocksToRead = (uint)((l0Video + l1Video) - l1);
if(l0Video + l1Video - l1 < blocksToRead) blocksToRead = (uint)(l0Video + l1Video - l1);
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
if(currentSpeed > maxSpeed && currentSpeed != 0) maxSpeed = currentSpeed;
@@ -566,7 +566,7 @@ namespace DiscImageChef.Core.Devices.Dumping
}
#pragma warning disable IDE0004 // Remove Unnecessary Cast
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (cmdDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000);
#pragma warning restore IDE0004 // Remove Unnecessary Cast
currentSector += blocksToRead;
resume.NextBlock = currentSector;
@@ -593,11 +593,11 @@ namespace DiscImageChef.Core.Devices.Dumping
mhddLog.Close();
#pragma warning disable IDE0004 // Remove Unnecessary Cast
ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000), devicePath);
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath);
#pragma warning restore IDE0004 // Remove Unnecessary Cast
dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000));
#region Error handling
if(resume.BadBlocks.Count > 0 && !aborted)
@@ -778,7 +778,7 @@ namespace DiscImageChef.Core.Devices.Dumping
break;
}
if((blocks - i) < blocksToRead) blocksToRead = (uint)(blocks - i);
if(blocks - i < blocksToRead) blocksToRead = (uint)(blocks - i);
DicConsole.Write("\rChecksumming sector {0} of {1} ({2:F3} MiB/sec.)", i, blocks, currentSpeed);
@@ -792,7 +792,7 @@ namespace DiscImageChef.Core.Devices.Dumping
totalChkDuration += chkDuration;
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (chkDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (chkDuration / (double)1000);
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
}
@@ -801,7 +801,7 @@ namespace DiscImageChef.Core.Devices.Dumping
end = DateTime.UtcNow;
dumpLog.WriteLine("Checksum finished in {0} seconds.", (end - start).TotalSeconds);
dumpLog.WriteLine("Average checksum speed {0:F3} KiB/sec.",
(((double)blockSize * (double)(blocks + 1)) / 1024) / (totalChkDuration / 1000));
(double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000));
PluginBase plugins = new PluginBase();
plugins.RegisterAllPlugins(encoding);

View File

@@ -86,8 +86,7 @@ namespace DiscImageChef.Core.Devices
blocks = (ulong)(cylinders * heads * sectors);
}
if((ataId.CurrentCylinders == 0 || ataId.CurrentHeads == 0 || ataId.CurrentSectorsPerTrack == 0) &&
(ataId.Cylinders > 0 && ataId.Heads > 0 && ataId.SectorsPerTrack > 0))
if((ataId.CurrentCylinders == 0 || ataId.CurrentHeads == 0 || ataId.CurrentSectorsPerTrack == 0) && ataId.Cylinders > 0 && ataId.Heads > 0 && ataId.SectorsPerTrack > 0)
{
cylinders = ataId.Cylinders;
heads = (byte)ataId.Heads;
@@ -127,32 +126,32 @@ namespace DiscImageChef.Core.Devices
double duration;
sense = dev.Read(out cmdBuf, out errorChs, false, 0, 0, 1, 1, timeout, out duration);
ataRead = (!sense && (errorChs.status & 0x27) == 0 && errorChs.error == 0 && cmdBuf.Length > 0);
ataRead = !sense && (errorChs.status & 0x27) == 0 && errorChs.error == 0 && cmdBuf.Length > 0;
sense = dev.Read(out cmdBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration);
ataReadRetry = (!sense && (errorChs.status & 0x27) == 0 && errorChs.error == 0 && cmdBuf.Length > 0);
ataReadRetry = !sense && (errorChs.status & 0x27) == 0 && errorChs.error == 0 && cmdBuf.Length > 0;
sense = dev.ReadDma(out cmdBuf, out errorChs, false, 0, 0, 1, 1, timeout, out duration);
ataReadDma = (!sense && (errorChs.status & 0x27) == 0 && errorChs.error == 0 && cmdBuf.Length > 0);
ataReadDma = !sense && (errorChs.status & 0x27) == 0 && errorChs.error == 0 && cmdBuf.Length > 0;
sense = dev.ReadDma(out cmdBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration);
ataReadDmaRetry = (!sense && (errorChs.status & 0x27) == 0 && errorChs.error == 0 && cmdBuf.Length > 0);
ataReadDmaRetry = !sense && (errorChs.status & 0x27) == 0 && errorChs.error == 0 && cmdBuf.Length > 0;
sense = dev.Read(out cmdBuf, out errorLba, false, 0, 1, timeout, out duration);
ataReadLba = (!sense && (errorLba.status & 0x27) == 0 && errorLba.error == 0 && cmdBuf.Length > 0);
ataReadLba = !sense && (errorLba.status & 0x27) == 0 && errorLba.error == 0 && cmdBuf.Length > 0;
sense = dev.Read(out cmdBuf, out errorLba, true, 0, 1, timeout, out duration);
ataReadRetryLba = (!sense && (errorLba.status & 0x27) == 0 && errorLba.error == 0 && cmdBuf.Length > 0);
ataReadRetryLba = !sense && (errorLba.status & 0x27) == 0 && errorLba.error == 0 && cmdBuf.Length > 0;
sense = dev.ReadDma(out cmdBuf, out errorLba, false, 0, 1, timeout, out duration);
ataReadDmaLba = (!sense && (errorLba.status & 0x27) == 0 && errorLba.error == 0 && cmdBuf.Length > 0);
ataReadDmaLba = !sense && (errorLba.status & 0x27) == 0 && errorLba.error == 0 && cmdBuf.Length > 0;
sense = dev.ReadDma(out cmdBuf, out errorLba, true, 0, 1, timeout, out duration);
ataReadDmaRetryLba = (!sense && (errorLba.status & 0x27) == 0 && errorLba.error == 0 && cmdBuf.Length > 0);
ataReadDmaRetryLba = !sense && (errorLba.status & 0x27) == 0 && errorLba.error == 0 && cmdBuf.Length > 0;
sense = dev.Read(out cmdBuf, out errorLba48, 0, 1, timeout, out duration);
ataReadLba48 = (!sense && (errorLba48.status & 0x27) == 0 && errorLba48.error == 0 && cmdBuf.Length > 0);
ataReadLba48 = !sense && (errorLba48.status & 0x27) == 0 && errorLba48.error == 0 && cmdBuf.Length > 0;
sense = dev.ReadDma(out cmdBuf, out errorLba48, 0, 1, timeout, out duration);
ataReadDmaLba48 = (!sense && (errorLba48.status & 0x27) == 0 && errorLba48.error == 0 && cmdBuf.Length > 0);
ataReadDmaLba48 = !sense && (errorLba48.status & 0x27) == 0 && errorLba48.error == 0 && cmdBuf.Length > 0;
sense = dev.Seek(out errorChs, 0, 0, 1, timeout, out duration);
ataSeek = (!sense && (errorChs.status & 0x27) == 0 && errorChs.error == 0);
ataSeek = !sense && (errorChs.status & 0x27) == 0 && errorChs.error == 0;
sense = dev.Seek(out errorLba, 0, timeout, out duration);
ataSeekLba = (!sense && (errorLba.status & 0x27) == 0 && errorChs.error == 0);
ataSeekLba = !sense && (errorLba.status & 0x27) == 0 && errorChs.error == 0;
if(lbaMode)
{

View File

@@ -84,7 +84,7 @@ namespace DiscImageChef.Core.Devices
return true;
}
if(read6 && !read10 && !read12 && !read16 && blocks > (0x001FFFFF + 1))
if(read6 && !read10 && !read12 && !read16 && blocks > 0x001FFFFF + 1)
{
errorMessage =
string.Format("Device only supports SCSI READ (6) but has more than {0} blocks ({1} blocks total)",
@@ -93,7 +93,7 @@ namespace DiscImageChef.Core.Devices
}
#pragma warning disable IDE0004 // Remove Unnecessary Cast
if(!read16 && blocks > ((long)0xFFFFFFFF + (long)1))
if(!read16 && blocks > (long)0xFFFFFFFF + (long)1)
#pragma warning restore IDE0004 // Remove Unnecessary Cast
{
#pragma warning disable IDE0004 // Remove Unnecessary Cast
@@ -406,8 +406,8 @@ namespace DiscImageChef.Core.Devices
sense = dev.ReadCapacity(out cmdBuf, out senseBuf, timeout, out duration);
if(!sense)
{
blocks = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + (cmdBuf[3]));
blockSize = (uint)((cmdBuf[5] << 24) + (cmdBuf[5] << 16) + (cmdBuf[6] << 8) + (cmdBuf[7]));
blocks = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + cmdBuf[3]);
blockSize = (uint)((cmdBuf[5] << 24) + (cmdBuf[5] << 16) + (cmdBuf[6] << 8) + cmdBuf[7]);
}
if(sense || blocks == 0xFFFFFFFF)
@@ -433,7 +433,7 @@ namespace DiscImageChef.Core.Devices
Array.Copy(cmdBuf, 0, temp, 0, 8);
Array.Reverse(temp);
blocks = BitConverter.ToUInt64(temp, 0);
blockSize = (uint)((cmdBuf[5] << 24) + (cmdBuf[5] << 16) + (cmdBuf[6] << 8) + (cmdBuf[7]));
blockSize = (uint)((cmdBuf[5] << 24) + (cmdBuf[5] << 16) + (cmdBuf[6] << 8) + cmdBuf[7]);
}
}

View File

@@ -690,8 +690,8 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ SECTOR(S) in CHS mode...");
sense = dev.Read(out readBuf, out errorChs, false, 0, 0, 1, 1, timeout, out duration);
mediaTest.SupportsRead =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -703,8 +703,8 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode...");
sense = dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration);
mediaTest.SupportsReadRetry =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -717,8 +717,8 @@ namespace DiscImageChef.Core.Devices.Report
sense = dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, timeout,
out duration);
mediaTest.SupportsReadDma =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -730,8 +730,8 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode...");
sense = dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration);
mediaTest.SupportsReadDmaRetry =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -743,7 +743,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying SEEK in CHS mode...");
sense = dev.Seek(out errorChs, 0, 0, 1, timeout, out duration);
mediaTest.SupportsSeek =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense,
errorChs.status, errorChs.error);
@@ -751,8 +751,8 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ SECTOR(S) in LBA mode...");
sense = dev.Read(out readBuf, out errorLba, false, 0, 1, timeout, out duration);
mediaTest.SupportsReadLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -764,8 +764,8 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode...");
sense = dev.Read(out readBuf, out errorLba, true, 0, 1, timeout, out duration);
mediaTest.SupportsReadRetryLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -777,8 +777,8 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ DMA in LBA mode...");
sense = dev.ReadDma(out readBuf, out errorLba, false, 0, 1, timeout, out duration);
mediaTest.SupportsReadDmaLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -790,8 +790,8 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode...");
sense = dev.ReadDma(out readBuf, out errorLba, true, 0, 1, timeout, out duration);
mediaTest.SupportsReadDmaRetryLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -803,7 +803,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying SEEK in LBA mode...");
sense = dev.Seek(out errorLba, 0, timeout, out duration);
mediaTest.SupportsSeekLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense,
errorChs.status, errorChs.error);
@@ -811,8 +811,8 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ SECTOR(S) in LBA48 mode...");
sense = dev.Read(out readBuf, out errorLba48, 0, 1, timeout, out duration);
mediaTest.SupportsReadLba48 =
(!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 &&
readBuf.Length > 0);
!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 &&
readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -824,8 +824,8 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ DMA in LBA48 mode...");
sense = dev.ReadDma(out readBuf, out errorLba48, 0, 1, timeout, out duration);
mediaTest.SupportsReadDmaLba48 =
(!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 &&
readBuf.Length > 0);
!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 &&
readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -838,8 +838,8 @@ namespace DiscImageChef.Core.Devices.Report
sense = dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1, mediaTest.LongBlockSize,
timeout, out duration);
mediaTest.SupportsReadLong =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -852,8 +852,8 @@ namespace DiscImageChef.Core.Devices.Report
sense = dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1, mediaTest.LongBlockSize,
timeout, out duration);
mediaTest.SupportsReadLongRetry =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -866,8 +866,8 @@ namespace DiscImageChef.Core.Devices.Report
sense = dev.ReadLong(out readBuf, out errorLba, false, 0, mediaTest.LongBlockSize,
timeout, out duration);
mediaTest.SupportsReadLongLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -880,8 +880,8 @@ namespace DiscImageChef.Core.Devices.Report
sense = dev.ReadLong(out readBuf, out errorLba, true, 0, mediaTest.LongBlockSize,
timeout, out duration);
mediaTest.SupportsReadLongRetryLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorChs.status, errorChs.error, readBuf.Length);
@@ -1065,7 +1065,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ SECTOR(S) in CHS mode...");
sense = dev.Read(out readBuf, out errorChs, false, 0, 0, 1, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsRead =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorChs.status, errorChs.error, readBuf.Length);
@@ -1076,7 +1076,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode...");
sense = dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadRetry =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorChs.status, errorChs.error, readBuf.Length);
@@ -1087,7 +1087,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ DMA in CHS mode...");
sense = dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadDma =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorChs.status, errorChs.error, readBuf.Length);
@@ -1098,7 +1098,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode...");
sense = dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadDmaRetry =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorChs.status, errorChs.error, readBuf.Length);
@@ -1109,14 +1109,14 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying SEEK in CHS mode...");
sense = dev.Seek(out errorChs, 0, 0, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsSeek =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense,
errorChs.status, errorChs.error);
DicConsole.WriteLine("Trying READ SECTOR(S) in LBA mode...");
sense = dev.Read(out readBuf, out errorLba, false, 0, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorLba.status, errorLba.error, readBuf.Length);
@@ -1127,7 +1127,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode...");
sense = dev.Read(out readBuf, out errorLba, true, 0, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadRetryLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorLba.status, errorLba.error, readBuf.Length);
@@ -1138,7 +1138,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ DMA in LBA mode...");
sense = dev.ReadDma(out readBuf, out errorLba, false, 0, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadDmaLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorLba.status, errorLba.error, readBuf.Length);
@@ -1149,7 +1149,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode...");
sense = dev.ReadDma(out readBuf, out errorLba, true, 0, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadDmaRetryLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorLba.status, errorLba.error, readBuf.Length);
@@ -1160,14 +1160,14 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying SEEK in LBA mode...");
sense = dev.Seek(out errorLba, 0, timeout, out duration);
report.ATA.ReadCapabilities.SupportsSeekLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense,
errorLba.status, errorLba.error);
DicConsole.WriteLine("Trying READ SECTOR(S) in LBA48 mode...");
sense = dev.Read(out readBuf, out errorLba48, 0, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadLba48 =
(!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 && readBuf.Length > 0);
!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorLba48.status, errorLba48.error, readBuf.Length);
@@ -1178,7 +1178,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.WriteLine("Trying READ DMA in LBA48 mode...");
sense = dev.ReadDma(out readBuf, out errorLba48, 0, 1, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadDmaLba48 =
(!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 && readBuf.Length > 0);
!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorLba48.status, errorLba48.error, readBuf.Length);
@@ -1190,8 +1190,8 @@ namespace DiscImageChef.Core.Devices.Report
sense = dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1,
report.ATA.ReadCapabilities.LongBlockSize, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadLong =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorChs.status, errorChs.error, readBuf.Length);
@@ -1203,8 +1203,8 @@ namespace DiscImageChef.Core.Devices.Report
sense = dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1,
report.ATA.ReadCapabilities.LongBlockSize, timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadLongRetry =
(!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead);
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorChs.status, errorChs.error, readBuf.Length);
@@ -1216,8 +1216,8 @@ namespace DiscImageChef.Core.Devices.Report
sense = dev.ReadLong(out readBuf, out errorLba, false, 0, report.ATA.ReadCapabilities.LongBlockSize,
timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadLongLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorLba.status, errorLba.error, readBuf.Length);
@@ -1229,8 +1229,8 @@ namespace DiscImageChef.Core.Devices.Report
sense = dev.ReadLong(out readBuf, out errorLba, true, 0, report.ATA.ReadCapabilities.LongBlockSize,
timeout, out duration);
report.ATA.ReadCapabilities.SupportsReadLongRetryLba =
(!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead);
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
errorLba.status, errorLba.error, readBuf.Length);

View File

@@ -268,7 +268,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
if(!sense && !dev.Error && !decMode.HasValue)
decMode = Decoders.SCSI.Modes.DecodeMode6(mode6Buffer, devType);
report.SCSI.SupportsModeSense6 |= (!sense && !dev.Error);
report.SCSI.SupportsModeSense6 |= !sense && !dev.Error;
Decoders.SCSI.Modes.ModePage_2A? cdromMode = null;
@@ -408,9 +408,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
mediaTest.SupportsReadCapacity = true;
mediaTest.Blocks =
(ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) +
(buffer[3])) + 1;
buffer[3]) + 1;
mediaTest.BlockSize =
(uint)((buffer[4] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + (buffer[7]));
(uint)((buffer[4] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + buffer[7]);
mediaTest.BlocksSpecified = true;
mediaTest.BlockSizeSpecified = true;
}
@@ -426,7 +426,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
mediaTest.Blocks = BitConverter.ToUInt64(temp, 0) + 1;
mediaTest.BlockSize =
(uint)((buffer[8] << 24) + (buffer[9] << 16) + (buffer[10] << 8) +
(buffer[11]));
buffer[11]);
mediaTest.BlocksSpecified = true;
mediaTest.BlockSizeSpecified = true;
}
@@ -685,9 +685,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
{
report.SCSI.ReadCapabilities.SupportsReadCapacity = true;
report.SCSI.ReadCapabilities.Blocks =
(ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + (buffer[3])) + 1;
(ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3]) + 1;
report.SCSI.ReadCapabilities.BlockSize =
(uint)((buffer[4] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + (buffer[7]));
(uint)((buffer[4] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + buffer[7]);
report.SCSI.ReadCapabilities.BlocksSpecified = true;
report.SCSI.ReadCapabilities.BlockSizeSpecified = true;
}
@@ -702,7 +702,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
Array.Reverse(temp);
report.SCSI.ReadCapabilities.Blocks = BitConverter.ToUInt64(temp, 0) + 1;
report.SCSI.ReadCapabilities.BlockSize =
(uint)((buffer[8] << 24) + (buffer[9] << 16) + (buffer[10] << 8) + (buffer[11]));
(uint)((buffer[8] << 24) + (buffer[9] << 16) + (buffer[10] << 8) + buffer[11]);
report.SCSI.ReadCapabilities.BlocksSpecified = true;
report.SCSI.ReadCapabilities.BlockSizeSpecified = true;
}

View File

@@ -841,9 +841,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
{
mediaTest.SupportsReadCapacity = true;
mediaTest.Blocks =
(ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + (buffer[3])) + 1;
(ulong)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3]) + 1;
mediaTest.BlockSize =
(uint)((buffer[5] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + (buffer[7]));
(uint)((buffer[5] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + buffer[7]);
mediaTest.BlocksSpecified = true;
mediaTest.BlockSizeSpecified = true;
}
@@ -858,7 +858,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
Array.Reverse(temp);
mediaTest.Blocks = BitConverter.ToUInt64(temp, 0) + 1;
mediaTest.BlockSize =
(uint)((buffer[5] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + (buffer[7]));
(uint)((buffer[5] << 24) + (buffer[5] << 16) + (buffer[6] << 8) + buffer[7]);
mediaTest.BlocksSpecified = true;
mediaTest.BlockSizeSpecified = true;
}

View File

@@ -131,7 +131,7 @@ namespace DiscImageChef.Core.Devices.Scanning
{
if(aborted) break;
if((results.Blocks - i) < blocksToRead) blocksToRead = (byte)(results.Blocks - i);
if(results.Blocks - i < blocksToRead) blocksToRead = (byte)(results.Blocks - i);
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
if(currentSpeed > results.MaxSpeed && currentSpeed != 0) results.MaxSpeed = currentSpeed;
@@ -167,7 +167,7 @@ namespace DiscImageChef.Core.Devices.Scanning
}
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (duration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (duration / (double)1000);
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
GC.Collect();
}
@@ -177,7 +177,7 @@ namespace DiscImageChef.Core.Devices.Scanning
mhddLog.Close();
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(results.Blocks + 1)) / 1024) /
(double)blockSize * (double)(results.Blocks + 1) / 1024 /
(results.ProcessingTime / 1000), devicePath);
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
@@ -254,7 +254,7 @@ namespace DiscImageChef.Core.Devices.Scanning
}
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
currentSpeed = ((double)blockSize / (double)1048576) / (duration / (double)1000);
currentSpeed = (double)blockSize / (double)1048576 / (duration / (double)1000);
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
GC.Collect();
@@ -268,7 +268,7 @@ namespace DiscImageChef.Core.Devices.Scanning
mhddLog.Close();
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(results.Blocks + 1)) / 1024) /
(double)blockSize * (double)(results.Blocks + 1) / 1024 /
(results.ProcessingTime / 1000), devicePath);
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
@@ -303,7 +303,7 @@ namespace DiscImageChef.Core.Devices.Scanning
results.ProcessingTime /= 1000;
results.TotalTime = (end - start).TotalSeconds;
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
results.AvgSpeed = (((double)blockSize * (double)(results.Blocks + 1)) / 1048576) /
results.AvgSpeed = (double)blockSize * (double)(results.Blocks + 1) / 1048576 /
results.ProcessingTime;
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
results.SeekTimes = SEEK_TIMES;

View File

@@ -288,7 +288,7 @@ namespace DiscImageChef.Core.Devices.Scanning
double cmdDuration = 0;
if((results.Blocks - i) < blocksToRead) blocksToRead = (uint)(results.Blocks - i);
if(results.Blocks - i < blocksToRead) blocksToRead = (uint)(results.Blocks - i);
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
if(currentSpeed > results.MaxSpeed && currentSpeed != 0) results.MaxSpeed = currentSpeed;
@@ -354,7 +354,7 @@ namespace DiscImageChef.Core.Devices.Scanning
}
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (cmdDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000);
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
GC.Collect();
}
@@ -364,7 +364,7 @@ namespace DiscImageChef.Core.Devices.Scanning
mhddLog.Close();
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(results.Blocks + 1)) / 1024) /
(double)blockSize * (double)(results.Blocks + 1) / 1024 /
(results.ProcessingTime / 1000), devicePath);
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
}
@@ -383,7 +383,7 @@ namespace DiscImageChef.Core.Devices.Scanning
double cmdDuration = 0;
if((results.Blocks - i) < blocksToRead) blocksToRead = (uint)(results.Blocks - i);
if(results.Blocks - i < blocksToRead) blocksToRead = (uint)(results.Blocks - i);
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
if(currentSpeed > results.MaxSpeed && currentSpeed != 0) results.MaxSpeed = currentSpeed;
@@ -419,7 +419,7 @@ namespace DiscImageChef.Core.Devices.Scanning
}
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (cmdDuration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000);
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
}
@@ -428,7 +428,7 @@ namespace DiscImageChef.Core.Devices.Scanning
mhddLog.Close();
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(results.Blocks + 1)) / 1024) /
(double)blockSize * (double)(results.Blocks + 1) / 1024 /
(results.ProcessingTime / 1000), devicePath);
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
}
@@ -469,7 +469,7 @@ namespace DiscImageChef.Core.Devices.Scanning
results.ProcessingTime /= 1000;
results.TotalTime = (end - start).TotalSeconds;
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
results.AvgSpeed = (((double)blockSize * (double)(results.Blocks + 1)) / 1048576) / results.ProcessingTime;
results.AvgSpeed = (double)blockSize * (double)(results.Blocks + 1) / 1048576 / results.ProcessingTime;
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
results.SeekTimes = SEEK_TIMES;

View File

@@ -165,7 +165,7 @@ namespace DiscImageChef.Core.Devices.Scanning
{
if(aborted) break;
if((results.Blocks - i) < blocksToRead) blocksToRead = (byte)(results.Blocks - i);
if(results.Blocks - i < blocksToRead) blocksToRead = (byte)(results.Blocks - i);
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
if(currentSpeed > results.MaxSpeed && currentSpeed != 0) results.MaxSpeed = currentSpeed;
@@ -201,7 +201,7 @@ namespace DiscImageChef.Core.Devices.Scanning
}
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
currentSpeed = ((double)blockSize * blocksToRead / (double)1048576) / (duration / (double)1000);
currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (duration / (double)1000);
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
GC.Collect();
}
@@ -211,7 +211,7 @@ namespace DiscImageChef.Core.Devices.Scanning
mhddLog.Close();
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
(((double)blockSize * (double)(results.Blocks + 1)) / 1024) / (results.ProcessingTime / 1000),
(double)blockSize * (double)(results.Blocks + 1) / 1024 / (results.ProcessingTime / 1000),
devicePath);
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
@@ -240,7 +240,7 @@ namespace DiscImageChef.Core.Devices.Scanning
results.ProcessingTime /= 1000;
results.TotalTime = (end - start).TotalSeconds;
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
results.AvgSpeed = (((double)blockSize * (double)(results.Blocks + 1)) / 1048576) / results.ProcessingTime;
results.AvgSpeed = (double)blockSize * (double)(results.Blocks + 1) / 1048576 / results.ProcessingTime;
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
results.SeekTimes = SEEK_TIMES;

View File

@@ -211,7 +211,7 @@ namespace DiscImageChef.Core.Logging
ibgSb.AppendFormat("{0:0.00},{1},{2:0},0", ibgIntSpeed / ibgSnaps / ibgDivider, ibgIntSector,
ibgSampleRate).AppendLine();
if((ibgIntSpeed / ibgSnaps / ibgDivider) > ibgMaxSpeed) ibgMaxSpeed = ibgIntSpeed / ibgDivider;
if(ibgIntSpeed / ibgSnaps / ibgDivider > ibgMaxSpeed) ibgMaxSpeed = ibgIntSpeed / ibgDivider;
ibgDatePoint = DateTime.Now;
ibgIntSpeed = 0;

View File

@@ -254,7 +254,7 @@ namespace DiscImageChef.Core
{
byte[] sector;
if((sectors - doneSectors) >= sectorsToRead)
if(sectors - doneSectors >= sectorsToRead)
{
sector = image.ReadSectors(doneSectors, sectorsToRead);
UpdateProgress2("Hashings sector {0} of {1}", (long)doneSectors, (long)sectors);
@@ -264,7 +264,7 @@ namespace DiscImageChef.Core
{
sector = image.ReadSectors(doneSectors, (uint)(sectors - doneSectors));
UpdateProgress2("Hashings sector {0} of {1}", (long)doneSectors, (long)sectors);
doneSectors += (sectors - doneSectors);
doneSectors += sectors - doneSectors;
}
contentChkWorker.Update(sector);
@@ -306,7 +306,7 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].FileSystemInformation[i] = new PartitionType
{
Description = partitions[i].Description,
EndSector = (int)(partitions[i].End),
EndSector = (int)partitions[i].End,
Name = partitions[i].Name,
Sequence = (int)partitions[i].Sequence,
StartSector = (int)partitions[i].Start,
@@ -545,8 +545,8 @@ namespace DiscImageChef.Core
try { scpImage.OpenImage(scpFilter); }
catch(NotImplementedException) { }
if((image.ImageInfo.Heads == 2 && scpImage.Header.heads == 0) ||
(image.ImageInfo.Heads == 1 && (scpImage.Header.heads == 1 || scpImage.Header.heads == 2)))
if(image.ImageInfo.Heads == 2 && scpImage.Header.heads == 0 ||
image.ImageInfo.Heads == 1 && (scpImage.Header.heads == 1 || scpImage.Header.heads == 2))
{
if(scpImage.Header.end + 1 >= image.ImageInfo.Cylinders)
{
@@ -577,8 +577,8 @@ namespace DiscImageChef.Core
if(scpImage.Tracks.TryGetValue(t, out SuperCardPro.TrackHeader scpTrack))
{
byte[] trackContents =
new byte[(scpTrack.Entries.Last().dataOffset +
scpTrack.Entries.Last().trackLength) - scpImage.Header.offsets[t] +
new byte[scpTrack.Entries.Last().dataOffset +
scpTrack.Entries.Last().trackLength - scpImage.Header.offsets[t] +
1];
scpStream.Position = scpImage.Header.offsets[t];
scpStream.Read(trackContents, 0, trackContents.Length);

View File

@@ -98,7 +98,7 @@ namespace DiscImageChef.Core
{
byte[] sector;
if((sectors - doneSectors) >= sectorsToRead)
if(sectors - doneSectors >= sectorsToRead)
{
sector = new byte[sectorsToRead * blockSize];
fs.Read(sector, 0, sector.Length);
@@ -112,14 +112,14 @@ namespace DiscImageChef.Core
fs.Read(sector, 0, sector.Length);
UpdateProgress2(string.Format("Hashing block {0} of {1} on file {2} of {3}", doneSectors, sectors, i + 1, files.Count),
doneSectors, sectors);
doneSectors += (sectors - doneSectors);
doneSectors += sectors - doneSectors;
}
fileWorker.Update(sector);
tapeWorker.Update(sector);
}
tapeFile.EndBlock = (tapeFile.StartBlock + sectors) - 1;
tapeFile.EndBlock = tapeFile.StartBlock + sectors - 1;
currentBlock += sectors;
totalSize += fs.Length;
tapeFile.Checksums = fileWorker.End().ToArray();

View File

@@ -351,7 +351,7 @@ namespace DiscImageChef.Core
{
byte[] sector;
if((sectors - doneSectors) >= sectorsToRead)
if(sectors - doneSectors >= sectorsToRead)
{
sector = image.ReadSectorsLong(doneSectors, sectorsToRead,
(uint)xmlTrk.Sequence.TrackNumber);
@@ -365,7 +365,7 @@ namespace DiscImageChef.Core
(uint)xmlTrk.Sequence.TrackNumber);
UpdateProgress2("Hashings sector {0} of {1}", (long)doneSectors,
(long)(trk.TrackEndSector - trk.TrackStartSector + 1));
doneSectors += (sectors - doneSectors);
doneSectors += sectors - doneSectors;
}
trkChkWorker.Update(sector);
@@ -419,7 +419,7 @@ namespace DiscImageChef.Core
{
byte[] sector;
if((sectors - doneSectors) >= sectorsToRead)
if(sectors - doneSectors >= sectorsToRead)
{
sector = image.ReadSectorsTag(doneSectors, sectorsToRead, (uint)xmlTrk.Sequence.TrackNumber,
SectorTagType.CdSectorSubchannel);
@@ -434,7 +434,7 @@ namespace DiscImageChef.Core
SectorTagType.CdSectorSubchannel);
UpdateProgress2("Hashings subchannel sector {0} of {1}", (long)doneSectors,
(long)(trk.TrackEndSector - trk.TrackStartSector + 1));
doneSectors += (sectors - doneSectors);
doneSectors += sectors - doneSectors;
}
subChkWorker.Update(sector);
@@ -465,7 +465,7 @@ namespace DiscImageChef.Core
xmlTrk.FileSystemInformation[i] = new PartitionType
{
Description = partitions[i].Description,
EndSector = (int)(partitions[i].End),
EndSector = (int)partitions[i].End,
Name = partitions[i].Name,
Sequence = (int)partitions[i].Sequence,
StartSector = (int)partitions[i].Start,
@@ -514,7 +514,7 @@ namespace DiscImageChef.Core
Partition xmlPart = new Partition
{
Start = (ulong)xmlTrk.StartSector,
Length = (ulong)((xmlTrk.EndSector - xmlTrk.StartSector) + 1),
Length = (ulong)(xmlTrk.EndSector - xmlTrk.StartSector + 1),
Type = xmlTrk.TrackType1.ToString(),
Size = (ulong)xmlTrk.Size,
Sequence = (ulong)xmlTrk.Sequence.TrackNumber

View File

@@ -57,7 +57,7 @@ namespace DiscImageChef.Core
byte[] data;
long position = 0;
InitProgress();
while(position < (fi.Length - 1048576))
while(position < fi.Length - 1048576)
{
data = new byte[1048576];
fs.Read(data, 0, 1048576);