mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Removed else statements.
This commit is contained in:
@@ -142,7 +142,8 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(channel[0x00F] == 0x01) // mode (1 byte)
|
||||
|
||||
if(channel[0x00F] == 0x01) // mode (1 byte)
|
||||
{
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 1 sector at address {0:X2}:{1:X2}:{2:X2}",
|
||||
channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
@@ -200,7 +201,8 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(channel[0x00F] == 0x02) // mode (1 byte)
|
||||
|
||||
if(channel[0x00F] == 0x02) // mode (1 byte)
|
||||
{
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 2 sector at address {0:X2}:{1:X2}:{2:X2}",
|
||||
channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
@@ -281,14 +283,12 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
DicConsole.DebugWriteLine("CD checksums",
|
||||
"Unknown mode {0} sector at address: {1:X2}:{2:X2}:{3:X2}",
|
||||
channel[0x00F], channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace DiscImageChef.CommonTypes
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if(obj == null || !(obj is Partition)) return false;
|
||||
else return Equals((Partition)obj);
|
||||
return Equals((Partition)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
|
||||
@@ -365,15 +365,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
|
||||
if(dumpRaw) throw new NotImplementedException("Raw CD dumping not yet implemented");
|
||||
else
|
||||
{
|
||||
// TODO: Check subchannel capabilities
|
||||
readcd = !dev.ReadCd(out readBuffer, out senseBuf, 0, blockSize, 1, MmcSectorTypes.AllTypes, false,
|
||||
false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None,
|
||||
MmcSubchannel.Raw, dev.Timeout, out duration);
|
||||
|
||||
if(readcd) DicConsole.WriteLine("Using MMC READ CD command.");
|
||||
}
|
||||
|
||||
DumpHardwareType currentTry = null;
|
||||
ExtentsULong extents = null;
|
||||
|
||||
@@ -421,7 +421,7 @@ namespace DiscImageChef.Devices
|
||||
if(prevent)
|
||||
return SpcPreventAllowMediumRemoval(out senseBuffer, ScsiPreventAllowMode.Prevent, timeout,
|
||||
out duration);
|
||||
else
|
||||
|
||||
return SpcPreventAllowMediumRemoval(out senseBuffer, ScsiPreventAllowMode.Allow, timeout, out duration);
|
||||
}
|
||||
|
||||
|
||||
@@ -727,8 +727,7 @@ namespace DiscImageChef.DiscImages
|
||||
throw new
|
||||
FeatureUnsupportedImageException(string.Format("Found INDEX before a track {0}",
|
||||
line));
|
||||
else
|
||||
{
|
||||
|
||||
int index = int.Parse(matchIndex.Groups[1].Value);
|
||||
ulong offset = CdrWinMsftoLba(matchIndex.Groups[2].Value);
|
||||
|
||||
@@ -768,7 +767,6 @@ namespace DiscImageChef.DiscImages
|
||||
currentfileoffsetsector = offset;
|
||||
currenttrack.Indexes.Add(index, offset);
|
||||
}
|
||||
}
|
||||
else if(matchIsrc.Success)
|
||||
{
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found ISRC at line {0}", line);
|
||||
|
||||
@@ -1153,7 +1153,8 @@ namespace DiscImageChef.DiscImages
|
||||
|
||||
throw new FeatureNotPresentImageException("Lead-out not present in disk image");
|
||||
}
|
||||
else throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1442,7 +1443,8 @@ namespace DiscImageChef.DiscImages
|
||||
getbuf <<= 1;
|
||||
getlen--;
|
||||
if(i < 0) return 1;
|
||||
else return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetByte() /* get a byte */
|
||||
|
||||
@@ -921,7 +921,7 @@ namespace DiscImageChef.DiscImages
|
||||
if(!locatorFound || parentPath == null)
|
||||
throw new
|
||||
FileNotFoundException("(VirtualPC plugin): Cannot find parent file for differencing disk image");
|
||||
else
|
||||
|
||||
{
|
||||
parentImage = new Vhd();
|
||||
Filter parentFilter =
|
||||
|
||||
@@ -672,8 +672,7 @@ namespace DiscImageChef.DiscImages
|
||||
public override byte[] ReadSectors(ulong sectorAddress, uint length)
|
||||
{
|
||||
if(differentTrackZeroSize) throw new NotImplementedException("Not yet implemented");
|
||||
else
|
||||
{
|
||||
|
||||
if(sectorAddress > ImageInfo.Sectors - 1)
|
||||
throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found");
|
||||
|
||||
@@ -690,7 +689,6 @@ namespace DiscImageChef.DiscImages
|
||||
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetImageFormat()
|
||||
{
|
||||
@@ -915,7 +913,7 @@ namespace DiscImageChef.DiscImages
|
||||
|
||||
return MediaType.Unknown;
|
||||
}
|
||||
else
|
||||
|
||||
switch(ImageInfo.ImageSize)
|
||||
{
|
||||
case 80384: return MediaType.ECMA_66;
|
||||
|
||||
@@ -94,13 +94,11 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Image format not identified, not proceeding with analysis.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -74,26 +74,22 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.ErrorWriteLine("Input file 1 format not identified, not proceeding with comparison.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Input file 1 format identified by {0} ({1}).", input1Format.Name,
|
||||
input1Format.PluginUuid);
|
||||
else DicConsole.WriteLine("Input file 1 format identified by {0}.", input1Format.Name);
|
||||
}
|
||||
|
||||
if(input2Format == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Input file 2 format not identified, not proceeding with comparison.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Input file 2 format identified by {0} ({1}).", input2Format.Name,
|
||||
input2Format.PluginUuid);
|
||||
else DicConsole.WriteLine("Input file 2 format identified by {0}.", input2Format.Name);
|
||||
}
|
||||
|
||||
input1Format.OpenImage(inputFilter1);
|
||||
input2Format.OpenImage(inputFilter2);
|
||||
|
||||
@@ -97,13 +97,11 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Image format not identified, not proceeding with analysis.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -95,13 +95,11 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Image format not identified, not proceeding with analysis.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
if(Directory.Exists(options.OutputDir) || File.Exists(options.OutputDir))
|
||||
{
|
||||
|
||||
@@ -91,13 +91,11 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Image format not identified, not proceeding with analysis.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user