REFACTOR: Use preferred braces style.

This commit is contained in:
2017-12-21 00:44:33 +00:00
parent e9443388ee
commit bce69c9161
171 changed files with 5 additions and 1412 deletions

View File

@@ -117,9 +117,7 @@ namespace DiscImageChef.Core.Devices.Dumping
dumpLog.WriteLine("Decoding PCMCIA CIS.");
Decoders.PCMCIA.Tuple[] tuples = CIS.GetTuples(dev.Cis);
if(tuples != null)
{
foreach(Decoders.PCMCIA.Tuple tuple in tuples)
{
if(tuple.Code == TupleCodes.CISTPL_MANFID)
{
ManufacturerIdentificationTuple manfid =
@@ -146,8 +144,6 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.BlockMedia[0].PCMCIA.AdditionalInformation = vers.AdditionalInformation;
}
}
}
}
}
sidecar.BlockMedia[0].ATA = new ATAType
@@ -506,7 +502,6 @@ namespace DiscImageChef.Core.Devices.Dumping
partitions[i].Scheme);
foreach(Filesystem plugin in plugins.PluginsList.Values)
{
try
{
if(plugin.Identify(imageFormat, partitions[i]))
@@ -523,7 +518,6 @@ namespace DiscImageChef.Core.Devices.Dumping
{
//DicConsole.DebugWriteLine("Dump-media command", "Plugin {0} crashed", _plugin.Name);
}
}
if(lstFs.Count > 0) xmlFileSysInfo[i].FileSystems = lstFs.ToArray();
}
@@ -544,7 +538,6 @@ namespace DiscImageChef.Core.Devices.Dumping
};
foreach(Filesystem plugin in plugins.PluginsList.Values)
{
try
{
if(plugin.Identify(imageFormat, wholePart))
@@ -561,7 +554,6 @@ namespace DiscImageChef.Core.Devices.Dumping
{
//DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name);
}
}
if(lstFs.Count > 0) xmlFileSysInfo[0].FileSystems = lstFs.ToArray();
}

View File

@@ -188,7 +188,6 @@ namespace DiscImageChef.Core.Devices.Dumping
{
Decoders.DVD.PFI.PhysicalFormatInformation? nintendoPfi = Decoders.DVD.PFI.Decode(cmdBuf);
if(nintendoPfi != null)
{
if(nintendoPfi.Value.DiskCategory == Decoders.DVD.DiskCategory.Nintendo &&
nintendoPfi.Value.PartVersion == 15)
{
@@ -196,7 +195,6 @@ namespace DiscImageChef.Core.Devices.Dumping
throw new
NotImplementedException("Dumping Nintendo GameCube or Wii discs is not yet implemented.");
}
}
}
}
#endregion Nintendo
@@ -232,7 +230,6 @@ namespace DiscImageChef.Core.Devices.Dumping
// False book types
if(dskType == MediaType.DVDROM)
{
switch(decPfi.DiskCategory)
{
case Decoders.DVD.DiskCategory.DVDPR:
@@ -281,7 +278,6 @@ namespace DiscImageChef.Core.Devices.Dumping
dskType = MediaType.UMD;
break;
}
}
}
}
@@ -353,7 +349,6 @@ namespace DiscImageChef.Core.Devices.Dumping
MmcDiscStructureFormat.CopyrightInformation, 0, dev.Timeout,
out duration);
if(!sense)
{
if(Decoders.DVD.CSS_CPRM.DecodeLeadInCopyright(cmdBuf).HasValue)
{
tmpBuf = new byte[cmdBuf.Length - 4];
@@ -371,7 +366,6 @@ namespace DiscImageChef.Core.Devices.Dumping
if(cpy.CopyrightType != Decoders.DVD.CopyrightType.NoProtection)
sidecar.OpticalDisc[0].CopyProtection = cpy.CopyrightType.ToString();
}
}
}
#endregion DVD-ROM
@@ -404,7 +398,6 @@ namespace DiscImageChef.Core.Devices.Dumping
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
MmcDiscStructureFormat.DvdramDds, 0, dev.Timeout, out duration);
if(!sense)
{
if(Decoders.DVD.DDS.Decode(cmdBuf).HasValue)
{
tmpBuf = new byte[cmdBuf.Length - 4];
@@ -417,14 +410,12 @@ namespace DiscImageChef.Core.Devices.Dumping
};
DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].DDS.Image, tmpBuf);
}
}
dumpLog.WriteLine("Reading Spare Area Information.");
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, dev.Timeout,
out duration);
if(!sense)
{
if(Decoders.DVD.Spare.Decode(cmdBuf).HasValue)
{
tmpBuf = new byte[cmdBuf.Length - 4];
@@ -437,7 +428,6 @@ namespace DiscImageChef.Core.Devices.Dumping
};
DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].SAI.Image, tmpBuf);
}
}
}
#endregion DVD-RAM and HD DVD-RAM
@@ -569,7 +559,6 @@ namespace DiscImageChef.Core.Devices.Dumping
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
MmcDiscStructureFormat.DiscInformation, 0, dev.Timeout, out duration);
if(!sense)
{
if(Decoders.Bluray.DI.Decode(cmdBuf).HasValue)
{
tmpBuf = new byte[cmdBuf.Length - 4];
@@ -582,7 +571,6 @@ namespace DiscImageChef.Core.Devices.Dumping
};
DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].DI.Image, tmpBuf);
}
}
dumpLog.WriteLine("Reading PAC.");
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,

View File

@@ -217,15 +217,12 @@ namespace DiscImageChef.Core.Devices.Dumping
sense = dev.ModeSense10(out cmdBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0xFF,
5, out duration);
if(!sense || dev.Error)
{
sense = dev.ModeSense10(out cmdBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F,
0x00, 5, out duration);
}
Decoders.SCSI.Modes.DecodedMode? decMode = null;
if(!sense && !dev.Error)
{
if(Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType).HasValue)
{
decMode = Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType);
@@ -237,7 +234,6 @@ namespace DiscImageChef.Core.Devices.Dumping
};
DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense10.Image, cmdBuf);
}
}
dumpLog.WriteLine("Requesting MODE SENSE (6).");
sense = dev.ModeSense6(out cmdBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F, 0x00, 5,
@@ -248,7 +244,6 @@ namespace DiscImageChef.Core.Devices.Dumping
if(sense || dev.Error) sense = dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration);
if(!sense && !dev.Error)
{
if(Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType).HasValue)
{
decMode = Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType);
@@ -260,7 +255,6 @@ namespace DiscImageChef.Core.Devices.Dumping
};
DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense.Image, cmdBuf);
}
}
// TODO: Check partitions page
if(decMode.HasValue)
@@ -302,7 +296,6 @@ namespace DiscImageChef.Core.Devices.Dumping
{
fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense);
if(fxSense.HasValue)
{
if(fxSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest)
{
sense = dev.Space(out senseBuf, SscSpaceCodes.LogicalBlock, -1, dev.Timeout, out duration);
@@ -346,7 +339,6 @@ namespace DiscImageChef.Core.Devices.Dumping
fxSense.Value.SenseKey, fxSense.Value.ASC, fxSense.Value.ASCQ);
return;
}
}
else
{
DicConsole.WriteLine();

View File

@@ -489,7 +489,6 @@ namespace DiscImageChef.Core.Devices.Dumping
partitions[i].Scheme);
foreach(Filesystem plugin in plugins.PluginsList.Values)
{
try
{
if(plugin.Identify(imageFormat, partitions[i]))
@@ -506,7 +505,6 @@ namespace DiscImageChef.Core.Devices.Dumping
{
//DicConsole.DebugWriteLine("Dump-media command", "Plugin {0} crashed", _plugin.Name);
}
}
if(lstFs.Count > 0) xmlFileSysInfo[i].FileSystems = lstFs.ToArray();
}
@@ -523,7 +521,6 @@ namespace DiscImageChef.Core.Devices.Dumping
new Partition {Name = "Whole device", Length = blocks, Size = blocks * blockSize};
foreach(Filesystem plugin in plugins.PluginsList.Values)
{
try
{
if(plugin.Identify(imageFormat, wholePart))
@@ -540,7 +537,6 @@ namespace DiscImageChef.Core.Devices.Dumping
{
//DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name);
}
}
if(lstFs.Count > 0) xmlFileSysInfo[0].FileSystems = lstFs.ToArray();
}