diff --git a/ATA/Identify.cs b/ATA/Identify.cs index 82bebdc70..a3cbb3a39 100644 --- a/ATA/Identify.cs +++ b/ATA/Identify.cs @@ -34,6 +34,7 @@ using System; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; namespace DiscImageChef.Decoders.ATA { @@ -2220,69 +2221,69 @@ namespace DiscImageChef.Decoders.ATA if(atapi) { // Bits 12 to 8, SCSI Peripheral Device Type - switch((SCSI.PeripheralDeviceTypes)(((ushort)ATAID.GeneralConfiguration & 0x1F00) >> 8)) + switch((PeripheralDeviceTypes)(((ushort)ATAID.GeneralConfiguration & 0x1F00) >> 8)) { - case SCSI.PeripheralDeviceTypes.DirectAccess: //0x00, + case PeripheralDeviceTypes.DirectAccess: //0x00, sb.AppendLine("ATAPI Direct-access device"); break; - case SCSI.PeripheralDeviceTypes.SequentialAccess: //0x01, + case PeripheralDeviceTypes.SequentialAccess: //0x01, sb.AppendLine("ATAPI Sequential-access device"); break; - case SCSI.PeripheralDeviceTypes.PrinterDevice: //0x02, + case PeripheralDeviceTypes.PrinterDevice: //0x02, sb.AppendLine("ATAPI Printer device"); break; - case SCSI.PeripheralDeviceTypes.ProcessorDevice: //0x03, + case PeripheralDeviceTypes.ProcessorDevice: //0x03, sb.AppendLine("ATAPI Processor device"); break; - case SCSI.PeripheralDeviceTypes.WriteOnceDevice: //0x04, + case PeripheralDeviceTypes.WriteOnceDevice: //0x04, sb.AppendLine("ATAPI Write-once device"); break; - case SCSI.PeripheralDeviceTypes.MultiMediaDevice: //0x05, + case PeripheralDeviceTypes.MultiMediaDevice: //0x05, sb.AppendLine("ATAPI CD-ROM/DVD/etc device"); break; - case SCSI.PeripheralDeviceTypes.ScannerDevice: //0x06, + case PeripheralDeviceTypes.ScannerDevice: //0x06, sb.AppendLine("ATAPI Scanner device"); break; - case SCSI.PeripheralDeviceTypes.OpticalDevice: //0x07, + case PeripheralDeviceTypes.OpticalDevice: //0x07, sb.AppendLine("ATAPI Optical memory device"); break; - case SCSI.PeripheralDeviceTypes.MediumChangerDevice: //0x08, + case PeripheralDeviceTypes.MediumChangerDevice: //0x08, sb.AppendLine("ATAPI Medium change device"); break; - case SCSI.PeripheralDeviceTypes.CommsDevice: //0x09, + case PeripheralDeviceTypes.CommsDevice: //0x09, sb.AppendLine("ATAPI Communications device"); break; - case SCSI.PeripheralDeviceTypes.PrePressDevice1: //0x0A, + case PeripheralDeviceTypes.PrePressDevice1: //0x0A, sb.AppendLine("ATAPI Graphics arts pre-press device (defined in ASC IT8)"); break; - case SCSI.PeripheralDeviceTypes.PrePressDevice2: //0x0B, + case PeripheralDeviceTypes.PrePressDevice2: //0x0B, sb.AppendLine("ATAPI Graphics arts pre-press device (defined in ASC IT8)"); break; - case SCSI.PeripheralDeviceTypes.ArrayControllerDevice: //0x0C, + case PeripheralDeviceTypes.ArrayControllerDevice: //0x0C, sb.AppendLine("ATAPI Array controller device"); break; - case SCSI.PeripheralDeviceTypes.EnclosureServiceDevice: //0x0D, + case PeripheralDeviceTypes.EnclosureServiceDevice: //0x0D, sb.AppendLine("ATAPI Enclosure services device"); break; - case SCSI.PeripheralDeviceTypes.SimplifiedDevice: //0x0E, + case PeripheralDeviceTypes.SimplifiedDevice: //0x0E, sb.AppendLine("ATAPI Simplified direct-access device"); break; - case SCSI.PeripheralDeviceTypes.OCRWDevice: //0x0F, + case PeripheralDeviceTypes.OCRWDevice: //0x0F, sb.AppendLine("ATAPI Optical card reader/writer device"); break; - case SCSI.PeripheralDeviceTypes.BridgingExpander: //0x10, + case PeripheralDeviceTypes.BridgingExpander: //0x10, sb.AppendLine("ATAPI Bridging Expanders"); break; - case SCSI.PeripheralDeviceTypes.ObjectDevice: //0x11, + case PeripheralDeviceTypes.ObjectDevice: //0x11, sb.AppendLine("ATAPI Object-based Storage Device"); break; - case SCSI.PeripheralDeviceTypes.ADCDevice: //0x12, + case PeripheralDeviceTypes.ADCDevice: //0x12, sb.AppendLine("ATAPI Automation/Drive Interface"); break; - case SCSI.PeripheralDeviceTypes.WellKnownDevice: //0x1E, + case PeripheralDeviceTypes.WellKnownDevice: //0x1E, sb.AppendLine("ATAPI Well known logical unit"); break; - case SCSI.PeripheralDeviceTypes.UnknownDevice: //0x1F + case PeripheralDeviceTypes.UnknownDevice: //0x1F sb.AppendLine("ATAPI Unknown or no device type"); break; default: @@ -2388,7 +2389,7 @@ namespace DiscImageChef.Decoders.ATA { #pragma warning disable IDE0004 // Remove Unnecessary Cast physicalsectorsize = - logicalsectorsize * (uint)Math.Pow(2, (double)(ATAID.PhysLogSectorSize & 0xF)); + logicalsectorsize * (uint)Math.Pow(2, ATAID.PhysLogSectorSize & 0xF); #pragma warning restore IDE0004 // Remove Unnecessary Cast } else physicalsectorsize = logicalsectorsize; diff --git a/SCSI/EVPD.cs b/SCSI/EVPD.cs index 7ba2bf047..b6d9bdebd 100644 --- a/SCSI/EVPD.cs +++ b/SCSI/EVPD.cs @@ -35,6 +35,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; +using DiscImageChef.Decoders.ATA; namespace DiscImageChef.Decoders.SCSI { @@ -1249,7 +1250,7 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("Logical unit supports types 1, 2 and 3 protection"); break; default: - sb.AppendFormat("Logical unit supports unknown protection defined by code {0}", (byte)page.SPT) + sb.AppendFormat("Logical unit supports unknown protection defined by code {0}", page.SPT) .AppendLine(); break; } @@ -1422,11 +1423,11 @@ namespace DiscImageChef.Decoders.SCSI break; } - ATA.Identify.IdentifyDevice? id = ATA.Identify.Decode(page.IdentifyData); + Identify.IdentifyDevice? id = Identify.Decode(page.IdentifyData); if(id.HasValue) { sb.AppendLine("\tATA IDENTIFY information follows:"); - sb.AppendFormat("{0}", ATA.Identify.Prettify(id)).AppendLine(); + sb.AppendFormat("{0}", Identify.Prettify(id)).AppendLine(); } else sb.AppendLine("\tCould not decode ATA IDENTIFY information"); diff --git a/SCSI/SSC/BlockLimits.cs b/SCSI/SSC/BlockLimits.cs index a477d28db..b8d273acb 100644 --- a/SCSI/SSC/BlockLimits.cs +++ b/SCSI/SSC/BlockLimits.cs @@ -86,7 +86,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC if(decoded.Value.granularity > 0) #pragma warning disable IDE0004 // Remove Unnecessary Cast sb.AppendFormat("Device's needs a block size granularity of 2^{0} ({1}) bytes", - decoded.Value.granularity, Math.Pow(2, (double)decoded.Value.granularity)) + decoded.Value.granularity, Math.Pow(2, decoded.Value.granularity)) .AppendLine(); #pragma warning restore IDE0004 // Remove Unnecessary Cast } diff --git a/SCSI/SSC/DensitySupport.cs b/SCSI/SSC/DensitySupport.cs index 7824aa0ff..994a81854 100644 --- a/SCSI/SSC/DensitySupport.cs +++ b/SCSI/SSC/DensitySupport.cs @@ -161,7 +161,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC if(descriptor.defaultDensity) sb.AppendLine("\tThis is the default density on the drive"); sb.AppendFormat("\tDensity has {0} bits per mm, with {1} tracks in a {2} mm width tape", #pragma warning disable IDE0004 // Remove Unnecessary Cast - descriptor.bpmm, descriptor.tracks, (double)((double)descriptor.width / (double)10)) + descriptor.bpmm, descriptor.tracks, descriptor.width / (double)10) .AppendLine(); #pragma warning restore IDE0004 // Remove Unnecessary Cast sb.AppendFormat("\tDensity maximum capacity is {0} megabytes", descriptor.capacity).AppendLine(); @@ -252,7 +252,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC sb.AppendFormat("\tMedium has a nominal length of {0} m in a {1} mm width tape", #pragma warning disable IDE0004 // Remove Unnecessary Cast - descriptor.length, (double)((double)descriptor.width / (double)10)).AppendLine(); + descriptor.length, descriptor.width / (double)10).AppendLine(); #pragma warning restore IDE0004 // Remove Unnecessary Cast sb.AppendFormat("\tMedium description: {0}", descriptor.description).AppendLine(); sb.AppendLine(); diff --git a/SecureDigital/SCR.cs b/SecureDigital/SCR.cs index 10a03e093..74bc5a12f 100644 --- a/SecureDigital/SCR.cs +++ b/SecureDigital/SCR.cs @@ -107,11 +107,11 @@ namespace DiscImageChef.Decoders.SecureDigital sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 1.10"); else if(scr.Spec == 2 && scr.Spec3 == false && scr.Spec4 == false && scr.SpecX == 0) sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 2.00"); - else if(scr.Spec == 2 && scr.Spec3 == true && scr.Spec4 == false && scr.SpecX == 0) + else if(scr.Spec == 2 && scr.Spec3 && scr.Spec4 == false && scr.SpecX == 0) sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 3.0x"); - else if(scr.Spec == 2 && scr.Spec3 == true && scr.Spec4 == true && scr.SpecX == 0) + else if(scr.Spec == 2 && scr.Spec3 && scr.Spec4 && scr.SpecX == 0) sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 4.xx"); - else if(scr.Spec == 2 && scr.Spec3 == true && scr.SpecX == 1) + else if(scr.Spec == 2 && scr.Spec3 && scr.SpecX == 1) sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 5.xx"); else sb