From 1ad3366dae52fe7311b85538cc9a5de7a54199db Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 28 Jul 2016 22:25:26 +0100 Subject: [PATCH] Refactor and code cleanup. --- ATA/Errors.cs | 2 - ATA/Identify.cs | 36 +++++---- Blu-ray/BCA.cs | 2 +- Blu-ray/Cartridge.cs | 2 +- Blu-ray/DDS.cs | 32 ++++---- Blu-ray/DI.cs | 8 +- Blu-ray/Spare.cs | 8 +- CD/ATIP.cs | 2 +- CD/CDTextOnLeadIn.cs | 5 +- CD/Enums.cs | 2 - CD/FullTOC.cs | 2 +- CD/PMA.cs | 2 +- CD/Session.cs | 4 +- CD/TOC.cs | 4 +- ChangeLog | 59 ++++++++++++++ DVD/AACS.cs | 4 +- DVD/ADIP.cs | 4 +- DVD/BCA.cs | 4 +- DVD/CPRM.cs | 6 +- DVD/CSS&CPRM.cs | 5 +- DVD/Cartridge.cs | 3 +- DVD/DDS.cs | 2 +- DVD/DMI.cs | 4 +- DVD/Enums.cs | 2 - DVD/Layers.cs | 18 ++--- DVD/PFI.cs | 20 ++--- DVD/PRI.cs | 4 +- DVD/RMD.cs | 8 +- DVD/Spare.cs | 9 +-- DVD/UDI.cs | 18 ++--- Floppy/Amiga.cs | 5 +- Floppy/Apple2.cs | 1 - Floppy/AppleSony.cs | 3 +- Floppy/Commodore.cs | 7 +- Floppy/Enums.cs | 2 - Floppy/ISO.cs | 7 +- Floppy/Perpendicular.cs | 7 +- Floppy/System34.cs | 7 +- Floppy/System3740.cs | 5 +- SCSI/DiscStructureCapabilities.cs | 1 - SCSI/EVPD.cs | 1 - SCSI/Enums.cs | 2 - SCSI/Inquiry.cs | 4 +- SCSI/MMC/AACS.cs | 18 ++--- SCSI/MMC/CPRM.cs | 2 +- SCSI/MMC/DiscInformation.cs | 36 ++++----- SCSI/MMC/Enums.cs | 2 - SCSI/MMC/Features.cs | 8 +- SCSI/MMC/Hybrid.cs | 14 ++-- SCSI/MMC/WriteProtect.cs | 2 +- SCSI/Modes.cs | 124 +++++++++++++++--------------- SCSI/SSC/BlockLimits.cs | 4 +- SCSI/SSC/DensitySupport.cs | 8 +- SCSI/Sense.cs | 26 +++---- SCSI/Types.cs | 4 +- SCSI/VendorString.cs | 2 - Xbox/DMI.cs | 4 +- 57 files changed, 303 insertions(+), 284 deletions(-) diff --git a/ATA/Errors.cs b/ATA/Errors.cs index a090419..4e35705 100644 --- a/ATA/Errors.cs +++ b/ATA/Errors.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.ATA { public struct AtaRegistersCHS diff --git a/ATA/Identify.cs b/ATA/Identify.cs index d247702..c300aef 100644 --- a/ATA/Identify.cs +++ b/ATA/Identify.cs @@ -49,7 +49,7 @@ namespace DiscImageChef.Decoders.ATA /// T13-1699D rev. 4a (ATA8-ACS) /// T13-2015D rev. 2 (ACS-2) /// T13-2161D rev. 5 (ACS-3) - /// CF+ & CF Specification rev. 1.4 (CFA) + /// CF+ & CF Specification rev. 1.4 (CFA) /// public static class Identify { @@ -2436,7 +2436,9 @@ namespace DiscImageChef.Decoders.ATA if((ATAID.PhysLogSectorSize & 0x2000) == 0x2000) { +#pragma warning disable IDE0004 // Remove Unnecessary Cast physicalsectorsize = logicalsectorsize * (uint)Math.Pow(2, (double)(ATAID.PhysLogSectorSize & 0xF)); +#pragma warning restore IDE0004 // Remove Unnecessary Cast } else physicalsectorsize = logicalsectorsize; @@ -2505,38 +2507,38 @@ namespace DiscImageChef.Decoders.ATA { if(ATAID.CommandSet5.HasFlag(CommandSetBit5.ExtSectors)) { - if((((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024) > 1000000) + if(((ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024) > 1000000) { - sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Tb, {2} TiB", (ulong)ATAID.ExtendedUserSectors * logicalsectorsize, - ((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1000 / 1000 / 1000 / 1000, ((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024).AppendLine(); + sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Tb, {2} TiB", ATAID.ExtendedUserSectors * logicalsectorsize, + (ATAID.ExtendedUserSectors * logicalsectorsize) / 1000 / 1000 / 1000 / 1000, (ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024).AppendLine(); } - else if((((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024) > 1000) + else if(((ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024) > 1000) { - sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Gb, {2} GiB", (ulong)ATAID.ExtendedUserSectors * logicalsectorsize, - ((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1000 / 1000 / 1000, ((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024 / 1024).AppendLine(); + sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Gb, {2} GiB", ATAID.ExtendedUserSectors * logicalsectorsize, + (ATAID.ExtendedUserSectors * logicalsectorsize) / 1000 / 1000 / 1000, (ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024 / 1024).AppendLine(); } else { - sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Mb, {2} MiB", (ulong)ATAID.ExtendedUserSectors * logicalsectorsize, - ((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1000 / 1000, ((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024).AppendLine(); + sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Mb, {2} MiB", ATAID.ExtendedUserSectors * logicalsectorsize, + (ATAID.ExtendedUserSectors * logicalsectorsize) / 1000 / 1000, (ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024).AppendLine(); } } else { - if((((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024) > 1000000) + if(((ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024) > 1000000) { - sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Tb, {2} TiB", (ulong)ATAID.LBA48Sectors * logicalsectorsize, - ((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1000 / 1000 / 1000 / 1000, ((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024).AppendLine(); + sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Tb, {2} TiB", ATAID.LBA48Sectors * logicalsectorsize, + (ATAID.LBA48Sectors * logicalsectorsize) / 1000 / 1000 / 1000 / 1000, (ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024).AppendLine(); } - else if((((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024) > 1000) + else if(((ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024) > 1000) { - sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Gb, {2} GiB", (ulong)ATAID.LBA48Sectors * logicalsectorsize, - ((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1000 / 1000 / 1000, ((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024 / 1024).AppendLine(); + sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Gb, {2} GiB", ATAID.LBA48Sectors * logicalsectorsize, + (ATAID.LBA48Sectors * logicalsectorsize) / 1000 / 1000 / 1000, (ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024 / 1024).AppendLine(); } else { - sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Mb, {2} MiB", (ulong)ATAID.LBA48Sectors * logicalsectorsize, - ((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1000 / 1000, ((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024).AppendLine(); + sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Mb, {2} MiB", ATAID.LBA48Sectors * logicalsectorsize, + (ATAID.LBA48Sectors * logicalsectorsize) / 1000 / 1000, (ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024).AppendLine(); } } } diff --git a/Blu-ray/BCA.cs b/Blu-ray/BCA.cs index 00e2195..b5090cc 100644 --- a/Blu-ray/BCA.cs +++ b/Blu-ray/BCA.cs @@ -113,7 +113,7 @@ namespace DiscImageChef.Decoders.Bluray /// Bytes 0 to 1 /// Always 66 /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/Blu-ray/Cartridge.cs b/Blu-ray/Cartridge.cs index 016676a..65e3015 100644 --- a/Blu-ray/Cartridge.cs +++ b/Blu-ray/Cartridge.cs @@ -145,7 +145,7 @@ namespace DiscImageChef.Decoders.Bluray /// Bytes 0 to 1 /// Always 6 /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/Blu-ray/DDS.cs b/Blu-ray/DDS.cs index fef71bd..36e7e00 100644 --- a/Blu-ray/DDS.cs +++ b/Blu-ray/DDS.cs @@ -57,7 +57,7 @@ namespace DiscImageChef.Decoders.Bluray /// /// Disc Definition Structure Identifier "DS" /// - const UInt16 DDSIdentifier = 0x4453; + const ushort DDSIdentifier = 0x4453; #endregion Private constants #region Public methods @@ -170,7 +170,7 @@ namespace DiscImageChef.Decoders.Bluray /// Bytes 0 to 1 /// Data Length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -185,7 +185,7 @@ namespace DiscImageChef.Decoders.Bluray /// Bytes 4 to 5 /// "DS" /// - public UInt16 Signature; + public ushort Signature; /// /// Byte 6 /// DDS format @@ -200,57 +200,57 @@ namespace DiscImageChef.Decoders.Bluray /// Bytes 8 to 11 /// DDS update count /// - public UInt32 UpdateCount; + public uint UpdateCount; /// /// Bytes 12 to 19 /// Reserved /// - public UInt64 Reserved4; + public ulong Reserved4; /// /// Bytes 20 to 23 /// First PSN of Drive Area /// - public UInt32 DriveAreaPSN; + public uint DriveAreaPSN; /// /// Bytes 24 to 27 /// Reserved /// - public UInt32 Reserved5; + public uint Reserved5; /// /// Bytes 28 to 31 /// First PSN of Defect List /// - public UInt32 DefectListPSN; + public uint DefectListPSN; /// /// Bytes 32 to 35 /// Reserved /// - public UInt32 Reserved6; + public uint Reserved6; /// /// Bytes 36 to 39 /// PSN of LSN 0 of user data area /// - public UInt32 PSNofLSNZero; + public uint PSNofLSNZero; /// /// Bytes 40 to 43 /// Last LSN of user data area /// - public UInt32 LastUserAreaLSN; + public uint LastUserAreaLSN; /// /// Bytes 44 to 47 /// ISA0 size /// - public UInt32 ISA0; + public uint ISA0; /// /// Bytes 48 to 51 /// OSA size /// - public UInt32 OSA; + public uint OSA; /// /// Bytes 52 to 55 /// ISA1 size /// - public UInt32 ISA1; + public uint ISA1; /// /// Byte 56 /// Spare Area full flags @@ -275,12 +275,12 @@ namespace DiscImageChef.Decoders.Bluray /// Byte 60 to 63 /// Disc type specific field /// - public UInt32 DiscTypeSpecificField2; + public uint DiscTypeSpecificField2; /// /// Byte 64 to 67 /// Reserved /// - public UInt32 Reserved9; + public uint Reserved9; /// /// Bytes 68 to 99 /// Status bits of INFO1/2 and PAC1/2 on L0 and L1 diff --git a/Blu-ray/DI.cs b/Blu-ray/DI.cs index 9bced68..cb7b524 100644 --- a/Blu-ray/DI.cs +++ b/Blu-ray/DI.cs @@ -62,7 +62,7 @@ namespace DiscImageChef.Decoders.Bluray /// /// Disc Information Unit Identifier "DI" /// - const UInt16 DIUIdentifier = 0x4449; + const ushort DIUIdentifier = 0x4449; #endregion Private constants #region Public methods @@ -199,7 +199,7 @@ namespace DiscImageChef.Decoders.Bluray /// Bytes 0 to 1 /// Always 4098 /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -223,7 +223,7 @@ namespace DiscImageChef.Decoders.Bluray /// Byte 0 /// "DI" /// - public UInt16 Signature; + public ushort Signature; /// /// Byte 2 /// Disc information format @@ -283,7 +283,7 @@ namespace DiscImageChef.Decoders.Bluray /// Bytes 109 to 110, BD-R/-RE only /// Timestamp /// - public UInt16 TimeStamp; + public ushort TimeStamp; /// /// Byte 111 /// Product revision number diff --git a/Blu-ray/Spare.cs b/Blu-ray/Spare.cs index e707ad6..a558039 100644 --- a/Blu-ray/Spare.cs +++ b/Blu-ray/Spare.cs @@ -115,7 +115,7 @@ namespace DiscImageChef.Decoders.Bluray /// Bytes 0 to 1 /// Always 14 /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -130,17 +130,17 @@ namespace DiscImageChef.Decoders.Bluray /// Bytes 4 to 7 /// Reserved /// - public UInt32 Reserved3; + public uint Reserved3; /// /// Bytes 8 to 11 /// Free spare blocks /// - public UInt32 FreeSpareBlocks; + public uint FreeSpareBlocks; /// /// Bytes 12 to 15 /// Allocated spare blocks /// - public UInt32 AllocatedSpareBlocks; + public uint AllocatedSpareBlocks; } #endregion Public structures } diff --git a/CD/ATIP.cs b/CD/ATIP.cs index 6206102..01cdbf1 100644 --- a/CD/ATIP.cs +++ b/CD/ATIP.cs @@ -59,7 +59,7 @@ namespace DiscImageChef.Decoders.CD /// Bytes 1 to 0 /// Total size of returned session information minus this field /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/CD/CDTextOnLeadIn.cs b/CD/CDTextOnLeadIn.cs index e634cd2..2e0ceb9 100644 --- a/CD/CDTextOnLeadIn.cs +++ b/CD/CDTextOnLeadIn.cs @@ -33,7 +33,6 @@ using System; using DiscImageChef.Console; using System.Text; -using System.Collections.Generic; namespace DiscImageChef.Decoders.CD { @@ -127,7 +126,7 @@ namespace DiscImageChef.Decoders.CD /// /// Total size of returned CD-Text information minus this field /// - public UInt16 DataLength; + public ushort DataLength; /// /// Reserved /// @@ -183,7 +182,7 @@ namespace DiscImageChef.Decoders.CD /// Bytes 16 to 17 /// CRC16 /// - public UInt16 CRC; + public ushort CRC; } public static CDText? Decode(byte[] CDTextResponse) diff --git a/CD/Enums.cs b/CD/Enums.cs index fd1c8c9..c2d8d5c 100644 --- a/CD/Enums.cs +++ b/CD/Enums.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.CD { public enum TOC_ADR : byte diff --git a/CD/FullTOC.cs b/CD/FullTOC.cs index d101294..48bfb3a 100644 --- a/CD/FullTOC.cs +++ b/CD/FullTOC.cs @@ -67,7 +67,7 @@ namespace DiscImageChef.Decoders.CD /// /// Total size of returned session information minus this field /// - public UInt16 DataLength; + public ushort DataLength; /// /// First complete session number in hex /// diff --git a/CD/PMA.cs b/CD/PMA.cs index 1b99547..72db471 100644 --- a/CD/PMA.cs +++ b/CD/PMA.cs @@ -58,7 +58,7 @@ namespace DiscImageChef.Decoders.CD /// /// Total size of returned session information minus this field /// - public UInt16 DataLength; + public ushort DataLength; /// /// Reserved /// diff --git a/CD/Session.cs b/CD/Session.cs index d4a39f5..0376465 100644 --- a/CD/Session.cs +++ b/CD/Session.cs @@ -58,7 +58,7 @@ namespace DiscImageChef.Decoders.CD /// /// Total size of returned session information minus this field /// - public UInt16 DataLength; + public ushort DataLength; /// /// First track number in hex /// @@ -104,7 +104,7 @@ namespace DiscImageChef.Decoders.CD /// Bytes 4 to 7 /// First track number in last complete session start address in LBA or in MSF /// - public UInt32 TrackStartAddress; + public uint TrackStartAddress; } public static CDSessionInfo? Decode(byte[] CDSessionInfoResponse) diff --git a/CD/TOC.cs b/CD/TOC.cs index f314bae..791ed16 100644 --- a/CD/TOC.cs +++ b/CD/TOC.cs @@ -60,7 +60,7 @@ namespace DiscImageChef.Decoders.CD /// /// Total size of returned TOC minus this field /// - public UInt16 DataLength; + public ushort DataLength; /// /// First track number in hex /// @@ -106,7 +106,7 @@ namespace DiscImageChef.Decoders.CD /// Bytes 4 to 7 /// The track start address in LBA or in MSF /// - public UInt32 TrackStartAddress; + public uint TrackStartAddress; } public static CDTOC? Decode(byte[] CDTOCResponse) diff --git a/ChangeLog b/ChangeLog index 1b53dba..4bb3b6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,62 @@ +2016-07-28 Natalia Portillo + + * PMA.cs: + * TOC.cs: + * PFI.cs: + * DMI.cs: + * ATIP.cs: + * DDS.cs: + * PRI.cs: + * RMD.cs: + * BCA.cs: + * UDI.cs: + * ADIP.cs: + * AACS.cs: + * DMI.cs: + * Enums.cs: + * CPRM.cs: + * Spare.cs: + * EVPD.cs: + * Enums.cs: + * ISO.cs: + * Errors.cs: + * Enums.cs: + * Modes.cs: + * Sense.cs: + * Types.cs: + * DI.cs: + * Session.cs: + * FullTOC.cs: + * Layers.cs: + * BCA.cs: + * DDS.cs: + * CSS&CPRM.cs: + * Inquiry.cs: + * Identify.cs: + * Enums.cs: + * Amiga.cs: + * Apple2.cs: + * CPRM.cs: + * AACS.cs: + * Spare.cs: + * Cartridge.cs: + * Enums.cs: + * System34.cs: + * Hybrid.cs: + * AppleSony.cs: + * Commodore.cs: + * CDTextOnLeadIn.cs: + * Cartridge.cs: + * System3740.cs: + * Features.cs: + * VendorString.cs: + * Perpendicular.cs: + * BlockLimits.cs: + * WriteProtect.cs: + * DensitySupport.cs: + * DiscInformation.cs: + * DiscStructureCapabilities.cs: Refactor and code cleanup. + 2016-02-05 Natalia Portillo * SCSI/Sense.cs: diff --git a/DVD/AACS.cs b/DVD/AACS.cs index 2d448b8..f2f5441 100644 --- a/DVD/AACS.cs +++ b/DVD/AACS.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.DVD { /// @@ -58,7 +56,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/DVD/ADIP.cs b/DVD/ADIP.cs index 1669e4a..74eb902 100644 --- a/DVD/ADIP.cs +++ b/DVD/ADIP.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.DVD { /// @@ -58,7 +56,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/DVD/BCA.cs b/DVD/BCA.cs index de8bfb0..a8c107a 100644 --- a/DVD/BCA.cs +++ b/DVD/BCA.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.DVD { /// @@ -58,7 +56,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/DVD/CPRM.cs b/DVD/CPRM.cs index 8ea2ae7..6ef2401 100644 --- a/DVD/CPRM.cs +++ b/DVD/CPRM.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.DVD { /// @@ -58,7 +56,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -82,7 +80,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/DVD/CSS&CPRM.cs b/DVD/CSS&CPRM.cs index 28bcb5f..5df818c 100644 --- a/DVD/CSS&CPRM.cs +++ b/DVD/CSS&CPRM.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Text; namespace DiscImageChef.Decoders.DVD @@ -59,7 +58,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -98,7 +97,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/DVD/Cartridge.cs b/DVD/Cartridge.cs index 7198716..05e0633 100644 --- a/DVD/Cartridge.cs +++ b/DVD/Cartridge.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Text; namespace DiscImageChef.Decoders.DVD @@ -58,7 +57,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/DVD/DDS.cs b/DVD/DDS.cs index 5949d75..dd94387 100644 --- a/DVD/DDS.cs +++ b/DVD/DDS.cs @@ -60,7 +60,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/DVD/DMI.cs b/DVD/DMI.cs index 27368a4..b71a35c 100644 --- a/DVD/DMI.cs +++ b/DVD/DMI.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.DVD { /// @@ -58,7 +56,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/DVD/Enums.cs b/DVD/Enums.cs index 5c9c960..8a1dd9f 100644 --- a/DVD/Enums.cs +++ b/DVD/Enums.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.DVD { #region Public enumerations diff --git a/DVD/Layers.cs b/DVD/Layers.cs index 3065682..fcdfbfd 100644 --- a/DVD/Layers.cs +++ b/DVD/Layers.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.DVD { /// @@ -58,7 +56,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -98,7 +96,7 @@ namespace DiscImageChef.Decoders.DVD /// Byte 8 to 11 /// L0 Data Area Capacity /// - public UInt32 Capacity; + public uint Capacity; } public struct MiddleZoneStartAddress @@ -107,7 +105,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length = 10 /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -147,7 +145,7 @@ namespace DiscImageChef.Decoders.DVD /// Byte 8 to 11 /// Start LBA of Shifted Middle Area on L0 /// - public UInt32 ShiftedMiddleAreaStartAddress; + public uint ShiftedMiddleAreaStartAddress; } public struct JumpIntervalSize @@ -156,7 +154,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length = 10 /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -191,7 +189,7 @@ namespace DiscImageChef.Decoders.DVD /// Byte 8 to 11 /// Jump Interval size for the Regular Interval Layer Jump /// - public UInt32 Size; + public uint Size; } public struct ManualLayerJumpAddress @@ -200,7 +198,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length = 10 /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -235,7 +233,7 @@ namespace DiscImageChef.Decoders.DVD /// Byte 8 to 11 /// LBA for the manual layer jump /// - public UInt32 LBA; + public uint LBA; } } } diff --git a/DVD/PFI.cs b/DVD/PFI.cs index 9f39987..8b5f336 100644 --- a/DVD/PFI.cs +++ b/DVD/PFI.cs @@ -74,7 +74,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -141,17 +141,17 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 8 to 11 /// PSN where Data Area starts /// - public UInt32 DataAreaStartPSN; + public uint DataAreaStartPSN; /// /// Bytes 12 to 15 /// PSN where Data Area ends /// - public UInt32 DataAreaEndPSN; + public uint DataAreaEndPSN; /// /// Bytes 16 to 19 /// PSN where Data Area ends in Layer 0 /// - public UInt32 Layer0EndPSN; + public uint Layer0EndPSN; /// /// Byte 20, bit 7 /// True if BCA exists. GC/Wii discs do not have this bit set, but there is a BCA, making it unreadable in normal DVD drives @@ -169,7 +169,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 21 to 22 /// UMD only, media attribute, application-defined, part of media specific in rest of discs /// - public UInt16 MediaAttribute; + public ushort MediaAttribute; #endregion UMD PFI #region DVD-RAM PFI @@ -285,12 +285,12 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 36 to 39 /// Sector number of the first sector of the current Border Out /// - public UInt32 CurrentBorderOutSector; + public uint CurrentBorderOutSector; /// /// Bytes 40 to 43 /// Sector number of the first sector of the next Border In /// - public UInt32 NextBorderInSector; + public uint NextBorderInSector; #endregion DVD-R PFI, DVD-RW PFI #region DVD+RW PFI @@ -1013,12 +1013,12 @@ namespace DiscImageChef.Decoders.DVD /// Byte 36 /// Start sector number of current RMD in Extra Border Zone /// - public UInt32 CurrentRMDExtraBorderPSN; + public uint CurrentRMDExtraBorderPSN; /// /// Byte 40 /// Start sector number of Physical Format Information blocks in Extra Border Zone /// - public UInt32 PFIExtraBorderPSN; + public uint PFIExtraBorderPSN; /// /// Byte 44, bit 0 /// If NOT set, Control Data Zone is pre-recorded @@ -1351,7 +1351,7 @@ namespace DiscImageChef.Decoders.DVD sizeString = "120mm"; break; default: - sizeString = String.Format("unknown size identifier {0}", decoded.DiscSize); + sizeString = string.Format("unknown size identifier {0}", decoded.DiscSize); break; } diff --git a/DVD/PRI.cs b/DVD/PRI.cs index c1e02a8..0853204 100644 --- a/DVD/PRI.cs +++ b/DVD/PRI.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.DVD { /// @@ -58,7 +56,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/DVD/RMD.cs b/DVD/RMD.cs index 7ed84ee..a0cd808 100644 --- a/DVD/RMD.cs +++ b/DVD/RMD.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.DVD { /// @@ -58,7 +56,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -82,7 +80,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -112,7 +110,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 6 to 7 /// Number of remaining RMDs in current RMZ /// - public UInt16 CurrentRemainingRMDs; + public ushort CurrentRemainingRMDs; } } } diff --git a/DVD/Spare.cs b/DVD/Spare.cs index d24ca05..d62af3e 100644 --- a/DVD/Spare.cs +++ b/DVD/Spare.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Text; namespace DiscImageChef.Decoders.DVD @@ -58,7 +57,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -73,17 +72,17 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 4 to 7 /// Data length /// - public UInt32 UnusedPrimaryBlocks; + public uint UnusedPrimaryBlocks; /// /// Bytes 8 to 11 /// Data length /// - public UInt32 UnusedSupplementaryBlocks; + public uint UnusedSupplementaryBlocks; /// /// Bytes 12 to 15 /// Data length /// - public UInt32 AllocatedSupplementaryBlocks; + public uint AllocatedSupplementaryBlocks; } public static SpareAreaInformation? Decode(byte[] response) diff --git a/DVD/UDI.cs b/DVD/UDI.cs index 507994d..1dd3fe0 100644 --- a/DVD/UDI.cs +++ b/DVD/UDI.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.DVD { /// @@ -58,7 +56,7 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -83,37 +81,37 @@ namespace DiscImageChef.Decoders.DVD /// Bytes 6 to 7 /// Random number /// - public UInt16 RandomNumber; + public ushort RandomNumber; /// /// Byte 8 to 11 /// Year /// - public UInt32 Year; + public uint Year; /// /// Byte 12 to 13 /// Month /// - public UInt16 Month; + public ushort Month; /// /// Byte 14 to 15 /// Day /// - public UInt16 Day; + public ushort Day; /// /// Byte 16 to 17 /// Hour /// - public UInt16 Hour; + public ushort Hour; /// /// Byte 18 to 19 /// Minute /// - public UInt16 Minute; + public ushort Minute; /// /// Byte 20 to 21 /// Second /// - public UInt16 Second; + public ushort Second; } } } diff --git a/Floppy/Amiga.cs b/Floppy/Amiga.cs index 6fb3643..4cf3695 100644 --- a/Floppy/Amiga.cs +++ b/Floppy/Amiga.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Runtime.InteropServices; namespace DiscImageChef.Decoders.Floppy @@ -76,11 +75,11 @@ namespace DiscImageChef.Decoders.Floppy /// /// Checksum from to /// - public UInt32 headerChecksum; + public uint headerChecksum; /// /// Checksum from /// - public UInt32 dataChecksum; + public uint dataChecksum; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] public byte[] data; } diff --git a/Floppy/Apple2.cs b/Floppy/Apple2.cs index a1f8351..7b65619 100644 --- a/Floppy/Apple2.cs +++ b/Floppy/Apple2.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Runtime.InteropServices; namespace DiscImageChef.Decoders.Floppy diff --git a/Floppy/AppleSony.cs b/Floppy/AppleSony.cs index 764ed5c..254239c 100644 --- a/Floppy/AppleSony.cs +++ b/Floppy/AppleSony.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Runtime.InteropServices; namespace DiscImageChef.Decoders.Floppy @@ -89,7 +88,7 @@ namespace DiscImageChef.Decoders.Floppy [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] prologue; /// - /// Encoded (decodedTrack & 0x3F) + /// Encoded (decodedTrack & 0x3F) /// public byte track; /// diff --git a/Floppy/Commodore.cs b/Floppy/Commodore.cs index 2d61ac3..8d9d9af 100644 --- a/Floppy/Commodore.cs +++ b/Floppy/Commodore.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Runtime.InteropServices; namespace DiscImageChef.Decoders.Floppy @@ -64,11 +63,11 @@ namespace DiscImageChef.Decoders.Floppy /// /// Format ID, unknown meaning /// - public UInt16 format; + public ushort format; /// /// Filled with 0x0F /// - public UInt16 fill; + public ushort fill; } /// @@ -92,7 +91,7 @@ namespace DiscImageChef.Decoders.Floppy /// /// Filled with 0x0F /// - public UInt16 fill; + public ushort fill; } } } diff --git a/Floppy/Enums.cs b/Floppy/Enums.cs index 10f9230..97df797 100644 --- a/Floppy/Enums.cs +++ b/Floppy/Enums.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.Floppy { /// diff --git a/Floppy/ISO.cs b/Floppy/ISO.cs index 1fb6b28..6edc6d8 100644 --- a/Floppy/ISO.cs +++ b/Floppy/ISO.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Runtime.InteropServices; namespace DiscImageChef.Decoders.Floppy @@ -130,9 +129,9 @@ namespace DiscImageChef.Decoders.Floppy /// public IBMSectorSizeCode sectorSize; /// - /// CRC16 from to end of + /// CRC16 from to end of /// - public UInt16 crc; + public ushort crc; } /// @@ -161,7 +160,7 @@ namespace DiscImageChef.Decoders.Floppy /// /// CRC16 from to end of /// - public UInt16 crc; + public ushort crc; } } } diff --git a/Floppy/Perpendicular.cs b/Floppy/Perpendicular.cs index 2f4c3f0..7bc69a5 100644 --- a/Floppy/Perpendicular.cs +++ b/Floppy/Perpendicular.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Runtime.InteropServices; namespace DiscImageChef.Decoders.Floppy @@ -161,9 +160,9 @@ namespace DiscImageChef.Decoders.Floppy /// public IBMSectorSizeCode sectorSize; /// - /// CRC16 from to end of + /// CRC16 from to end of /// - public UInt16 crc; + public ushort crc; } /// @@ -192,7 +191,7 @@ namespace DiscImageChef.Decoders.Floppy /// /// CRC16 from to end of /// - public UInt16 crc; + public ushort crc; } } } diff --git a/Floppy/System34.cs b/Floppy/System34.cs index fb70d68..17821ed 100644 --- a/Floppy/System34.cs +++ b/Floppy/System34.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Runtime.InteropServices; namespace DiscImageChef.Decoders.Floppy @@ -162,9 +161,9 @@ namespace DiscImageChef.Decoders.Floppy /// public IBMSectorSizeCode sectorSize; /// - /// CRC16 from to end of + /// CRC16 from to end of /// - public UInt16 crc; + public ushort crc; } /// @@ -193,7 +192,7 @@ namespace DiscImageChef.Decoders.Floppy /// /// CRC16 from to end of /// - public UInt16 crc; + public ushort crc; } } } diff --git a/Floppy/System3740.cs b/Floppy/System3740.cs index bb9442f..b476dfa 100644 --- a/Floppy/System3740.cs +++ b/Floppy/System3740.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Runtime.InteropServices; namespace DiscImageChef.Decoders.Floppy @@ -152,7 +151,7 @@ namespace DiscImageChef.Decoders.Floppy /// /// CRC16 from to end of /// - public UInt16 crc; + public ushort crc; } /// @@ -176,7 +175,7 @@ namespace DiscImageChef.Decoders.Floppy /// /// CRC16 from to end of /// - public UInt16 crc; + public ushort crc; } } } diff --git a/SCSI/DiscStructureCapabilities.cs b/SCSI/DiscStructureCapabilities.cs index 21ac336..e6b53ab 100644 --- a/SCSI/DiscStructureCapabilities.cs +++ b/SCSI/DiscStructureCapabilities.cs @@ -30,7 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; using System.Collections.Generic; namespace DiscImageChef.Decoders.SCSI diff --git a/SCSI/EVPD.cs b/SCSI/EVPD.cs index f2cff3e..dab8f65 100644 --- a/SCSI/EVPD.cs +++ b/SCSI/EVPD.cs @@ -31,7 +31,6 @@ // ****************************************************************************/ using System; -using DiscImageChef; namespace DiscImageChef.Decoders.SCSI { diff --git a/SCSI/Enums.cs b/SCSI/Enums.cs index 004519c..385d5ba 100644 --- a/SCSI/Enums.cs +++ b/SCSI/Enums.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.SCSI { public enum PeripheralQualifiers : byte diff --git a/SCSI/Inquiry.cs b/SCSI/Inquiry.cs index e4a9556..1b20580 100644 --- a/SCSI/Inquiry.cs +++ b/SCSI/Inquiry.cs @@ -448,7 +448,7 @@ namespace DiscImageChef.Decoders.SCSI if(response.VersionDescriptors != null) { - foreach(UInt16 VersionDescriptor in response.VersionDescriptors) + foreach(ushort VersionDescriptor in response.VersionDescriptors) { switch(VersionDescriptor) { @@ -2140,7 +2140,7 @@ namespace DiscImageChef.Decoders.SCSI /// Array of version descriptors /// Bytes 58 to 73 /// - public UInt16[] VersionDescriptors; + public ushort[] VersionDescriptors; /// /// Reserved /// Bytes 74 to 95 diff --git a/SCSI/MMC/AACS.cs b/SCSI/MMC/AACS.cs index 0564ab9..45eff4a 100644 --- a/SCSI/MMC/AACS.cs +++ b/SCSI/MMC/AACS.cs @@ -58,7 +58,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -82,7 +82,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -106,7 +106,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -130,7 +130,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -154,7 +154,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// Data length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -178,7 +178,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// Data Length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -187,7 +187,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// /// Byte 3 /// Number of LBA extents the drive can store. - /// if(MaxLBAExtents == 0 && DataLength > 2), 256 extents can be stored + /// if(MaxLBAExtents == 0 && DataLength > 2), 256 extents can be stored /// public byte MaxLBAExtents; /// @@ -208,12 +208,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 8 to 11 /// Start LBA of extent /// - public UInt32 StartLBA; + public uint StartLBA; /// /// Bytes 12 to 15 /// Extent length /// - public UInt32 LBACount; + public uint LBACount; } public static AACSVolumeIdentifier? DecodeAACSVolumeIdentifier(byte[] AACSVIResponse) diff --git a/SCSI/MMC/CPRM.cs b/SCSI/MMC/CPRM.cs index 7c6cc13..7d7a7b3 100644 --- a/SCSI/MMC/CPRM.cs +++ b/SCSI/MMC/CPRM.cs @@ -58,7 +58,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// Data Length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/SCSI/MMC/DiscInformation.cs b/SCSI/MMC/DiscInformation.cs index f0ab764..13992fd 100644 --- a/SCSI/MMC/DiscInformation.cs +++ b/SCSI/MMC/DiscInformation.cs @@ -58,7 +58,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// 32 + OPCTablesNumber*8 /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2, bits 7 to 5 /// 000b @@ -88,17 +88,17 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Byte 9 (MSB) and byte 4 (LSB) /// Number of sessions /// - public UInt16 Sessions; + public ushort Sessions; /// /// Byte 10 (MSB) and byte 5 (LSB) /// Number of first track in last session /// - public UInt16 FirstTrackLastSession; + public ushort FirstTrackLastSession; /// /// Byte 11 (MSB) and byte 6 (LSB) /// Number of last track in last session /// - public UInt16 LastTrackLastSession; + public ushort LastTrackLastSession; /// /// Byte 7, bit 7 /// If set, DiscIdentification is valid @@ -143,22 +143,22 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 12 to 15 /// Disc identification number from PMA /// - public UInt32 DiscIdentification; + public uint DiscIdentification; /// /// Bytes 16 to 19 /// Last Session Lead-in Start Address (MSF for CD, LBA for others) /// - public UInt32 LastSessionLeadInStartLBA; + public uint LastSessionLeadInStartLBA; /// /// Bytes 20 to 23 /// Last Possible Lead-out Start Address (MSF for CD, LBA for others) /// - public UInt32 LastPossibleLeadOutStartLBA; + public uint LastPossibleLeadOutStartLBA; /// /// Bytes 24 to 31 /// Disc barcode /// - public UInt64 DiscBarcode; + public ulong DiscBarcode; /// /// Byte 32 /// Disc application code @@ -182,7 +182,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// kilobytes/sec this OPC table applies to /// - public UInt16 Speed; + public ushort Speed; /// /// Bytes 2 to 7 /// OPC values @@ -196,7 +196,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// 10 /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2, bits 7 to 5 /// 001b @@ -216,22 +216,22 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 4 to 5 /// Maximum possible number of the tracks on the disc /// - public UInt16 MaxTracks; + public ushort MaxTracks; /// /// Bytes 6 to 7 /// Number of the assigned tracks on the disc /// - public UInt16 AssignedTracks; + public ushort AssignedTracks; /// /// Bytes 8 to 9 /// Maximum possible number of appendable tracks on the disc /// - public UInt16 MaxAppendableTracks; + public ushort MaxAppendableTracks; /// /// Bytes 10 to 11 /// Current number of appendable tracks on the disc /// - public UInt16 AppendableTracks; + public ushort AppendableTracks; } public struct POWResourcesInformation @@ -240,7 +240,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// 14 /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2, bits 7 to 5 /// 010b @@ -260,17 +260,17 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 4 to 7 /// Remaining POW replacements /// - public UInt32 RemainingPOWReplacements; + public uint RemainingPOWReplacements; /// /// Bytes 8 to 11 /// Remaining POW reallocation map entries /// - public UInt32 RemainingPOWReallocation; + public uint RemainingPOWReallocation; /// /// Bytes 12 to 15 /// Number of remaining POW updates /// - public UInt32 RemainingPOWUpdates; + public uint RemainingPOWUpdates; } public static StandardDiscInformation? Decode000b(byte[] response) diff --git a/SCSI/MMC/Enums.cs b/SCSI/MMC/Enums.cs index eed8810..02bb7aa 100644 --- a/SCSI/MMC/Enums.cs +++ b/SCSI/MMC/Enums.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.SCSI.MMC { public enum FormatLayerTypeCodes : ushort diff --git a/SCSI/MMC/Features.cs b/SCSI/MMC/Features.cs index 0a125bc..8f70a46 100644 --- a/SCSI/MMC/Features.cs +++ b/SCSI/MMC/Features.cs @@ -5316,13 +5316,15 @@ namespace DiscImageChef.Decoders.SCSI.MMC try { - DateTime fwDate = new DateTime(Int32.Parse(syear), Int32.Parse(smonth), - Int32.Parse(sday), Int32.Parse(shour), Int32.Parse(sminute), - Int32.Parse(ssecond), DateTimeKind.Utc); + DateTime fwDate = new DateTime(int.Parse(syear), int.Parse(smonth), + int.Parse(sday), int.Parse(shour), int.Parse(sminute), + int.Parse(ssecond), DateTimeKind.Utc); sb.AppendFormat("Drive firmware is dated {0}", fwDate).AppendLine(); } +#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body catch +#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body { } diff --git a/SCSI/MMC/Hybrid.cs b/SCSI/MMC/Hybrid.cs index dd3a993..38ce22e 100644 --- a/SCSI/MMC/Hybrid.cs +++ b/SCSI/MMC/Hybrid.cs @@ -58,7 +58,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// Data Length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved @@ -98,7 +98,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 6 to end /// Recognized format layers /// - public UInt16[] FormatLayers; + public ushort[] FormatLayers; } public static RecognizedFormatLayers? DecodeFormatLayers(byte[] FormatLayersResponse) @@ -122,7 +122,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Reserved4 = (byte)((FormatLayersResponse[5] & 0x0C) >> 2); decoded.OnlineFormatLayer = (byte)(FormatLayersResponse[5] & 0x03); - decoded.FormatLayers = new UInt16[(FormatLayersResponse.Length - 6) / 2]; + decoded.FormatLayers = new ushort[(FormatLayersResponse.Length - 6) / 2]; for(int i = 0; i < (FormatLayersResponse.Length - 6) / 2; i++) { @@ -147,7 +147,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC { switch(response.FormatLayers[i]) { - case (UInt16)FormatLayerTypeCodes.BDLayer: + case (ushort)FormatLayerTypeCodes.BDLayer: { sb.AppendFormat("Layer {0} is of type Blu-ray", i).AppendLine(); if(response.DefaultFormatLayer == i) @@ -156,7 +156,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("This is the layer actually in use."); break; } - case (UInt16)FormatLayerTypeCodes.CDLayer: + case (ushort)FormatLayerTypeCodes.CDLayer: { sb.AppendFormat("Layer {0} is of type CD", i).AppendLine(); if(response.DefaultFormatLayer == i) @@ -165,7 +165,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("This is the layer actually in use."); break; } - case (UInt16)FormatLayerTypeCodes.DVDLayer: + case (ushort)FormatLayerTypeCodes.DVDLayer: { sb.AppendFormat("Layer {0} is of type DVD", i).AppendLine(); if(response.DefaultFormatLayer == i) @@ -174,7 +174,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("This is the layer actually in use."); break; } - case (UInt16)FormatLayerTypeCodes.HDDVDLayer: + case (ushort)FormatLayerTypeCodes.HDDVDLayer: { sb.AppendFormat("Layer {0} is of type HD DVD", i).AppendLine(); if(response.DefaultFormatLayer == i) diff --git a/SCSI/MMC/WriteProtect.cs b/SCSI/MMC/WriteProtect.cs index 42a50e9..24f31aa 100644 --- a/SCSI/MMC/WriteProtect.cs +++ b/SCSI/MMC/WriteProtect.cs @@ -58,7 +58,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC /// Bytes 0 to 1 /// Data Length /// - public UInt16 DataLength; + public ushort DataLength; /// /// Byte 2 /// Reserved diff --git a/SCSI/Modes.cs b/SCSI/Modes.cs index 29975f2..80efbf3 100644 --- a/SCSI/Modes.cs +++ b/SCSI/Modes.cs @@ -233,7 +233,7 @@ namespace DiscImageChef.Decoders.SCSI density = "15916 flux transitions per radian"; break; default: - density = String.Format("with unknown density code 0x{0:X2}", (byte)descriptor.Density); + density = string.Format("with unknown density code 0x{0:X2}", (byte)descriptor.Density); break; } @@ -272,7 +272,7 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("\tDevice uses a write cache but doesn't return until cache is flushed"); break; default: - sb.AppendFormat("\tUnknown buffered mode code 0x{0:X2}", (byte)header.Value.BufferedMode).AppendLine(); + sb.AppendFormat("\tUnknown buffered mode code 0x{0:X2}", header.Value.BufferedMode).AppendLine(); break; } @@ -463,7 +463,7 @@ namespace DiscImageChef.Decoders.SCSI medium = "Exatape 75m"; break; default: - medium = String.Format("unknown medium type 0x{0:X2}", (byte)header.Value.MediumType); + medium = string.Format("unknown medium type 0x{0:X2}", (byte)header.Value.MediumType); break; } @@ -601,7 +601,7 @@ namespace DiscImageChef.Decoders.SCSI density = "AIT-3"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -623,7 +623,7 @@ namespace DiscImageChef.Decoders.SCSI density = "LTO Ultrium-5 WORM"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -636,7 +636,7 @@ namespace DiscImageChef.Decoders.SCSI density = "LTO Ultrium"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -649,7 +649,7 @@ namespace DiscImageChef.Decoders.SCSI density = "LTO Ultrium-2"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -665,7 +665,7 @@ namespace DiscImageChef.Decoders.SCSI density = "DDS-3"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -681,7 +681,7 @@ namespace DiscImageChef.Decoders.SCSI density = "DDS-4"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -694,7 +694,7 @@ namespace DiscImageChef.Decoders.SCSI density = "DAT-72"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -708,7 +708,7 @@ namespace DiscImageChef.Decoders.SCSI density = "LTO Ultrium-3"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -721,7 +721,7 @@ namespace DiscImageChef.Decoders.SCSI density = "DDS cleaning cartridge"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -735,7 +735,7 @@ namespace DiscImageChef.Decoders.SCSI density = "LTO Ultrium-4"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -749,7 +749,7 @@ namespace DiscImageChef.Decoders.SCSI density = "LTO Ultrium-5"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -763,7 +763,7 @@ namespace DiscImageChef.Decoders.SCSI density = "LTO Ultrium-6"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -777,7 +777,7 @@ namespace DiscImageChef.Decoders.SCSI density = "LTO Ultrium-7"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -799,7 +799,7 @@ namespace DiscImageChef.Decoders.SCSI density = "LTO Ultrium-5 in CD emulation mode"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -833,7 +833,7 @@ namespace DiscImageChef.Decoders.SCSI density = "VXA-1"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -876,7 +876,7 @@ namespace DiscImageChef.Decoders.SCSI density = "VXA-3"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -914,7 +914,7 @@ namespace DiscImageChef.Decoders.SCSI density = "DLTtape III compressed"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -946,7 +946,7 @@ namespace DiscImageChef.Decoders.SCSI density = "DLTtape IIIxt compressed"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1000,7 +1000,7 @@ namespace DiscImageChef.Decoders.SCSI density = "DLTtape IV at 98250 bpi compressed"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1039,7 +1039,7 @@ namespace DiscImageChef.Decoders.SCSI density = "Super DLTtape I at 133000 bpi compressed"; break;*/ default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1052,7 +1052,7 @@ namespace DiscImageChef.Decoders.SCSI density = "Super DLTtape II"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1069,7 +1069,7 @@ namespace DiscImageChef.Decoders.SCSI density = "VStape I compressed"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1082,7 +1082,7 @@ namespace DiscImageChef.Decoders.SCSI density = "DLTtape S4"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1104,7 +1104,7 @@ namespace DiscImageChef.Decoders.SCSI density = "EXB-8500 compressed"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1129,7 +1129,7 @@ namespace DiscImageChef.Decoders.SCSI density = "Mammoth"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1154,7 +1154,7 @@ namespace DiscImageChef.Decoders.SCSI density = "Mammoth"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1179,7 +1179,7 @@ namespace DiscImageChef.Decoders.SCSI density = "Mammoth"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1201,7 +1201,7 @@ namespace DiscImageChef.Decoders.SCSI density = "Mammoth-2"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1214,7 +1214,7 @@ namespace DiscImageChef.Decoders.SCSI density = "DC-2900SL"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1227,7 +1227,7 @@ namespace DiscImageChef.Decoders.SCSI density = "DC-9250"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1240,7 +1240,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLR-32"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1253,7 +1253,7 @@ namespace DiscImageChef.Decoders.SCSI density = "MRL1-26GBSL"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1266,7 +1266,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLRtape-50"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1279,7 +1279,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLRtape-50 SL"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1292,7 +1292,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLR-32 SL"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1305,7 +1305,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLR-5"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1318,7 +1318,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLR-5 SL"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1331,7 +1331,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLRtape-7"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1344,7 +1344,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLRtape-7 SL"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1357,7 +1357,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLRtape-24"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1370,7 +1370,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLRtape-24 SL"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1383,7 +1383,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLRtape-140"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1396,7 +1396,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLRtape-40"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1409,7 +1409,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLRtape-60 or SLRtape-75"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1422,7 +1422,7 @@ namespace DiscImageChef.Decoders.SCSI density = "SLRtape-100"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } @@ -1435,13 +1435,13 @@ namespace DiscImageChef.Decoders.SCSI density = "SLR40, SLR60 or SLR100"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } } break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } @@ -1583,7 +1583,7 @@ namespace DiscImageChef.Decoders.SCSI density = "ANSI X3.200: 356 mm double-sided optical disc with 56350 tracks"; break; default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } @@ -1787,7 +1787,7 @@ namespace DiscImageChef.Decoders.SCSI density = "LTO Ultrium-5"; break; default: - density = String.Format("with unknown density code 0x{0:X2}", descriptor.Density); + density = string.Format("with unknown density code 0x{0:X2}", descriptor.Density); break; } @@ -1811,8 +1811,6 @@ namespace DiscImageChef.Decoders.SCSI break; } #endregion Multimedia device mode header - default: - break; } return sb.ToString(); @@ -2244,7 +2242,7 @@ namespace DiscImageChef.Decoders.SCSI if(page.BusyTimeoutPeriod == 0xFFFF) sb.AppendLine("\tThere is no limit on the maximum time that is allowed to remain busy"); else - sb.AppendFormat("\tA maximum of {0} ms are allowed to remain busy", (int)page.BusyTimeoutPeriod * 100).AppendLine(); + sb.AppendFormat("\tA maximum of {0} ms are allowed to remain busy", page.BusyTimeoutPeriod * 100).AppendLine(); } if(page.ExtendedSelfTestCompletionTime > 0) @@ -2372,17 +2370,17 @@ namespace DiscImageChef.Decoders.SCSI if(page.BufferEmptyRatio > 0) sb.AppendFormat("\t{0} ratio of buffer that shall be empty prior to attempting a reselection", page.BufferEmptyRatio).AppendLine(); if(page.BusInactivityLimit > 0) - sb.AppendFormat("\t{0} µs maximum permitted to assert BSY without a REQ/ACK handshake", (int)page.BusInactivityLimit * 100).AppendLine(); + sb.AppendFormat("\t{0} µs maximum permitted to assert BSY without a REQ/ACK handshake", page.BusInactivityLimit * 100).AppendLine(); if(page.DisconnectTimeLimit > 0) - sb.AppendFormat("\t{0} µs maximum permitted wait after releasing the bus before attempting reselection", (int)page.DisconnectTimeLimit * 100).AppendLine(); + sb.AppendFormat("\t{0} µs maximum permitted wait after releasing the bus before attempting reselection", page.DisconnectTimeLimit * 100).AppendLine(); if(page.ConnectTimeLimit > 0) - sb.AppendFormat("\t{0} µs allowed to use the bus before disconnecting, if granted the privilege and not restricted", (int)page.ConnectTimeLimit * 100).AppendLine(); + sb.AppendFormat("\t{0} µs allowed to use the bus before disconnecting, if granted the privilege and not restricted", page.ConnectTimeLimit * 100).AppendLine(); if(page.MaxBurstSize > 0) - sb.AppendFormat("\t{0} bytes maximum can be transferred before disconnecting", (int)page.MaxBurstSize * 512).AppendLine(); + sb.AppendFormat("\t{0} bytes maximum can be transferred before disconnecting", page.MaxBurstSize * 512).AppendLine(); if(page.FirstBurstSize > 0) - sb.AppendFormat("\t{0} bytes maximum can be transferred for a command along with the disconnect command", (int)page.FirstBurstSize * 512).AppendLine(); + sb.AppendFormat("\t{0} bytes maximum can be transferred for a command along with the disconnect command", page.FirstBurstSize * 512).AppendLine(); - if(page.DIMM) + if(page.DIMM) sb.AppendLine("\tTarget shall not transfer data for a command during the same interconnect tenancy"); if(page.EMDP) sb.AppendLine("\tTarget is allowed to re-order the data transfer"); @@ -3853,7 +3851,7 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendFormat("\tActive partition: {0}", page.ActivePartition).AppendLine(); sb.AppendFormat("\tWrite buffer shall have a full ratio of {0} before being flushed to medium", page.WriteBufferFullRatio).AppendLine(); sb.AppendFormat("\tRead buffer shall have an empty ratio of {0} before more data is read from medium", page.ReadBufferEmptyRatio).AppendLine(); - sb.AppendFormat("\tDrive will delay {0} ms before buffered data is forcefully written to the medium even before buffer is full", (int)page.WriteDelayTime * 100).AppendLine(); + sb.AppendFormat("\tDrive will delay {0} ms before buffered data is forcefully written to the medium even before buffer is full", page.WriteDelayTime * 100).AppendLine(); if(page.DBR) { sb.AppendLine("\tDrive supports recovering data from buffer"); @@ -6261,7 +6259,7 @@ namespace DiscImageChef.Decoders.SCSI #region Mode Page 0x1C: Timer & Protect page /// - /// Timer & Protect page + /// Timer & Protect page /// Page code 0x1C /// 8 bytes in INF-8070 /// diff --git a/SCSI/SSC/BlockLimits.cs b/SCSI/SSC/BlockLimits.cs index f5f48d8..075be42 100644 --- a/SCSI/SSC/BlockLimits.cs +++ b/SCSI/SSC/BlockLimits.cs @@ -88,7 +88,9 @@ namespace DiscImageChef.Decoders.SCSI.SSC sb.AppendFormat("Device's minimum block size is {0} bytes", decoded.Value.minBlockLen).AppendLine(); if(decoded.Value.granularity > 0) - sb.AppendFormat("Device's needs a block size granularity of 2^{0} ({1}) bytes", decoded.Value.granularity, Math.Pow(2, (double)decoded.Value.granularity)).AppendLine(); +#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)).AppendLine(); +#pragma warning restore IDE0004 // Remove Unnecessary Cast } return sb.ToString(); diff --git a/SCSI/SSC/DensitySupport.cs b/SCSI/SSC/DensitySupport.cs index c286434..f4ab771 100644 --- a/SCSI/SSC/DensitySupport.cs +++ b/SCSI/SSC/DensitySupport.cs @@ -166,8 +166,10 @@ 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)).AppendLine(); - sb.AppendFormat("\tDensity maximum capacity is {0} megabytes", descriptor.capacity).AppendLine(); +#pragma warning restore IDE0004 // Remove Unnecessary Cast + sb.AppendFormat("\tDensity maximum capacity is {0} megabytes", descriptor.capacity).AppendLine(); sb.AppendFormat("\tDensity description: {0}", descriptor.description).AppendLine(); sb.AppendLine(); } @@ -256,8 +258,10 @@ 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(); - sb.AppendFormat("\tMedium description: {0}", descriptor.description).AppendLine(); +#pragma warning restore IDE0004 // Remove Unnecessary Cast + sb.AppendFormat("\tMedium description: {0}", descriptor.description).AppendLine(); sb.AppendLine(); } diff --git a/SCSI/Sense.cs b/SCSI/Sense.cs index b2ada4e..fe6f0f7 100644 --- a/SCSI/Sense.cs +++ b/SCSI/Sense.cs @@ -396,9 +396,9 @@ namespace DiscImageChef.Decoders.SCSI if(!sense.HasValue) return null; - return sense.Value.AddressValid ? String.Format("Error class {0} type {1} happened on block {2}\n", + return sense.Value.AddressValid ? string.Format("Error class {0} type {1} happened on block {2}\n", sense.Value.ErrorClass, sense.Value.ErrorType, sense.Value.LBA) : - String.Format("Error class {0} type {1}\n", sense.Value.ErrorClass, + string.Format("Error class {0} type {1}\n", sense.Value.ErrorClass, sense.Value.ErrorType); } @@ -499,7 +499,7 @@ namespace DiscImageChef.Decoders.SCSI /// /// The information value /// Descriptor. - public static UInt64 DecodeDescriptor00(byte[] descriptor) + public static ulong DecodeDescriptor00(byte[] descriptor) { if(descriptor.Length != 12 || descriptor[0] != 0x00) return 0; @@ -523,7 +523,7 @@ namespace DiscImageChef.Decoders.SCSI /// /// The command-specific information sense data descriptor. /// Descriptor. - public static UInt64 DecodeDescriptor01(byte[] descriptor) + public static ulong DecodeDescriptor01(byte[] descriptor) { if(descriptor.Length != 12 || descriptor[0] != 0x01) return 0; @@ -640,9 +640,9 @@ namespace DiscImageChef.Decoders.SCSI throw new NotImplementedException("Check SBC-3"); } - public static string PrettifyDescriptor00(UInt64 information) + public static string PrettifyDescriptor00(ulong information) { - return String.Format("On logical block {0}\n", information); + return string.Format("On logical block {0}\n", information); } public static string PrettifyDescriptor00(byte[] descriptor) @@ -1884,7 +1884,7 @@ namespace DiscImageChef.Decoders.SCSI case 0x00: return "RAM FAILURE"; default: - return String.Format("DIAGNOSTIC FAILURE ON COMPONENT {0:X2}h", ASCQ); + return string.Format("DIAGNOSTIC FAILURE ON COMPONENT {0:X2}h", ASCQ); } case 0x41: switch(ASCQ) @@ -2031,7 +2031,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x4E: - return String.Format("OVERLAPPED COMMANDS ATTEMPTED FOR TASK TAG {0:X2}h", ASCQ); + return string.Format("OVERLAPPED COMMANDS ATTEMPTED FOR TASK TAG {0:X2}h", ASCQ); case 0x50: switch(ASCQ) { @@ -2566,7 +2566,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x70: - return String.Format("DECOMPRESSION EXCEPTION SHORT ALGORITHM ID OF {0:X2}h", ASCQ); + return string.Format("DECOMPRESSION EXCEPTION SHORT ALGORITHM ID OF {0:X2}h", ASCQ); case 0x71: switch(ASCQ) { @@ -2684,10 +2684,10 @@ namespace DiscImageChef.Decoders.SCSI } return ASC >= 0x80 ? ASCQ >= 0x80 ? - String.Format("VENDOR-SPECIFIC ASC {0:X2}h WITH VENDOR-SPECIFIC ASCQ {1:X2}h", ASC, ASCQ) : - String.Format("VENDOR-SPECIFIC ASC {0:X2}h WITH ASCQ {1:X2}h", ASC, ASCQ) : - ASCQ >= 0x80 ? String.Format("ASC {0:X2}h WITH VENDOR-SPECIFIC ASCQ {1:X2}h", ASC, ASCQ) : - String.Format("ASC {0:X2}h WITH ASCQ {1:X2}h", ASC, ASCQ); + string.Format("VENDOR-SPECIFIC ASC {0:X2}h WITH VENDOR-SPECIFIC ASCQ {1:X2}h", ASC, ASCQ) : + string.Format("VENDOR-SPECIFIC ASC {0:X2}h WITH ASCQ {1:X2}h", ASC, ASCQ) : + ASCQ >= 0x80 ? string.Format("ASC {0:X2}h WITH VENDOR-SPECIFIC ASCQ {1:X2}h", ASC, ASCQ) : + string.Format("ASC {0:X2}h WITH ASCQ {1:X2}h", ASC, ASCQ); } } } diff --git a/SCSI/Types.cs b/SCSI/Types.cs index 3f5e88f..f858aec 100644 --- a/SCSI/Types.cs +++ b/SCSI/Types.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.SCSI { public enum MediumTypes : byte @@ -827,7 +825,7 @@ namespace DiscImageChef.Decoders.SCSI /// Mammoth = 0x27, /// - /// IBM 3490 & 3490E + /// IBM 3490 & 3490E /// IBM3490E = 0x28, /// diff --git a/SCSI/VendorString.cs b/SCSI/VendorString.cs index 61d3190..6b7c072 100644 --- a/SCSI/VendorString.cs +++ b/SCSI/VendorString.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Decoders.SCSI { public static class VendorString diff --git a/Xbox/DMI.cs b/Xbox/DMI.cs index a19eb8e..bca141a 100644 --- a/Xbox/DMI.cs +++ b/Xbox/DMI.cs @@ -83,13 +83,13 @@ namespace DiscImageChef.Decoders.Xbox /// Bytes 4 to 7 /// 0x02 in XGD2 and XGD3 /// - public UInt32 Version; + public uint Version; /// /// Bytes 20 to 27 /// DMI timestamp /// - public Int64 Timestamp; + public long Timestamp; /// /// Bytes 36 to 51