diff --git a/ATA/Identify.cs b/ATA/Identify.cs
index 8943b860e..f0161ccf9 100644
--- a/ATA/Identify.cs
+++ b/ATA/Identify.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Text;
using DiscImageChef.Console;
@@ -52,6 +53,9 @@ namespace DiscImageChef.Decoders.ATA
/// T13-2161D rev. 5 (ACS-3)
/// CF+ & CF Specification rev. 1.4 (CFA)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Identify
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 2)]
@@ -3151,9 +3155,9 @@ namespace DiscImageChef.Decoders.ATA
if(ATAID.Capabilities3.HasFlag(CapabilitiesBit3.Sanitize))
{
sb.AppendLine().Append("Sanitize feature set is supported");
- if(ATAID.Capabilities3.HasFlag(CapabilitiesBit3.SanitizeCommands))
- sb.AppendLine().Append("Sanitize commands are specified by ACS-3 or higher");
- else sb.AppendLine().Append("Sanitize commands are specified by ACS-2");
+ sb.AppendLine().Append(ATAID.Capabilities3.HasFlag(CapabilitiesBit3.SanitizeCommands)
+ ? "Sanitize commands are specified by ACS-3 or higher"
+ : "Sanitize commands are specified by ACS-2");
if(ATAID.Capabilities3.HasFlag(CapabilitiesBit3.SanitizeAntifreeze))
sb.AppendLine().Append("SANITIZE ANTIFREEZE LOCK EXT is supported");
@@ -3239,19 +3243,21 @@ namespace DiscImageChef.Decoders.ATA
if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Enabled))
{
sb.AppendLine("Security is enabled");
- if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Locked)) sb.AppendLine("Security is locked");
- else sb.AppendLine("Security is not locked");
+ sb.AppendLine(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Locked)
+ ? "Security is locked"
+ : "Security is not locked");
- if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Frozen)) sb.AppendLine("Security is frozen");
- else sb.AppendLine("Security is not frozen");
+ sb.AppendLine(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Frozen)
+ ? "Security is frozen"
+ : "Security is not frozen");
- if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Expired))
- sb.AppendLine("Security count has expired");
- else sb.AppendLine("Security count has notexpired");
+ sb.AppendLine(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Expired)
+ ? "Security count has expired"
+ : "Security count has notexpired");
- if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Maximum))
- sb.AppendLine("Security level is maximum");
- else sb.AppendLine("Security level is high");
+ sb.AppendLine(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Maximum)
+ ? "Security level is maximum"
+ : "Security level is high");
}
else sb.AppendLine("Security is not enabled");
@@ -3382,8 +3388,7 @@ namespace DiscImageChef.Decoders.ATA
static string DescrambleATAString(byte[] buffer, int offset, int length)
{
- byte[] outbuf;
- outbuf = buffer[offset + length - 1] != 0x00 ? new byte[length + 1] : new byte[length];
+ byte[] outbuf = buffer[offset + length - 1] != 0x00 ? new byte[length + 1] : new byte[length];
for(int i = 0; i < length; i += 2)
{
diff --git a/ATA/Registers.cs b/ATA/Registers.cs
index 965daec30..00a7009db 100644
--- a/ATA/Registers.cs
+++ b/ATA/Registers.cs
@@ -32,72 +32,72 @@
namespace DiscImageChef.Decoders.ATA
{
- public struct AtaRegistersCHS
+ public struct AtaRegistersChs
{
- public byte feature;
- public byte sectorCount;
- public byte sector;
- public byte cylinderLow;
- public byte cylinderHigh;
- public byte deviceHead;
- public byte command;
+ public byte Feature;
+ public byte SectorCount;
+ public byte Sector;
+ public byte CylinderLow;
+ public byte CylinderHigh;
+ public byte DeviceHead;
+ public byte Command;
}
- public struct AtaRegistersLBA28
+ public struct AtaRegistersLba28
{
- public byte feature;
- public byte sectorCount;
- public byte lbaLow;
- public byte lbaMid;
- public byte lbaHigh;
- public byte deviceHead;
- public byte command;
+ public byte Feature;
+ public byte SectorCount;
+ public byte LbaLow;
+ public byte LbaMid;
+ public byte LbaHigh;
+ public byte DeviceHead;
+ public byte Command;
}
- public struct AtaRegistersLBA48
+ public struct AtaRegistersLba48
{
- public ushort feature;
- public ushort sectorCount;
- public ushort lbaLow;
- public ushort lbaMid;
- public ushort lbaHigh;
- public byte deviceHead;
- public byte command;
+ public ushort Feature;
+ public ushort SectorCount;
+ public ushort LbaLow;
+ public ushort LbaMid;
+ public ushort LbaHigh;
+ public byte DeviceHead;
+ public byte Command;
}
- public struct AtaErrorRegistersCHS
+ public struct AtaErrorRegistersChs
{
- public byte status;
- public byte error;
- public byte sectorCount;
- public byte sector;
- public byte cylinderLow;
- public byte cylinderHigh;
- public byte deviceHead;
- public byte command;
+ public byte Status;
+ public byte Error;
+ public byte SectorCount;
+ public byte Sector;
+ public byte CylinderLow;
+ public byte CylinderHigh;
+ public byte DeviceHead;
+ public byte Command;
}
- public struct AtaErrorRegistersLBA28
+ public struct AtaErrorRegistersLba28
{
- public byte status;
- public byte error;
- public byte sectorCount;
- public byte lbaLow;
- public byte lbaMid;
- public byte lbaHigh;
- public byte deviceHead;
- public byte command;
+ public byte Status;
+ public byte Error;
+ public byte SectorCount;
+ public byte LbaLow;
+ public byte LbaMid;
+ public byte LbaHigh;
+ public byte DeviceHead;
+ public byte Command;
}
- public struct AtaErrorRegistersLBA48
+ public struct AtaErrorRegistersLba48
{
- public byte status;
- public byte error;
- public ushort sectorCount;
- public ushort lbaLow;
- public ushort lbaMid;
- public ushort lbaHigh;
- public byte deviceHead;
- public byte command;
+ public byte Status;
+ public byte Error;
+ public ushort SectorCount;
+ public ushort LbaLow;
+ public ushort LbaMid;
+ public ushort LbaHigh;
+ public byte DeviceHead;
+ public byte Command;
}
}
\ No newline at end of file
diff --git a/Blu-ray/BCA.cs b/Blu-ray/BCA.cs
index a9684fbea..e9be91189 100644
--- a/Blu-ray/BCA.cs
+++ b/Blu-ray/BCA.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -51,6 +52,10 @@ namespace DiscImageChef.Decoders.Bluray
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class BCA
{
#region Public methods
diff --git a/Blu-ray/Cartridge.cs b/Blu-ray/Cartridge.cs
index b14ad3555..99ad147ca 100644
--- a/Blu-ray/Cartridge.cs
+++ b/Blu-ray/Cartridge.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -51,6 +52,11 @@ namespace DiscImageChef.Decoders.Bluray
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
+ [SuppressMessage("ReSharper", "UnassignedField.Global")]
public static class Cartridge
{
#region Public methods
diff --git a/Blu-ray/DDS.cs b/Blu-ray/DDS.cs
index 2c59db39d..8c7d97c3e 100644
--- a/Blu-ray/DDS.cs
+++ b/Blu-ray/DDS.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -51,6 +52,10 @@ namespace DiscImageChef.Decoders.Bluray
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class DDS
{
#region Private constants
diff --git a/Blu-ray/DI.cs b/Blu-ray/DI.cs
index 24d5938c9..2fe49b2b4 100644
--- a/Blu-ray/DI.cs
+++ b/Blu-ray/DI.cs
@@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -52,6 +53,10 @@ namespace DiscImageChef.Decoders.Bluray
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class DI
{
#region Private constants
@@ -93,8 +98,10 @@ namespace DiscImageChef.Decoders.Bluray
{
if(offset >= 100) break;
- DiscInformationUnits unit = new DiscInformationUnits();
- unit.Signature = BigEndianBitConverter.ToUInt16(DIResponse, 0 + offset);
+ DiscInformationUnits unit = new DiscInformationUnits
+ {
+ Signature = BigEndianBitConverter.ToUInt16(DIResponse, 0 + offset)
+ };
if(unit.Signature != DIUIdentifier) break;
diff --git a/Blu-ray/Spare.cs b/Blu-ray/Spare.cs
index 5fc35712e..6a80d2219 100644
--- a/Blu-ray/Spare.cs
+++ b/Blu-ray/Spare.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -51,6 +52,10 @@ namespace DiscImageChef.Decoders.Bluray
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class Spare
{
#region Public methods
diff --git a/CD/ATIP.cs b/CD/ATIP.cs
index 8356842c5..a98ba97e9 100644
--- a/CD/ATIP.cs
+++ b/CD/ATIP.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -51,6 +52,10 @@ namespace DiscImageChef.Decoders.CD
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class ATIP
{
public struct CDATIP
@@ -292,8 +297,7 @@ namespace DiscImageChef.Decoders.CD
if(response.DDCD)
{
sb.AppendFormat("Indicative Target Writing Power: 0x{0:X2}", response.ITWP).AppendLine();
- if(response.DiscType) sb.AppendLine("Disc is DDCD-RW");
- else sb.AppendLine("Disc is DDCD-R");
+ sb.AppendLine(response.DiscType ? "Disc is DDCD-RW" : "Disc is DDCD-R");
switch(response.ReferenceSpeed)
{
case 2:
@@ -398,8 +402,7 @@ namespace DiscImageChef.Decoders.CD
}
}
- if(response.URU) sb.AppendLine("Disc use is unrestricted");
- else sb.AppendLine("Disc use is restricted");
+ sb.AppendLine(response.URU ? "Disc use is unrestricted" : "Disc use is restricted");
sb.AppendFormat("ATIP Start time of Lead-in: {0}:{1:D2}:{2:D2}", response.LeadInStartMin,
response.LeadInStartSec, response.LeadInStartFrame).AppendLine();
@@ -428,16 +431,16 @@ namespace DiscImageChef.Decoders.CD
int type = response.LeadInStartFrame % 10;
int frm = response.LeadInStartFrame - type;
- string manufacturer;
if(response.DiscType) sb.AppendLine("Disc uses phase change");
else
{
- if(type < 5) sb.AppendLine("Disc uses long strategy type dye (Cyanine, AZO, etc...)");
- else sb.AppendLine("Disc uses short strategy type dye (Phthalocyanine, etc...)");
+ sb.AppendLine(type < 5
+ ? "Disc uses long strategy type dye (Cyanine, AZO, etc...)"
+ : "Disc uses short strategy type dye (Phthalocyanine, etc...)");
}
- manufacturer = ManufacturerFromATIP(response.LeadInStartSec, frm);
+ string manufacturer = ManufacturerFromATIP(response.LeadInStartSec, frm);
if(manufacturer != "") sb.AppendFormat("Disc manufactured by: {0}", manufacturer).AppendLine();
diff --git a/CD/CDTextOnLeadIn.cs b/CD/CDTextOnLeadIn.cs
index 2732bf6a6..832ccfe27 100644
--- a/CD/CDTextOnLeadIn.cs
+++ b/CD/CDTextOnLeadIn.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -51,6 +52,10 @@ namespace DiscImageChef.Decoders.CD
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class CDTextOnLeadIn
{
public enum PackTypeIndicator : byte
diff --git a/CD/Enums.cs b/CD/Enums.cs
index 4a9f165a9..2698510dc 100644
--- a/CD/Enums.cs
+++ b/CD/Enums.cs
@@ -30,9 +30,12 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.CD
{
- public enum TOC_ADR : byte
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ public enum TocAdr : byte
{
///
/// Q Sub-channel mode information not supplied
@@ -60,7 +63,7 @@ namespace DiscImageChef.Decoders.CD
VideoTrackPointer = 0x04
}
- public enum TOC_CONTROL : byte
+ public enum TocControl : byte
{
///
/// Stereo audio, no pre-emphasis
diff --git a/CD/FullTOC.cs b/CD/FullTOC.cs
index 717c6e278..27bc297e0 100644
--- a/CD/FullTOC.cs
+++ b/CD/FullTOC.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -53,6 +54,9 @@ namespace DiscImageChef.Decoders.CD
/// ISO/IEC 61104: Compact disc video system - 12 cm CD-V
/// ISO/IEC 60908: Audio recording - Compact disc digital audio system
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class FullTOC
{
const string StereoNoPre = "Stereo audio track with no pre-emphasis";
@@ -270,24 +274,24 @@ namespace DiscImageChef.Decoders.CD
else
{
sb.AppendFormat("First track number: {0} (", descriptor.PMIN);
- switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
+ switch((TocControl)(descriptor.CONTROL & 0x0D))
{
- case TOC_CONTROL.TwoChanNoPreEmph:
+ case TocControl.TwoChanNoPreEmph:
sb.Append(StereoNoPre);
break;
- case TOC_CONTROL.TwoChanPreEmph:
+ case TocControl.TwoChanPreEmph:
sb.Append(StereoPreEm);
break;
- case TOC_CONTROL.FourChanNoPreEmph:
+ case TocControl.FourChanNoPreEmph:
sb.Append(QuadNoPreEm);
break;
- case TOC_CONTROL.FourChanPreEmph:
+ case TocControl.FourChanPreEmph:
sb.Append(QuadPreEmph);
break;
- case TOC_CONTROL.DataTrack:
+ case TocControl.DataTrack:
sb.Append(DataUnintrp);
break;
- case TOC_CONTROL.DataTrackIncremental:
+ case TocControl.DataTrackIncremental:
sb.Append(DataIncrtly);
break;
}
@@ -306,24 +310,24 @@ namespace DiscImageChef.Decoders.CD
else
{
sb.AppendFormat("Last track number: {0} (", descriptor.PMIN);
- switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
+ switch((TocControl)(descriptor.CONTROL & 0x0D))
{
- case TOC_CONTROL.TwoChanNoPreEmph:
+ case TocControl.TwoChanNoPreEmph:
sb.Append(StereoNoPre);
break;
- case TOC_CONTROL.TwoChanPreEmph:
+ case TocControl.TwoChanPreEmph:
sb.Append(StereoPreEm);
break;
- case TOC_CONTROL.FourChanNoPreEmph:
+ case TocControl.FourChanNoPreEmph:
sb.Append(QuadNoPreEm);
break;
- case TOC_CONTROL.FourChanPreEmph:
+ case TocControl.FourChanPreEmph:
sb.Append(QuadPreEmph);
break;
- case TOC_CONTROL.DataTrack:
+ case TocControl.DataTrack:
sb.Append(DataUnintrp);
break;
- case TOC_CONTROL.DataTrackIncremental:
+ case TocControl.DataTrackIncremental:
sb.Append(DataIncrtly);
break;
}
@@ -345,16 +349,16 @@ namespace DiscImageChef.Decoders.CD
.AppendLine();
//sb.AppendFormat("Absolute time: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).AppendLine();
- switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
+ switch((TocControl)(descriptor.CONTROL & 0x0D))
{
- case TOC_CONTROL.TwoChanNoPreEmph:
- case TOC_CONTROL.TwoChanPreEmph:
- case TOC_CONTROL.FourChanNoPreEmph:
- case TOC_CONTROL.FourChanPreEmph:
+ case TocControl.TwoChanNoPreEmph:
+ case TocControl.TwoChanPreEmph:
+ case TocControl.FourChanNoPreEmph:
+ case TocControl.FourChanPreEmph:
sb.AppendLine("Lead-out is audio type");
break;
- case TOC_CONTROL.DataTrack:
- case TOC_CONTROL.DataTrackIncremental:
+ case TocControl.DataTrack:
+ case TocControl.DataTrackIncremental:
sb.AppendLine("Lead-out is data type");
break;
}
@@ -385,9 +389,9 @@ namespace DiscImageChef.Decoders.CD
{
string type = "Audio";
- if((TOC_CONTROL)(descriptor.CONTROL & 0x0D) == TOC_CONTROL.DataTrack ||
- (TOC_CONTROL)(descriptor.CONTROL & 0x0D) ==
- TOC_CONTROL.DataTrackIncremental) type = "Data";
+ if((TocControl)(descriptor.CONTROL & 0x0D) == TocControl.DataTrack ||
+ (TocControl)(descriptor.CONTROL & 0x0D) ==
+ TocControl.DataTrackIncremental) type = "Data";
if(descriptor.PHOUR > 0)
sb.AppendFormat("{5} track {3} starts at: {4:D2}:{0:D2}:{1:D2}:{2:D2} (",
@@ -398,24 +402,24 @@ namespace DiscImageChef.Decoders.CD
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.POINT, type);
- switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
+ switch((TocControl)(descriptor.CONTROL & 0x0D))
{
- case TOC_CONTROL.TwoChanNoPreEmph:
+ case TocControl.TwoChanNoPreEmph:
sb.Append(StereoNoPre);
break;
- case TOC_CONTROL.TwoChanPreEmph:
+ case TocControl.TwoChanPreEmph:
sb.Append(StereoPreEm);
break;
- case TOC_CONTROL.FourChanNoPreEmph:
+ case TocControl.FourChanNoPreEmph:
sb.Append(QuadNoPreEm);
break;
- case TOC_CONTROL.FourChanPreEmph:
+ case TocControl.FourChanPreEmph:
sb.Append(QuadPreEmph);
break;
- case TOC_CONTROL.DataTrack:
+ case TocControl.DataTrack:
sb.Append(DataUnintrp);
break;
- case TOC_CONTROL.DataTrackIncremental:
+ case TocControl.DataTrackIncremental:
sb.Append(DataIncrtly);
break;
}
diff --git a/CD/PMA.cs b/CD/PMA.cs
index 30dbb848e..b09e29a26 100644
--- a/CD/PMA.cs
+++ b/CD/PMA.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -51,6 +52,9 @@ namespace DiscImageChef.Decoders.CD
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class PMA
{
public struct CDPMA
@@ -198,24 +202,24 @@ namespace DiscImageChef.Decoders.CD
if(descriptor.POINT > 0)
{
sb.AppendFormat("Track {0}", descriptor.POINT);
- switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
+ switch((TocControl)(descriptor.CONTROL & 0x0D))
{
- case TOC_CONTROL.TwoChanNoPreEmph:
+ case TocControl.TwoChanNoPreEmph:
sb.Append(" (Stereo audio track with no pre-emphasis)");
break;
- case TOC_CONTROL.TwoChanPreEmph:
+ case TocControl.TwoChanPreEmph:
sb.Append(" (Stereo audio track with 50/15 μs pre-emphasis)");
break;
- case TOC_CONTROL.FourChanNoPreEmph:
+ case TocControl.FourChanNoPreEmph:
sb.Append(" (Quadraphonic audio track with no pre-emphasis)");
break;
- case TOC_CONTROL.FourChanPreEmph:
+ case TocControl.FourChanPreEmph:
sb.Append(" (Quadraphonic audio track with 50/15 μs pre-emphasis)");
break;
- case TOC_CONTROL.DataTrack:
+ case TocControl.DataTrack:
sb.Append(" (Data track, recorded uninterrupted)");
break;
- case TOC_CONTROL.DataTrackIncremental:
+ case TocControl.DataTrackIncremental:
sb.Append(" (Data track, recorded incrementally)");
break;
}
diff --git a/CD/Sector.cs b/CD/Sector.cs
index c16b4b05a..9fa983ed8 100644
--- a/CD/Sector.cs
+++ b/CD/Sector.cs
@@ -31,10 +31,14 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
namespace DiscImageChef.Decoders.CD
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Sector
{
public static readonly byte[] ScrambleTable =
diff --git a/CD/Session.cs b/CD/Session.cs
index b39bc09b7..21904a8f4 100644
--- a/CD/Session.cs
+++ b/CD/Session.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -51,6 +52,9 @@ namespace DiscImageChef.Decoders.CD
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Session
{
public struct CDSessionInfo
@@ -161,51 +165,52 @@ namespace DiscImageChef.Decoders.CD
(descriptor.TrackStartAddress & 0x00FF0000) >> 16,
(descriptor.TrackStartAddress & 0xFF000000) >> 24).AppendLine();
- switch((TOC_ADR)descriptor.ADR)
+ switch((TocAdr)descriptor.ADR)
{
- case TOC_ADR.NoInformation:
+ case TocAdr.NoInformation:
sb.AppendLine("Q subchannel mode not given");
break;
- case TOC_ADR.CurrentPosition:
+ case TocAdr.CurrentPosition:
sb.AppendLine("Q subchannel stores current position");
break;
- case TOC_ADR.ISRC:
+ case TocAdr.ISRC:
sb.AppendLine("Q subchannel stores ISRC");
break;
- case TOC_ADR.MediaCatalogNumber:
+ case TocAdr.MediaCatalogNumber:
sb.AppendLine("Q subchannel stores media catalog number");
break;
}
- if((descriptor.CONTROL & (byte)TOC_CONTROL.ReservedMask) == (byte)TOC_CONTROL.ReservedMask)
+ if((descriptor.CONTROL & (byte)TocControl.ReservedMask) == (byte)TocControl.ReservedMask)
sb.AppendFormat("Reserved flags 0x{0:X2} set", descriptor.CONTROL).AppendLine();
else
{
- switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
+ switch((TocControl)(descriptor.CONTROL & 0x0D))
{
- case TOC_CONTROL.TwoChanNoPreEmph:
+ case TocControl.TwoChanNoPreEmph:
sb.AppendLine("Stereo audio track with no pre-emphasis");
break;
- case TOC_CONTROL.TwoChanPreEmph:
+ case TocControl.TwoChanPreEmph:
sb.AppendLine("Stereo audio track with 50/15 μs pre-emphasis");
break;
- case TOC_CONTROL.FourChanNoPreEmph:
+ case TocControl.FourChanNoPreEmph:
sb.AppendLine("Quadraphonic audio track with no pre-emphasis");
break;
- case TOC_CONTROL.FourChanPreEmph:
+ case TocControl.FourChanPreEmph:
sb.AppendLine("Stereo audio track with 50/15 μs pre-emphasis");
break;
- case TOC_CONTROL.DataTrack:
+ case TocControl.DataTrack:
sb.AppendLine("Data track, recorded uninterrupted");
break;
- case TOC_CONTROL.DataTrackIncremental:
+ case TocControl.DataTrackIncremental:
sb.AppendLine("Data track, recorded incrementally");
break;
}
- if((descriptor.CONTROL & (byte)TOC_CONTROL.CopyPermissionMask) ==
- (byte)TOC_CONTROL.CopyPermissionMask) sb.AppendLine("Digital copy of track is permitted");
- else sb.AppendLine("Digital copy of track is prohibited");
+ sb.AppendLine((descriptor.CONTROL & (byte)TocControl.CopyPermissionMask) ==
+ (byte)TocControl.CopyPermissionMask
+ ? "Digital copy of track is permitted"
+ : "Digital copy of track is prohibited");
#if DEBUG
if(descriptor.Reserved1 != 0)
diff --git a/CD/TOC.cs b/CD/TOC.cs
index 3f5b7b2e1..62d703a29 100644
--- a/CD/TOC.cs
+++ b/CD/TOC.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Console;
@@ -53,6 +54,9 @@ namespace DiscImageChef.Decoders.CD
/// ISO/IEC 61104: Compact disc video system - 12 cm CD-V
/// ISO/IEC 60908: Audio recording - Compact disc digital audio system
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class TOC
{
public struct CDTOC
@@ -163,21 +167,21 @@ namespace DiscImageChef.Decoders.CD
(descriptor.TrackStartAddress & 0x00FF0000) >> 16,
(descriptor.TrackStartAddress & 0xFF000000) >> 24).AppendLine();
- switch((TOC_ADR)descriptor.ADR)
+ switch((TocAdr)descriptor.ADR)
{
- case TOC_ADR.NoInformation:
+ case TocAdr.NoInformation:
sb.AppendLine("Q subchannel mode not given");
break;
- case TOC_ADR.TrackPointer:
+ case TocAdr.TrackPointer:
sb.AppendLine("Q subchannel stores track pointer");
break;
- case TOC_ADR.VideoTrackPointer:
+ case TocAdr.VideoTrackPointer:
sb.AppendLine("Q subchannel stores video track pointer");
break;
- case TOC_ADR.ISRC:
+ case TocAdr.ISRC:
sb.AppendLine("Q subchannel stores ISRC");
break;
- case TOC_ADR.MediaCatalogNumber:
+ case TocAdr.MediaCatalogNumber:
sb.AppendLine("Q subchannel stores media catalog number");
break;
default:
@@ -185,35 +189,36 @@ namespace DiscImageChef.Decoders.CD
break;
}
- if((descriptor.CONTROL & (byte)TOC_CONTROL.ReservedMask) == (byte)TOC_CONTROL.ReservedMask)
+ if((descriptor.CONTROL & (byte)TocControl.ReservedMask) == (byte)TocControl.ReservedMask)
sb.AppendFormat("Reserved flags 0x{0:X2} set", descriptor.CONTROL).AppendLine();
else
{
- switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
+ switch((TocControl)(descriptor.CONTROL & 0x0D))
{
- case TOC_CONTROL.TwoChanNoPreEmph:
+ case TocControl.TwoChanNoPreEmph:
sb.AppendLine("Stereo audio track with no pre-emphasis");
break;
- case TOC_CONTROL.TwoChanPreEmph:
+ case TocControl.TwoChanPreEmph:
sb.AppendLine("Stereo audio track with 50/15 μs pre-emphasis");
break;
- case TOC_CONTROL.FourChanNoPreEmph:
+ case TocControl.FourChanNoPreEmph:
sb.AppendLine("Quadraphonic audio track with no pre-emphasis");
break;
- case TOC_CONTROL.FourChanPreEmph:
+ case TocControl.FourChanPreEmph:
sb.AppendLine("Quadraphonic audio track with 50/15 μs pre-emphasis");
break;
- case TOC_CONTROL.DataTrack:
+ case TocControl.DataTrack:
sb.AppendLine("Data track, recorded uninterrupted");
break;
- case TOC_CONTROL.DataTrackIncremental:
+ case TocControl.DataTrackIncremental:
sb.AppendLine("Data track, recorded incrementally");
break;
}
- if((descriptor.CONTROL & (byte)TOC_CONTROL.CopyPermissionMask) ==
- (byte)TOC_CONTROL.CopyPermissionMask) sb.AppendLine("Digital copy of track is permitted");
- else sb.AppendLine("Digital copy of track is prohibited");
+ sb.AppendLine((descriptor.CONTROL & (byte)TocControl.CopyPermissionMask) ==
+ (byte)TocControl.CopyPermissionMask
+ ? "Digital copy of track is permitted"
+ : "Digital copy of track is prohibited");
#if DEBUG
if(descriptor.Reserved1 != 0)
diff --git a/DVD/AACS.cs b/DVD/AACS.cs
index 6deab609f..84776e34f 100644
--- a/DVD/AACS.cs
+++ b/DVD/AACS.cs
@@ -30,6 +30,8 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.DVD
{
///
@@ -48,6 +50,9 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1836-D revision 2g
/// ECMA 365
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class AACS
{
public struct HDLeadInCopyright
diff --git a/DVD/ADIP.cs b/DVD/ADIP.cs
index 90aed4b75..575cbb0ec 100644
--- a/DVD/ADIP.cs
+++ b/DVD/ADIP.cs
@@ -30,6 +30,8 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.DVD
{
///
@@ -48,6 +50,9 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1836-D revision 2g
/// ECMA 365
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class ADIP
{
public struct ADIPInformation
diff --git a/DVD/BCA.cs b/DVD/BCA.cs
index 617f5a42e..b22ac62d0 100644
--- a/DVD/BCA.cs
+++ b/DVD/BCA.cs
@@ -30,6 +30,8 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.DVD
{
///
@@ -48,6 +50,9 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1836-D revision 2g
/// ECMA 365
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class BCA
{
public struct BurstCuttingArea
diff --git a/DVD/CPRM.cs b/DVD/CPRM.cs
index c3bd3c1ff..2daf15de7 100644
--- a/DVD/CPRM.cs
+++ b/DVD/CPRM.cs
@@ -30,6 +30,8 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.DVD
{
///
@@ -48,6 +50,9 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1836-D revision 2g
/// ECMA 365
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class CPRM
{
public struct DiscMediaIdentifier
diff --git a/DVD/CSS&CPRM.cs b/DVD/CSS&CPRM.cs
index ceaa61f69..1ce578d80 100644
--- a/DVD/CSS&CPRM.cs
+++ b/DVD/CSS&CPRM.cs
@@ -30,6 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.DVD
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1836-D revision 2g
/// ECMA 365
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class CSS_CPRM
{
public struct LeadInCopyright
@@ -117,21 +122,18 @@ namespace DiscImageChef.Decoders.DVD
public static LeadInCopyright? DecodeLeadInCopyright(byte[] response)
{
- if(response == null) return null;
+ if(response?.Length != 8) return null;
- if(response.Length != 8) return null;
-
- LeadInCopyright cmi = new LeadInCopyright();
-
- cmi.DataLength = (ushort)((response[0] << 8) + response[1]);
- cmi.Reserved1 = response[2];
- cmi.Reserved2 = response[3];
- cmi.CopyrightType = (CopyrightType)response[4];
- cmi.RegionInformation = response[5];
- cmi.Reserved3 = response[6];
- cmi.Reserved4 = response[7];
-
- return cmi;
+ return new LeadInCopyright
+ {
+ DataLength = (ushort)((response[0] << 8) + response[1]),
+ Reserved1 = response[2],
+ Reserved2 = response[3],
+ CopyrightType = (CopyrightType)response[4],
+ RegionInformation = response[5],
+ Reserved3 = response[6],
+ Reserved4 = response[7]
+ };
}
public static string PrettifyLeadInCopyright(LeadInCopyright? cmi)
diff --git a/DVD/Cartridge.cs b/DVD/Cartridge.cs
index e061ab9d9..23e425809 100644
--- a/DVD/Cartridge.cs
+++ b/DVD/Cartridge.cs
@@ -30,6 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.DVD
@@ -49,6 +50,10 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class Cartridge
{
public struct MediumStatus
@@ -122,27 +127,24 @@ namespace DiscImageChef.Decoders.DVD
public static MediumStatus? Decode(byte[] response)
{
- if(response == null) return null;
+ if(response?.Length != 8) return null;
- if(response.Length != 8) return null;
-
- MediumStatus status = new MediumStatus();
-
- status.DataLength = (ushort)((response[0] << 8) + response[1]);
- status.Reserved1 = response[2];
- status.Reserved2 = response[3];
- status.Cartridge |= (response[4] & 0x80) == 0x80;
- status.OUT |= (response[4] & 0x40) == 0x40;
- status.Reserved3 = (byte)((response[4] & 0x30) >> 4);
- status.MSWI |= (response[4] & 0x08) == 0x08;
- status.CWP |= (response[4] & 0x04) == 0x04;
- status.PWP |= (response[4] & 0x02) == 0x02;
- status.Reserved4 |= (response[4] & 0x01) == 0x01;
- status.DiscType = response[5];
- status.Reserved5 = response[6];
- status.RAMSWI = response[7];
-
- return status;
+ return new MediumStatus
+ {
+ DataLength = (ushort)((response[0] << 8) + response[1]),
+ Reserved1 = response[2],
+ Reserved2 = response[3],
+ Cartridge = (response[4] & 0x80) == 0x80,
+ OUT = (response[4] & 0x40) == 0x40,
+ Reserved3 = (byte)((response[4] & 0x30) >> 4),
+ MSWI = (response[4] & 0x08) == 0x08,
+ CWP = (response[4] & 0x04) == 0x04,
+ PWP = (response[4] & 0x02) == 0x02,
+ Reserved4 = (response[4] & 0x01) == 0x01,
+ DiscType = response[5],
+ Reserved5 = response[6],
+ RAMSWI = response[7]
+ };
}
public static string Prettify(MediumStatus? status)
diff --git a/DVD/DDS.cs b/DVD/DDS.cs
index cf37e0c16..ded9727cd 100644
--- a/DVD/DDS.cs
+++ b/DVD/DDS.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.DVD
@@ -52,6 +53,10 @@ namespace DiscImageChef.Decoders.DVD
/// ECMA 272: 120 mm DVD Rewritable Disk (DVD-RAM)
/// ECMA 330: 120 mm (4,7 Gbytes per side) and 80 mm (1,46 Gbytes per side) DVD Rewritable Disk (DVD-RAM)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class DDS
{
public struct DiscDefinitionStructure
@@ -196,13 +201,10 @@ namespace DiscImageChef.Decoders.DVD
public static DiscDefinitionStructure? Decode(byte[] response)
{
- if(response == null) return null;
+ if(response?.Length != 2052) return null;
- if(response.Length != 2052) return null;
-
- DiscDefinitionStructure dds = new DiscDefinitionStructure();
-
- dds.Identifier = (ushort)((response[4] << 8) + response[5]);
+ DiscDefinitionStructure dds =
+ new DiscDefinitionStructure {Identifier = (ushort)((response[4] << 8) + response[5])};
if(dds.Identifier != 0x0A0A) return null;
diff --git a/DVD/DMI.cs b/DVD/DMI.cs
index 4b43af82e..fe3070e46 100644
--- a/DVD/DMI.cs
+++ b/DVD/DMI.cs
@@ -30,6 +30,8 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.DVD
{
///
@@ -48,6 +50,9 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1836-D revision 2g
/// ECMA 365
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class DMI
{
public struct DiscManufacturingInformation
diff --git a/DVD/Enums.cs b/DVD/Enums.cs
index fa29327c6..34bfb5e5b 100644
--- a/DVD/Enums.cs
+++ b/DVD/Enums.cs
@@ -30,9 +30,12 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.DVD
{
#region Public enumerations
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum DiskCategory : byte
{
///
@@ -94,6 +97,7 @@ namespace DiscImageChef.Decoders.DVD
Nintendo = 15
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum MaximumRateField : byte
{
///
@@ -119,6 +123,7 @@ namespace DiscImageChef.Decoders.DVD
Unspecified = 0x0F
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum LayerTypeFieldMask : byte
{
Embossed = 0x01,
@@ -127,6 +132,7 @@ namespace DiscImageChef.Decoders.DVD
Reserved = 0x08
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum LinearDensityField : byte
{
///
@@ -159,6 +165,7 @@ namespace DiscImageChef.Decoders.DVD
ThreeFive = 0x08
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum TrackDensityField : byte
{
///
@@ -183,6 +190,7 @@ namespace DiscImageChef.Decoders.DVD
Three = 0x04
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum CopyrightType : byte
{
///
@@ -203,6 +211,7 @@ namespace DiscImageChef.Decoders.DVD
AACS = 0x10
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum WPDiscTypes : byte
{
///
@@ -217,6 +226,7 @@ namespace DiscImageChef.Decoders.DVD
Reserved2 = 0x03
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum DVDSize
{
///
@@ -229,6 +239,7 @@ namespace DiscImageChef.Decoders.DVD
Eighty = 1
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum DVDRAMDiscType
{
///
@@ -241,6 +252,7 @@ namespace DiscImageChef.Decoders.DVD
Uncased = 1
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum DVDLayerStructure
{
Unspecified = 0,
@@ -249,6 +261,7 @@ namespace DiscImageChef.Decoders.DVD
Reserved = 3
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum DVDRecordingSpeed
{
None = 0,
diff --git a/DVD/Layers.cs b/DVD/Layers.cs
index 9e9fe57a5..45d431438 100644
--- a/DVD/Layers.cs
+++ b/DVD/Layers.cs
@@ -30,6 +30,8 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.DVD
{
///
@@ -48,6 +50,9 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1836-D revision 2g
/// ECMA 365
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Layers
{
public struct LayerCapacity
diff --git a/DVD/PFI.cs b/DVD/PFI.cs
index 00542f95a..20086e019 100644
--- a/DVD/PFI.cs
+++ b/DVD/PFI.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.DVD
@@ -66,6 +67,9 @@ namespace DiscImageChef.Decoders.DVD
/// ECMA 382: 120 mm (8,54 Gbytes per side) and 80 mm (2,66 Gbytes per side) DVD Recordable Disk for Dual Layer (DVD-R for DL)
/// ECMA 384: 120 mm (8,54 Gbytes per side) and 80 mm (2,66 Gbytes per side) DVD Re-recordable Disk for Dual Layer (DVD-RW for DL)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class PFI
{
public struct PhysicalFormatInformation
diff --git a/DVD/PRI.cs b/DVD/PRI.cs
index 632f092ad..7bd281af6 100644
--- a/DVD/PRI.cs
+++ b/DVD/PRI.cs
@@ -30,6 +30,8 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.DVD
{
///
@@ -48,6 +50,9 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1836-D revision 2g
/// ECMA 365
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class PRI
{
public struct PreRecordedInformation
diff --git a/DVD/RMD.cs b/DVD/RMD.cs
index a57d1d925..c57f89f53 100644
--- a/DVD/RMD.cs
+++ b/DVD/RMD.cs
@@ -30,6 +30,8 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.DVD
{
///
@@ -48,6 +50,9 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1836-D revision 2g
/// ECMA 365
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class RMD
{
public struct LastBorderOutRMD
diff --git a/DVD/Spare.cs b/DVD/Spare.cs
index 74a91aa04..2db3529d4 100644
--- a/DVD/Spare.cs
+++ b/DVD/Spare.cs
@@ -30,6 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.DVD
@@ -49,6 +50,10 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class Spare
{
public struct SpareAreaInformation
@@ -87,23 +92,20 @@ namespace DiscImageChef.Decoders.DVD
public static SpareAreaInformation? Decode(byte[] response)
{
- if(response == null) return null;
+ if(response?.Length != 16) return null;
- if(response.Length != 16) return null;
-
- SpareAreaInformation sai = new SpareAreaInformation();
-
- sai.DataLength = (ushort)((response[0] << 8) + response[1]);
- sai.Reserved1 = response[2];
- sai.Reserved2 = response[3];
- sai.UnusedPrimaryBlocks =
- (uint)((response[4] << 24) + (response[5] << 16) + (response[6] << 8) + response[7]);
- sai.UnusedSupplementaryBlocks =
- (uint)((response[8] << 24) + (response[9] << 16) + (response[10] << 8) + response[11]);
- sai.AllocatedSupplementaryBlocks =
- (uint)((response[12] << 24) + (response[13] << 16) + (response[14] << 8) + response[15]);
-
- return sai;
+ return new SpareAreaInformation
+ {
+ DataLength = (ushort)((response[0] << 8) + response[1]),
+ Reserved1 = response[2],
+ Reserved2 = response[3],
+ UnusedPrimaryBlocks =
+ (uint)((response[4] << 24) + (response[5] << 16) + (response[6] << 8) + response[7]),
+ UnusedSupplementaryBlocks =
+ (uint)((response[8] << 24) + (response[9] << 16) + (response[10] << 8) + response[11]),
+ AllocatedSupplementaryBlocks =
+ (uint)((response[12] << 24) + (response[13] << 16) + (response[14] << 8) + response[15])
+ };
}
public static string Prettify(SpareAreaInformation? sai)
diff --git a/DVD/UDI.cs b/DVD/UDI.cs
index 3a51ea02a..9e20b5ff8 100644
--- a/DVD/UDI.cs
+++ b/DVD/UDI.cs
@@ -30,6 +30,8 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.DVD
{
///
@@ -48,6 +50,9 @@ namespace DiscImageChef.Decoders.DVD
/// T10/1836-D revision 2g
/// ECMA 365
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class UDI
{
public struct UniqueDiscIdentifier
diff --git a/Floppy/Amiga.cs b/Floppy/Amiga.cs
index 87b20b45c..eb9cffc0f 100644
--- a/Floppy/Amiga.cs
+++ b/Floppy/Amiga.cs
@@ -30,6 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace DiscImageChef.Decoders.Floppy
@@ -37,6 +38,9 @@ namespace DiscImageChef.Decoders.Floppy
///
/// Methods and structures for Commodore Amiga decoding
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Amiga
{
public struct Sector
diff --git a/Floppy/Apple2.cs b/Floppy/Apple2.cs
index c45af811f..ab7b58c1a 100644
--- a/Floppy/Apple2.cs
+++ b/Floppy/Apple2.cs
@@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
@@ -42,6 +43,9 @@ namespace DiscImageChef.Decoders.Floppy
///
/// Methods and structures for Apple ][ floppy decoding
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Apple2
{
///
@@ -295,17 +299,15 @@ namespace DiscImageChef.Decoders.Floppy
// Pre DOS 3.3
if(sector.addressField.prologue[2] == 0xB5) return Decode5and3(sector.dataField.data);
// DOS 3.3
- if(sector.addressField.prologue[2] == 0x96) return Decode6and2(sector.dataField.data);
+ return sector.addressField.prologue[2] == 0x96 ? Decode6and2(sector.dataField.data) : null;
// Unknown
- return null;
// Not Apple ][ GCR?
}
public static RawSector MarshalSector(byte[] data, int offset = 0)
{
- int temp;
- return MarshalSector(data, out temp, offset);
+ return MarshalSector(data, out _, offset);
}
public static RawSector MarshalSector(byte[] data, out int endOffset, int offset = 0)
@@ -315,11 +317,7 @@ namespace DiscImageChef.Decoders.Floppy
// Not an Apple ][ GCR sector
if(data == null || data.Length < 363) return null;
- RawSector sector;
int position = offset;
- MemoryStream gaps;
- bool onSync;
- int syncCount;
try
{
@@ -333,28 +331,18 @@ namespace DiscImageChef.Decoders.Floppy
// Epilogue not in correct position
if(data[position + 11] != 0xDE || data[position + 12] != 0xAA) return null;
- sector = new RawSector();
- sector.addressField = new RawAddressField();
- sector.addressField.prologue = new byte[3];
- sector.addressField.prologue[0] = data[position];
- sector.addressField.prologue[1] = data[position + 1];
- sector.addressField.prologue[2] = data[position + 2];
- sector.addressField.volume = new byte[2];
- sector.addressField.volume[0] = data[position + 3];
- sector.addressField.volume[1] = data[position + 4];
- sector.addressField.track = new byte[2];
- sector.addressField.track[0] = data[position + 5];
- sector.addressField.track[1] = data[position + 6];
- sector.addressField.sector = new byte[2];
- sector.addressField.sector[0] = data[position + 7];
- sector.addressField.sector[1] = data[position + 8];
- sector.addressField.checksum = new byte[2];
- sector.addressField.checksum[0] = data[position + 9];
- sector.addressField.checksum[1] = data[position + 10];
- sector.addressField.epilogue = new byte[3];
- sector.addressField.epilogue[0] = data[position + 11];
- sector.addressField.epilogue[1] = data[position + 12];
- sector.addressField.epilogue[2] = data[position + 13];
+ RawSector sector = new RawSector
+ {
+ addressField = new RawAddressField
+ {
+ prologue = new[] {data[position], data[position + 1], data[position + 2]},
+ volume = new[] {data[position + 3], data[position + 4]},
+ track = new[] {data[position + 5], data[position + 6]},
+ sector = new[] {data[position + 7], data[position + 8]},
+ checksum = new[] {data[position + 9], data[position + 10]},
+ epilogue = new[] {data[position + 11], data[position + 12], data[position + 13]}
+ }
+ };
DicConsole.DebugWriteLine("Apple ][ GCR Decoder", "Volume {0}",
(((sector.addressField.volume[0] & 0x55) << 1) |
@@ -373,9 +361,9 @@ namespace DiscImageChef.Decoders.Floppy
sector.addressField.epilogue[2]);
position += 14;
- syncCount = 0;
- onSync = false;
- gaps = new MemoryStream();
+ int syncCount = 0;
+ bool onSync = false;
+ MemoryStream gaps = new MemoryStream();
while(data[position] == 0xFF)
{
@@ -495,8 +483,7 @@ namespace DiscImageChef.Decoders.Floppy
public static RawTrack MarshalTrack(byte[] data, int offset = 0)
{
- int temp;
- return MarshalTrack(data, out temp, offset);
+ return MarshalTrack(data, out _, offset);
}
public static RawTrack MarshalTrack(byte[] data, out int endOffset, int offset = 0)
@@ -551,9 +538,7 @@ namespace DiscImageChef.Decoders.Floppy
if(sectors.Count == 0) return null;
- RawTrack track = new RawTrack();
- track.gap = gaps.ToArray();
- track.sectors = sectors.ToArray();
+ RawTrack track = new RawTrack {gap = gaps.ToArray(), sectors = sectors.ToArray()};
endOffset = position;
return track;
}
@@ -564,7 +549,7 @@ namespace DiscImageChef.Decoders.Floppy
MemoryStream raw = new MemoryStream();
raw.Write(track.gap, 0, track.gap.Length);
- foreach(byte[] rawSector in track.sectors.Select(sector => MarshalSector(sector)))
+ foreach(byte[] rawSector in track.sectors.Select(MarshalSector))
{ raw.Write(rawSector, 0, rawSector.Length); }
return raw.ToArray();
@@ -572,8 +557,7 @@ namespace DiscImageChef.Decoders.Floppy
public static List MarshalDisk(byte[] data, int offset = 0)
{
- int temp;
- return MarshalDisk(data, out temp, offset);
+ return MarshalDisk(data, out _, offset);
}
public static List MarshalDisk(byte[] data, out int endOffset, int offset = 0)
@@ -605,15 +589,14 @@ namespace DiscImageChef.Decoders.Floppy
if(disk == null) return null;
MemoryStream raw = new MemoryStream();
- foreach(byte[] rawTrack in disk.Select(track => MarshalTrack(track))) { raw.Write(rawTrack, 0, rawTrack.Length); }
+ foreach(byte[] rawTrack in disk.Select(MarshalTrack)) { raw.Write(rawTrack, 0, rawTrack.Length); }
return raw.ToArray();
}
public static bool IsApple2GCR(byte[] data)
{
- int position;
- RawSector sector = MarshalSector(data, out position, 0);
+ RawSector sector = MarshalSector(data, out int position);
return sector != null && position != 0;
}
diff --git a/Floppy/AppleSony.cs b/Floppy/AppleSony.cs
index 98b1c2f71..26520241c 100644
--- a/Floppy/AppleSony.cs
+++ b/Floppy/AppleSony.cs
@@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
@@ -44,6 +45,10 @@ namespace DiscImageChef.Decoders.Floppy
///
/// Methods and structures for Apple Sony GCR floppy decoding
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class AppleSony
{
///
@@ -149,8 +154,7 @@ namespace DiscImageChef.Decoders.Floppy
sector.addressField.prologue[2] != 0x96) return null;
uint ck1, ck2, ck3;
- byte carry;
- byte w1, w2, w3, w4;
+ byte w3;
byte[] bf1 = new byte[175];
byte[] bf2 = new byte[175];
byte[] bf3 = new byte[175];
@@ -161,9 +165,9 @@ namespace DiscImageChef.Decoders.Floppy
w3 = 0;
for(int i = 0; i <= 174; i++)
{
- w4 = nib_data[j++];
- w1 = nib_data[j++];
- w2 = nib_data[j++];
+ byte w4 = nib_data[j++];
+ byte w1 = nib_data[j++];
+ byte w2 = nib_data[j++];
if(i != 174) w3 = nib_data[j++];
@@ -181,7 +185,7 @@ namespace DiscImageChef.Decoders.Floppy
ck1 = (ck1 & 0xFF) << 1;
if((ck1 & 0x0100) > 0) ck1++;
- carry = (byte)((bf1[j] ^ ck1) & 0xFF);
+ byte carry = (byte)((bf1[j] ^ ck1) & 0xFF);
ck3 += carry;
if((ck1 & 0x0100) > 0)
{
@@ -219,8 +223,7 @@ namespace DiscImageChef.Decoders.Floppy
public static RawSector MarshalSector(byte[] data, int offset = 0)
{
- int temp;
- return MarshalSector(data, out temp, offset);
+ return MarshalSector(data, out _, offset);
}
public static RawSector MarshalSector(byte[] data, out int endOffset, int offset = 0)
@@ -230,11 +233,7 @@ namespace DiscImageChef.Decoders.Floppy
// Not an Apple ][ GCR sector
if(data == null || data.Length < 363) return null;
- RawSector sector;
int position = offset;
- MemoryStream gaps;
- bool onSync;
- int syncCount;
try
{
@@ -246,25 +245,24 @@ namespace DiscImageChef.Decoders.Floppy
// Epilogue not in correct position
if(data[position + 8] != 0xDE || data[position + 9] != 0xAA) return null;
- sector = new RawSector();
- sector.addressField = new RawAddressField();
- sector.addressField.prologue = new byte[3];
- sector.addressField.prologue[0] = data[position];
- sector.addressField.prologue[1] = data[position + 1];
- sector.addressField.prologue[2] = data[position + 2];
- sector.addressField.track = data[position + 3];
- sector.addressField.sector = data[position + 4];
- sector.addressField.side = data[position + 5];
- sector.addressField.format = (AppleEncodedFormat)data[position + 6];
- sector.addressField.checksum = data[position + 7];
- sector.addressField.epilogue = new byte[2];
- sector.addressField.epilogue[0] = data[position + 8];
- sector.addressField.epilogue[1] = data[position + 9];
+ RawSector sector = new RawSector
+ {
+ addressField = new RawAddressField
+ {
+ prologue = new[] {data[position], data[position + 1], data[position + 2]},
+ track = data[position + 3],
+ sector = data[position + 4],
+ side = data[position + 5],
+ format = (AppleEncodedFormat)data[position + 6],
+ checksum = data[position + 7],
+ epilogue = new[] {data[position + 8], data[position + 9]}
+ }
+ };
position += 10;
- syncCount = 0;
- onSync = false;
- gaps = new MemoryStream();
+ int syncCount = 0;
+ bool onSync = false;
+ MemoryStream gaps = new MemoryStream();
while(data[position] == 0xFF)
{
@@ -282,12 +280,11 @@ namespace DiscImageChef.Decoders.Floppy
return null;
sector.innerGap = gaps.ToArray();
- sector.dataField = new RawDataField();
- sector.dataField.prologue = new byte[3];
- sector.dataField.prologue[0] = data[position];
- sector.dataField.prologue[1] = data[position + 1];
- sector.dataField.prologue[2] = data[position + 2];
- sector.dataField.spare = data[position + 3];
+ sector.dataField = new RawDataField
+ {
+ prologue = new[] {data[position], data[position + 1], data[position + 2]},
+ spare = data[position + 3]
+ };
position += 4;
gaps = new MemoryStream();
@@ -382,8 +379,7 @@ namespace DiscImageChef.Decoders.Floppy
public static RawTrack MarshalTrack(byte[] data, int offset = 0)
{
- int temp;
- return MarshalTrack(data, out temp, offset);
+ return MarshalTrack(data, out _, offset);
}
public static RawTrack MarshalTrack(byte[] data, out int endOffset, int offset = 0)
@@ -434,9 +430,7 @@ namespace DiscImageChef.Decoders.Floppy
if(sectors.Count == 0) return null;
- RawTrack track = new RawTrack();
- track.gap = gaps.ToArray();
- track.sectors = sectors.ToArray();
+ RawTrack track = new RawTrack {gap = gaps.ToArray(), sectors = sectors.ToArray()};
endOffset = position;
return track;
}
@@ -447,7 +441,7 @@ namespace DiscImageChef.Decoders.Floppy
MemoryStream raw = new MemoryStream();
raw.Write(track.gap, 0, track.gap.Length);
- foreach(byte[] rawSector in track.sectors.Select(sector => MarshalSector(sector)))
+ foreach(byte[] rawSector in track.sectors.Select(MarshalSector))
{ raw.Write(rawSector, 0, rawSector.Length); }
return raw.ToArray();
@@ -455,8 +449,7 @@ namespace DiscImageChef.Decoders.Floppy
public static List MarshalDisk(byte[] data, int offset = 0)
{
- int temp;
- return MarshalDisk(data, out temp, offset);
+ return MarshalDisk(data, out _, offset);
}
public static List MarshalDisk(byte[] data, out int endOffset, int offset = 0)
@@ -488,15 +481,14 @@ namespace DiscImageChef.Decoders.Floppy
if(disk == null) return null;
MemoryStream raw = new MemoryStream();
- foreach(byte[] rawTrack in disk.Select(track => MarshalTrack(track))) { raw.Write(rawTrack, 0, rawTrack.Length); }
+ foreach(byte[] rawTrack in disk.Select(MarshalTrack)) { raw.Write(rawTrack, 0, rawTrack.Length); }
return raw.ToArray();
}
public static bool IsAppleSonyGCR(byte[] data)
{
- int position;
- RawSector sector = MarshalSector(data, out position, 0);
+ RawSector sector = MarshalSector(data, out int position);
return sector != null && position != 0;
}
diff --git a/Floppy/Commodore.cs b/Floppy/Commodore.cs
index bbd533510..8c9aa522d 100644
--- a/Floppy/Commodore.cs
+++ b/Floppy/Commodore.cs
@@ -30,6 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace DiscImageChef.Decoders.Floppy
@@ -37,6 +38,9 @@ namespace DiscImageChef.Decoders.Floppy
///
/// Methods and structures for Commodore GCR floppy decoding
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Commodore
{
///
diff --git a/Floppy/Enums.cs b/Floppy/Enums.cs
index 25f53e550..1fd6b9a99 100644
--- a/Floppy/Enums.cs
+++ b/Floppy/Enums.cs
@@ -30,11 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.Floppy
{
///
/// In-sector code for sector size
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum IBMSectorSizeCode : byte
{
///
@@ -71,6 +74,7 @@ namespace DiscImageChef.Decoders.Floppy
FricelyFriceKilo = 7
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum IBMIdType : byte
{
IndexMark = 0xFC,
@@ -79,6 +83,7 @@ namespace DiscImageChef.Decoders.Floppy
DeletedDataMark = 0xF8
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum AppleEncodedFormat : byte
{
///
diff --git a/Floppy/ISO.cs b/Floppy/ISO.cs
index c52dce7f0..9ee89f5bc 100644
--- a/Floppy/ISO.cs
+++ b/Floppy/ISO.cs
@@ -30,6 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace DiscImageChef.Decoders.Floppy
@@ -47,6 +48,9 @@ namespace DiscImageChef.Decoders.Floppy
///
/// Methods and structures for ISO floppy decoding (also used by Atari ST and others)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class ISO
{
///
diff --git a/Floppy/Perpendicular.cs b/Floppy/Perpendicular.cs
index b88001000..1499535c3 100644
--- a/Floppy/Perpendicular.cs
+++ b/Floppy/Perpendicular.cs
@@ -30,6 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace DiscImageChef.Decoders.Floppy
@@ -47,6 +48,9 @@ namespace DiscImageChef.Decoders.Floppy
///
/// Methods and structures for perpendicular MFM floppy decoding
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Perpendicular
{
///
diff --git a/Floppy/System34.cs b/Floppy/System34.cs
index 1bf539ddd..e2765fb51 100644
--- a/Floppy/System34.cs
+++ b/Floppy/System34.cs
@@ -30,6 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace DiscImageChef.Decoders.Floppy
@@ -47,6 +48,9 @@ namespace DiscImageChef.Decoders.Floppy
///
/// Methods and structures for IBM System 34 floppy decoding
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class System34
{
///
diff --git a/Floppy/System3740.cs b/Floppy/System3740.cs
index 0d9b35f29..fab31ab23 100644
--- a/Floppy/System3740.cs
+++ b/Floppy/System3740.cs
@@ -30,6 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace DiscImageChef.Decoders.Floppy
@@ -47,6 +48,9 @@ namespace DiscImageChef.Decoders.Floppy
///
/// Methods and structures for IBM System 3740 floppy decoding
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class System3740
{
///
diff --git a/LisaTag.cs b/LisaTag.cs
index ce7638b7b..d318860e8 100644
--- a/LisaTag.cs
+++ b/LisaTag.cs
@@ -31,9 +31,13 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
namespace DiscImageChef.Decoders
{
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class LisaTag
{
///
@@ -42,48 +46,48 @@ namespace DiscImageChef.Decoders
public struct ProfileTag
{
/// 0x00, Lisa OS version number
- public ushort version;
+ public ushort Version;
/// 0x02 bits 7 to 6, kind of info in this block
- public byte kind;
+ public byte Kind;
/// 0x02 bits 5 to 0, reserved
- public byte reserved;
+ public byte Reserved;
/// 0x03, disk volume number
- public byte volume;
+ public byte Volume;
/// 0x04, file ID
- public short fileID;
+ public short FileId;
///
/// 0x06 bit 7, checksum valid?
///
- public bool validChk;
+ public bool ValidChk;
///
/// 0x06 bits 6 to 0, used bytes in block
///
- public ushort usedBytes;
+ public ushort UsedBytes;
///
/// 0x08, 3 bytes, absolute page number
///
- public uint absPage;
+ public uint AbsPage;
///
/// 0x0B, checksum of data
///
- public byte checksum;
+ public byte Checksum;
///
/// 0x0C, relative page number
///
- public ushort relPage;
+ public ushort RelPage;
///
/// 0x0E, 3 bytes, next block, 0xFFFFFF if it's last block
///
- public uint nextBlock;
+ public uint NextBlock;
///
/// 0x11, 3 bytes, previous block, 0xFFFFFF if it's first block
///
- public uint prevBlock;
+ public uint PrevBlock;
/// On-memory value for easy first block search.
- public bool isFirst;
+ public bool IsFirst;
/// On-memory value for easy last block search.
- public bool isLast;
+ public bool IsLast;
}
///
@@ -92,52 +96,52 @@ namespace DiscImageChef.Decoders
public struct PriamTag
{
/// 0x00, Lisa OS version number
- public ushort version;
+ public ushort Version;
/// 0x02 bits 7 to 6, kind of info in this block
- public byte kind;
+ public byte Kind;
/// 0x02 bits 5 to 0, reserved
- public byte reserved;
+ public byte Reserved;
/// 0x03, disk volume number
- public byte volume;
+ public byte Volume;
/// 0x04, file ID
- public short fileID;
+ public short FileId;
///
/// 0x06 bit 7, checksum valid?
///
- public bool validChk;
+ public bool ValidChk;
///
/// 0x06 bits 6 to 0, used bytes in block
///
- public ushort usedBytes;
+ public ushort UsedBytes;
///
/// 0x08, 3 bytes, absolute page number
///
- public uint absPage;
+ public uint AbsPage;
///
/// 0x0B, checksum of data
///
- public byte checksum;
+ public byte Checksum;
///
/// 0x0C, relative page number
///
- public ushort relPage;
+ public ushort RelPage;
///
/// 0x0E, 3 bytes, next block, 0xFFFFFF if it's last block
///
- public uint nextBlock;
+ public uint NextBlock;
///
/// 0x11, 3 bytes, previous block, 0xFFFFFF if it's first block
///
- public uint prevBlock;
+ public uint PrevBlock;
///
/// 0x14, disk size
///
- public uint diskSize;
+ public uint DiskSize;
/// On-memory value for easy first block search.
- public bool isFirst;
+ public bool IsFirst;
/// On-memory value for easy last block search.
- public bool isLast;
+ public bool IsLast;
}
///
@@ -146,32 +150,32 @@ namespace DiscImageChef.Decoders
public struct SonyTag
{
/// 0x00, Lisa OS version number
- public ushort version;
+ public ushort Version;
/// 0x02 bits 7 to 6, kind of info in this block
- public byte kind;
+ public byte Kind;
/// 0x02 bits 5 to 0, reserved
- public byte reserved;
+ public byte Reserved;
/// 0x03, disk volume number
- public byte volume;
+ public byte Volume;
/// 0x04, file ID
- public short fileID;
+ public short FileId;
///
/// 0x06, relative page number
///
- public ushort relPage;
+ public ushort RelPage;
///
/// 0x08, 3 bytes, next block, 0x7FF if it's last block, 0x8000 set if block is valid
///
- public ushort nextBlock;
+ public ushort NextBlock;
///
/// 0x0A, 3 bytes, previous block, 0x7FF if it's first block
///
- public ushort prevBlock;
+ public ushort PrevBlock;
/// On-memory value for easy first block search.
- public bool isFirst;
+ public bool IsFirst;
/// On-memory value for easy last block search.
- public bool isLast;
+ public bool IsLast;
}
public static SonyTag? DecodeSonyTag(byte[] tag)
@@ -182,17 +186,17 @@ namespace DiscImageChef.Decoders
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
- snTag.version = BigEndianBitConverter.ToUInt16(tag, 0);
- snTag.kind = (byte)((tag[2] & 0xC0) >> 6);
- snTag.reserved = (byte)(tag[2] & 0x3F);
- snTag.volume = tag[3];
- snTag.fileID = BigEndianBitConverter.ToInt16(tag, 4);
- snTag.relPage = BigEndianBitConverter.ToUInt16(tag, 6);
- snTag.nextBlock = (ushort)(BigEndianBitConverter.ToUInt16(tag, 8) & 0x7FF);
- snTag.prevBlock = (ushort)(BigEndianBitConverter.ToUInt16(tag, 10) & 0x7FF);
+ snTag.Version = BigEndianBitConverter.ToUInt16(tag, 0);
+ snTag.Kind = (byte)((tag[2] & 0xC0) >> 6);
+ snTag.Reserved = (byte)(tag[2] & 0x3F);
+ snTag.Volume = tag[3];
+ snTag.FileId = BigEndianBitConverter.ToInt16(tag, 4);
+ snTag.RelPage = BigEndianBitConverter.ToUInt16(tag, 6);
+ snTag.NextBlock = (ushort)(BigEndianBitConverter.ToUInt16(tag, 8) & 0x7FF);
+ snTag.PrevBlock = (ushort)(BigEndianBitConverter.ToUInt16(tag, 10) & 0x7FF);
- snTag.isLast = snTag.nextBlock == 0x7FF;
- snTag.isFirst = snTag.prevBlock == 0x7FF;
+ snTag.IsLast = snTag.NextBlock == 0x7FF;
+ snTag.IsFirst = snTag.PrevBlock == 0x7FF;
return snTag;
}
@@ -207,37 +211,37 @@ namespace DiscImageChef.Decoders
byte[] tmp = new byte[4];
- phTag.version = BigEndianBitConverter.ToUInt16(tag, 0);
- phTag.kind = (byte)((tag[2] & 0xC0) >> 6);
- phTag.reserved = (byte)(tag[2] & 0x3F);
- phTag.volume = tag[3];
- phTag.fileID = BigEndianBitConverter.ToInt16(tag, 4);
- phTag.validChk |= (tag[6] & 0x80) == 0x80;
- phTag.usedBytes = (ushort)(BigEndianBitConverter.ToUInt16(tag, 6) & 0x7FFF);
+ phTag.Version = BigEndianBitConverter.ToUInt16(tag, 0);
+ phTag.Kind = (byte)((tag[2] & 0xC0) >> 6);
+ phTag.Reserved = (byte)(tag[2] & 0x3F);
+ phTag.Volume = tag[3];
+ phTag.FileId = BigEndianBitConverter.ToInt16(tag, 4);
+ phTag.ValidChk |= (tag[6] & 0x80) == 0x80;
+ phTag.UsedBytes = (ushort)(BigEndianBitConverter.ToUInt16(tag, 6) & 0x7FFF);
tmp[0] = 0x00;
tmp[1] = tag[8];
tmp[2] = tag[9];
tmp[3] = tag[10];
- phTag.absPage = BigEndianBitConverter.ToUInt32(tmp, 0);
+ phTag.AbsPage = BigEndianBitConverter.ToUInt32(tmp, 0);
- phTag.checksum = tag[11];
- phTag.relPage = BigEndianBitConverter.ToUInt16(tag, 12);
+ phTag.Checksum = tag[11];
+ phTag.RelPage = BigEndianBitConverter.ToUInt16(tag, 12);
tmp[0] = 0x00;
tmp[1] = tag[14];
tmp[2] = tag[15];
tmp[3] = tag[16];
- phTag.nextBlock = BigEndianBitConverter.ToUInt32(tmp, 0);
+ phTag.NextBlock = BigEndianBitConverter.ToUInt32(tmp, 0);
tmp[0] = 0x00;
tmp[1] = tag[17];
tmp[2] = tag[18];
tmp[3] = tag[19];
- phTag.prevBlock = BigEndianBitConverter.ToUInt32(tmp, 0);
+ phTag.PrevBlock = BigEndianBitConverter.ToUInt32(tmp, 0);
- phTag.isLast = phTag.nextBlock == 0xFFFFFF;
- phTag.isFirst = phTag.prevBlock == 0xFFFFFF;
+ phTag.IsLast = phTag.NextBlock == 0xFFFFFF;
+ phTag.IsFirst = phTag.PrevBlock == 0xFFFFFF;
return phTag;
}
@@ -252,39 +256,39 @@ namespace DiscImageChef.Decoders
byte[] tmp = new byte[4];
- pmTag.version = BigEndianBitConverter.ToUInt16(tag, 0);
- pmTag.kind = (byte)((tag[2] & 0xC0) >> 6);
- pmTag.reserved = (byte)(tag[2] & 0x3F);
- pmTag.volume = tag[3];
- pmTag.fileID = BigEndianBitConverter.ToInt16(tag, 4);
- pmTag.validChk |= (tag[6] & 0x80) == 0x80;
- pmTag.usedBytes = (ushort)(BigEndianBitConverter.ToUInt16(tag, 6) & 0x7FFF);
+ pmTag.Version = BigEndianBitConverter.ToUInt16(tag, 0);
+ pmTag.Kind = (byte)((tag[2] & 0xC0) >> 6);
+ pmTag.Reserved = (byte)(tag[2] & 0x3F);
+ pmTag.Volume = tag[3];
+ pmTag.FileId = BigEndianBitConverter.ToInt16(tag, 4);
+ pmTag.ValidChk |= (tag[6] & 0x80) == 0x80;
+ pmTag.UsedBytes = (ushort)(BigEndianBitConverter.ToUInt16(tag, 6) & 0x7FFF);
tmp[0] = 0x00;
tmp[1] = tag[8];
tmp[2] = tag[9];
tmp[3] = tag[10];
- pmTag.absPage = BigEndianBitConverter.ToUInt32(tmp, 0);
+ pmTag.AbsPage = BigEndianBitConverter.ToUInt32(tmp, 0);
- pmTag.checksum = tag[11];
- pmTag.relPage = BigEndianBitConverter.ToUInt16(tag, 12);
+ pmTag.Checksum = tag[11];
+ pmTag.RelPage = BigEndianBitConverter.ToUInt16(tag, 12);
tmp[0] = 0x00;
tmp[1] = tag[14];
tmp[2] = tag[15];
tmp[3] = tag[16];
- pmTag.nextBlock = BigEndianBitConverter.ToUInt32(tmp, 0);
+ pmTag.NextBlock = BigEndianBitConverter.ToUInt32(tmp, 0);
tmp[0] = 0x00;
tmp[1] = tag[17];
tmp[2] = tag[18];
tmp[3] = tag[19];
- pmTag.prevBlock = BigEndianBitConverter.ToUInt32(tmp, 0);
+ pmTag.PrevBlock = BigEndianBitConverter.ToUInt32(tmp, 0);
- pmTag.diskSize = BigEndianBitConverter.ToUInt32(tag, 20);
+ pmTag.DiskSize = BigEndianBitConverter.ToUInt32(tag, 20);
- pmTag.isLast = pmTag.nextBlock == 0xFFFFFF;
- pmTag.isFirst = pmTag.prevBlock == 0xFFFFFF;
+ pmTag.IsLast = pmTag.NextBlock == 0xFFFFFF;
+ pmTag.IsFirst = pmTag.PrevBlock == 0xFFFFFF;
return pmTag;
}
@@ -303,21 +307,21 @@ namespace DiscImageChef.Decoders
if(snTag == null) return null;
pmTag = new PriamTag();
- pmTag.absPage = 0;
- pmTag.checksum = 0;
- pmTag.diskSize = 0;
- pmTag.fileID = snTag.Value.fileID;
- pmTag.kind = snTag.Value.kind;
- pmTag.nextBlock = snTag.Value.nextBlock;
- pmTag.prevBlock = snTag.Value.prevBlock;
- pmTag.relPage = snTag.Value.relPage;
- pmTag.reserved = snTag.Value.reserved;
- pmTag.usedBytes = 0;
- pmTag.validChk = false;
- pmTag.version = snTag.Value.version;
- pmTag.volume = snTag.Value.volume;
- pmTag.isFirst = snTag.Value.isFirst;
- pmTag.isLast = snTag.Value.isLast;
+ pmTag.AbsPage = 0;
+ pmTag.Checksum = 0;
+ pmTag.DiskSize = 0;
+ pmTag.FileId = snTag.Value.FileId;
+ pmTag.Kind = snTag.Value.Kind;
+ pmTag.NextBlock = snTag.Value.NextBlock;
+ pmTag.PrevBlock = snTag.Value.PrevBlock;
+ pmTag.RelPage = snTag.Value.RelPage;
+ pmTag.Reserved = snTag.Value.Reserved;
+ pmTag.UsedBytes = 0;
+ pmTag.ValidChk = false;
+ pmTag.Version = snTag.Value.Version;
+ pmTag.Volume = snTag.Value.Volume;
+ pmTag.IsFirst = snTag.Value.IsFirst;
+ pmTag.IsLast = snTag.Value.IsLast;
return pmTag;
case 20:
@@ -326,21 +330,21 @@ namespace DiscImageChef.Decoders
if(phTag == null) return null;
pmTag = new PriamTag();
- pmTag.absPage = phTag.Value.absPage;
- pmTag.checksum = phTag.Value.checksum;
- pmTag.diskSize = 0;
- pmTag.fileID = phTag.Value.fileID;
- pmTag.kind = phTag.Value.kind;
- pmTag.nextBlock = phTag.Value.nextBlock;
- pmTag.prevBlock = phTag.Value.prevBlock;
- pmTag.relPage = phTag.Value.relPage;
- pmTag.reserved = phTag.Value.reserved;
- pmTag.usedBytes = phTag.Value.usedBytes;
- pmTag.validChk = phTag.Value.validChk;
- pmTag.version = phTag.Value.version;
- pmTag.volume = phTag.Value.volume;
- pmTag.isFirst = phTag.Value.isFirst;
- pmTag.isLast = phTag.Value.isLast;
+ pmTag.AbsPage = phTag.Value.AbsPage;
+ pmTag.Checksum = phTag.Value.Checksum;
+ pmTag.DiskSize = 0;
+ pmTag.FileId = phTag.Value.FileId;
+ pmTag.Kind = phTag.Value.Kind;
+ pmTag.NextBlock = phTag.Value.NextBlock;
+ pmTag.PrevBlock = phTag.Value.PrevBlock;
+ pmTag.RelPage = phTag.Value.RelPage;
+ pmTag.Reserved = phTag.Value.Reserved;
+ pmTag.UsedBytes = phTag.Value.UsedBytes;
+ pmTag.ValidChk = phTag.Value.ValidChk;
+ pmTag.Version = phTag.Value.Version;
+ pmTag.Volume = phTag.Value.Volume;
+ pmTag.IsFirst = phTag.Value.IsFirst;
+ pmTag.IsLast = phTag.Value.IsLast;
return pmTag;
case 24: return DecodePriamTag(tag);
diff --git a/MMC/CID.cs b/MMC/CID.cs
index 34e3cca93..ec64f88d8 100644
--- a/MMC/CID.cs
+++ b/MMC/CID.cs
@@ -31,10 +31,15 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.MMC
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "UnassignedField.Global")]
public class CID
{
public byte Manufacturer;
@@ -47,18 +52,18 @@ namespace DiscImageChef.Decoders.MMC
public byte CRC;
}
- public partial class Decoders
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ public static partial class Decoders
{
public static CID DecodeCID(uint[] response)
{
- if(response == null) return null;
-
- if(response.Length != 4) return null;
+ if(response?.Length != 4) return null;
byte[] data = new byte[16];
- byte[] tmp;
- tmp = BitConverter.GetBytes(response[0]);
+ byte[] tmp = BitConverter.GetBytes(response[0]);
Array.Copy(tmp, 0, data, 0, 4);
tmp = BitConverter.GetBytes(response[1]);
Array.Copy(tmp, 0, data, 4, 4);
@@ -72,22 +77,20 @@ namespace DiscImageChef.Decoders.MMC
public static CID DecodeCID(byte[] response)
{
- if(response == null) return null;
+ if(response?.Length != 16) return null;
- if(response.Length != 16) return null;
-
- byte[] tmp;
-
- CID cid = new CID();
- cid.Manufacturer = response[0];
- cid.DeviceType = (byte)(response[1] & 0x03);
- tmp = new byte[6];
+ CID cid = new CID
+ {
+ Manufacturer = response[0],
+ DeviceType = (byte)(response[1] & 0x03),
+ ProductRevision = response[9],
+ ProductSerialNumber = BitConverter.ToUInt32(response, 10),
+ ManufacturingDate = response[14],
+ CRC = (byte)((response[15] & 0xFE) >> 1)
+ };
+ byte[] tmp = new byte[6];
Array.Copy(response, 3, tmp, 0, 6);
cid.ProductName = StringHandlers.CToString(tmp);
- cid.ProductRevision = response[9];
- cid.ProductSerialNumber = BitConverter.ToUInt32(response, 10);
- cid.ManufacturingDate = response[14];
- cid.CRC = (byte)((response[15] & 0xFE) >> 1);
return cid;
}
diff --git a/MMC/CSD.cs b/MMC/CSD.cs
index 7cc70bd70..d9a5a997b 100644
--- a/MMC/CSD.cs
+++ b/MMC/CSD.cs
@@ -31,10 +31,15 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.MMC
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public class CSD
{
public byte Structure;
@@ -72,18 +77,18 @@ namespace DiscImageChef.Decoders.MMC
public byte CRC;
}
- public partial class Decoders
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ public static partial class Decoders
{
public static CSD DecodeCSD(uint[] response)
{
- if(response == null) return null;
-
- if(response.Length != 4) return null;
+ if(response?.Length != 4) return null;
byte[] data = new byte[16];
- byte[] tmp;
- tmp = BitConverter.GetBytes(response[0]);
+ byte[] tmp = BitConverter.GetBytes(response[0]);
Array.Copy(tmp, 0, data, 0, 4);
tmp = BitConverter.GetBytes(response[1]);
Array.Copy(tmp, 0, data, 4, 4);
@@ -97,47 +102,44 @@ namespace DiscImageChef.Decoders.MMC
public static CSD DecodeCSD(byte[] response)
{
- if(response == null) return null;
+ if(response?.Length != 16) return null;
- if(response.Length != 16) return null;
-
- CSD csd = new CSD();
-
- csd.Structure = (byte)((response[0] & 0xC0) >> 6);
- csd.Version = (byte)((response[0] & 0x3C) >> 2);
- csd.TAAC = response[1];
- csd.NSAC = response[2];
- csd.Speed = response[3];
- csd.Classes = (ushort)((response[4] << 4) + ((response[5] & 0xF0) >> 4));
- csd.ReadBlockLength = (byte)(response[5] & 0x0F);
- csd.ReadsPartialBlocks = (response[6] & 0x80) == 0x80;
- csd.WriteMisalignment = (response[6] & 0x40) == 0x40;
- csd.ReadMisalignment = (response[6] & 0x20) == 0x20;
- csd.DSRImplemented = (response[6] & 0x10) == 0x10;
- csd.Size = (ushort)(((response[6] & 0x03) << 10) + (response[7] << 2) + ((response[8] & 0xC0) >> 6));
- csd.ReadCurrentAtVddMin = (byte)((response[8] & 0x38) >> 3);
- csd.ReadCurrentAtVddMax = (byte)(response[8] & 0x07);
- csd.WriteCurrentAtVddMin = (byte)((response[9] & 0xE0) >> 5);
- csd.WriteCurrentAtVddMax = (byte)((response[9] & 0x1C) >> 2);
- csd.SizeMultiplier = (byte)(((response[9] & 0x03) << 1) + ((response[10] & 0x80) >> 7));
- csd.EraseGroupSize = (byte)((response[10] & 0x7C) >> 2);
- csd.EraseGroupSizeMultiplier = (byte)(((response[10] & 0x03) << 3) + ((response[11] & 0xE0) >> 5));
- csd.WriteProtectGroupSize = (byte)(response[11] & 0x1F);
- csd.WriteProtectGroupEnable = (response[12] & 0x80) == 0x80;
- csd.DefaultECC = (byte)((response[12] & 0x60) >> 5);
- csd.WriteSpeedFactor = (byte)((response[12] & 0x1C) >> 2);
- csd.WriteBlockLength = (byte)(((response[12] & 0x03) << 2) + ((response[13] & 0xC0) >> 6));
- csd.WritesPartialBlocks = (response[13] & 0x20) == 0x20;
- csd.ContentProtection = (response[13] & 0x01) == 0x01;
- csd.FileFormatGroup = (response[14] & 0x80) == 0x80;
- csd.Copy = (response[14] & 0x40) == 0x40;
- csd.PermanentWriteProtect = (response[14] & 0x20) == 0x20;
- csd.TemporaryWriteProtect = (response[14] & 0x10) == 0x10;
- csd.FileFormat = (byte)((response[14] & 0x0C) >> 2);
- csd.ECC = (byte)(response[14] & 0x03);
- csd.CRC = (byte)((response[15] & 0xFE) >> 1);
-
- return csd;
+ return new CSD
+ {
+ Structure = (byte)((response[0] & 0xC0) >> 6),
+ Version = (byte)((response[0] & 0x3C) >> 2),
+ TAAC = response[1],
+ NSAC = response[2],
+ Speed = response[3],
+ Classes = (ushort)((response[4] << 4) + ((response[5] & 0xF0) >> 4)),
+ ReadBlockLength = (byte)(response[5] & 0x0F),
+ ReadsPartialBlocks = (response[6] & 0x80) == 0x80,
+ WriteMisalignment = (response[6] & 0x40) == 0x40,
+ ReadMisalignment = (response[6] & 0x20) == 0x20,
+ DSRImplemented = (response[6] & 0x10) == 0x10,
+ Size = (ushort)(((response[6] & 0x03) << 10) + (response[7] << 2) + ((response[8] & 0xC0) >> 6)),
+ ReadCurrentAtVddMin = (byte)((response[8] & 0x38) >> 3),
+ ReadCurrentAtVddMax = (byte)(response[8] & 0x07),
+ WriteCurrentAtVddMin = (byte)((response[9] & 0xE0) >> 5),
+ WriteCurrentAtVddMax = (byte)((response[9] & 0x1C) >> 2),
+ SizeMultiplier = (byte)(((response[9] & 0x03) << 1) + ((response[10] & 0x80) >> 7)),
+ EraseGroupSize = (byte)((response[10] & 0x7C) >> 2),
+ EraseGroupSizeMultiplier = (byte)(((response[10] & 0x03) << 3) + ((response[11] & 0xE0) >> 5)),
+ WriteProtectGroupSize = (byte)(response[11] & 0x1F),
+ WriteProtectGroupEnable = (response[12] & 0x80) == 0x80,
+ DefaultECC = (byte)((response[12] & 0x60) >> 5),
+ WriteSpeedFactor = (byte)((response[12] & 0x1C) >> 2),
+ WriteBlockLength = (byte)(((response[12] & 0x03) << 2) + ((response[13] & 0xC0) >> 6)),
+ WritesPartialBlocks = (response[13] & 0x20) == 0x20,
+ ContentProtection = (response[13] & 0x01) == 0x01,
+ FileFormatGroup = (response[14] & 0x80) == 0x80,
+ Copy = (response[14] & 0x40) == 0x40,
+ PermanentWriteProtect = (response[14] & 0x20) == 0x20,
+ TemporaryWriteProtect = (response[14] & 0x10) == 0x10,
+ FileFormat = (byte)((response[14] & 0x0C) >> 2),
+ ECC = (byte)(response[14] & 0x03),
+ CRC = (byte)((response[15] & 0xFE) >> 1)
+ };
}
public static string PrettifyCSD(CSD csd)
diff --git a/MMC/ExtendedCSD.cs b/MMC/ExtendedCSD.cs
index cd517d46e..02f7a39a1 100644
--- a/MMC/ExtendedCSD.cs
+++ b/MMC/ExtendedCSD.cs
@@ -31,11 +31,16 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Text;
namespace DiscImageChef.Decoders.MMC
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "UnassignedField.Global")]
[StructLayout(LayoutKind.Sequential)]
public class ExtendedCSD
{
@@ -197,7 +202,10 @@ namespace DiscImageChef.Decoders.MMC
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)] public byte[] Reserved18;
}
- public partial class Decoders
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ public static partial class Decoders
{
public static ExtendedCSD DecodeExtendedCSD(byte[] response)
{
diff --git a/MMC/OCR.cs b/MMC/OCR.cs
index 74068ad3f..f61fdf21c 100644
--- a/MMC/OCR.cs
+++ b/MMC/OCR.cs
@@ -31,10 +31,15 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.MMC
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public class OCR
{
public bool PowerUp;
@@ -58,42 +63,40 @@ namespace DiscImageChef.Decoders.MMC
public bool OneSix;
}
- public partial class Decoders
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ public static partial class Decoders
{
public static OCR DecodeOCR(uint response)
{
- OCR ocr = new OCR();
-
- ocr.PowerUp = (response & 0x80000000) == 0x80000000;
- ocr.AccessMode = (byte)((response & 0x60000000) >> 29);
- ocr.ThreeFive = (response & 0x00800000) == 0x00800000;
- ocr.ThreeFour = (response & 0x00400000) == 0x00400000;
- ocr.ThreeThree = (response & 0x00200000) == 0x00200000;
- ocr.ThreeTwo = (response & 0x00100000) == 0x00100000;
- ocr.ThreeOne = (response & 0x00080000) == 0x00080000;
- ocr.ThreeZero = (response & 0x00040000) == 0x00040000;
- ocr.TwoNine = (response & 0x00020000) == 0x00020000;
- ocr.TwoEight = (response & 0x00010000) == 0x00010000;
- ocr.TwoSeven = (response & 0x00008000) == 0x00008000;
- ocr.TwoSix = (response & 0x00004000) == 0x00004000;
- ocr.TwoFive = (response & 0x00002000) == 0x00002000;
- ocr.TwoFour = (response & 0x00001000) == 0x00001000;
- ocr.TwoThree = (response & 0x00000800) == 0x00000800;
- ocr.TwoTwo = (response & 0x00000400) == 0x00000400;
- ocr.TwoOne = (response & 0x00000200) == 0x00000200;
- ocr.TwoZero = (response & 0x00000100) == 0x00000100;
- ocr.OneSix = (response & 0x00000080) == 0x00000080;
-
- return ocr;
+ return new OCR
+ {
+ PowerUp = (response & 0x80000000) == 0x80000000,
+ AccessMode = (byte)((response & 0x60000000) >> 29),
+ ThreeFive = (response & 0x00800000) == 0x00800000,
+ ThreeFour = (response & 0x00400000) == 0x00400000,
+ ThreeThree = (response & 0x00200000) == 0x00200000,
+ ThreeTwo = (response & 0x00100000) == 0x00100000,
+ ThreeOne = (response & 0x00080000) == 0x00080000,
+ ThreeZero = (response & 0x00040000) == 0x00040000,
+ TwoNine = (response & 0x00020000) == 0x00020000,
+ TwoEight = (response & 0x00010000) == 0x00010000,
+ TwoSeven = (response & 0x00008000) == 0x00008000,
+ TwoSix = (response & 0x00004000) == 0x00004000,
+ TwoFive = (response & 0x00002000) == 0x00002000,
+ TwoFour = (response & 0x00001000) == 0x00001000,
+ TwoThree = (response & 0x00000800) == 0x00000800,
+ TwoTwo = (response & 0x00000400) == 0x00000400,
+ TwoOne = (response & 0x00000200) == 0x00000200,
+ TwoZero = (response & 0x00000100) == 0x00000100,
+ OneSix = (response & 0x00000080) == 0x00000080
+ };
}
public static OCR DecodeOCR(byte[] response)
{
- if(response == null) return null;
-
- if(response.Length != 4) return null;
-
- return DecodeOCR(BitConverter.ToUInt32(response, 0));
+ return response?.Length != 4 ? null : DecodeOCR(BitConverter.ToUInt32(response, 0));
}
public static string PrettifyOCR(OCR ocr)
diff --git a/MMC/VendorString.cs b/MMC/VendorString.cs
index 4bf5e2371..0c2d6cd40 100644
--- a/MMC/VendorString.cs
+++ b/MMC/VendorString.cs
@@ -34,12 +34,12 @@ namespace DiscImageChef.Decoders.MMC
{
public static class VendorString
{
- public static string Prettify(byte MMCVendorID)
+ public static string Prettify(byte mmcVendorId)
{
- switch(MMCVendorID)
+ switch(mmcVendorId)
{
case 0x15: return "Samsung";
- default: return $"Unknown manufacturer ID 0x{MMCVendorID:X2}";
+ default: return $"Unknown manufacturer ID 0x{mmcVendorId:X2}";
}
}
}
diff --git a/PCMCIA/CIS.cs b/PCMCIA/CIS.cs
index 7c533fa22..5afa75dbb 100644
--- a/PCMCIA/CIS.cs
+++ b/PCMCIA/CIS.cs
@@ -32,11 +32,15 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
namespace DiscImageChef.Decoders.PCMCIA
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class CIS
{
// TODO: Handle links? Or are they removed in lower layers of the operating system drivers?
@@ -47,9 +51,7 @@ namespace DiscImageChef.Decoders.PCMCIA
while(position < data.Length)
{
- Tuple tuple = new Tuple();
-
- tuple.Code = (TupleCodes)data[position];
+ Tuple tuple = new Tuple {Code = (TupleCodes)data[position]};
if(tuple.Code == TupleCodes.CISTPL_NULL) continue;
@@ -75,28 +77,27 @@ namespace DiscImageChef.Decoders.PCMCIA
if(tuple.Code != TupleCodes.CISTPL_DEVICEGEO && tuple.Code != TupleCodes.CISTPL_DEVICEGEO_A) return null;
- if(tuple.Data == null) return null;
-
- return DecodeDeviceGeometryTuple(tuple.Data);
+ return tuple.Data == null ? null : DecodeDeviceGeometryTuple(tuple.Data);
}
public static DeviceGeometryTuple DecodeDeviceGeometryTuple(byte[] data)
{
- if(data == null) return null;
- if((data.Length - 2) % 6 != 0) return null;
+ if((data?.Length - 2) % 6 != 0) return null;
DeviceGeometryTuple tuple = new DeviceGeometryTuple();
List geometries = new List();
for(int position = 2; position < data.Length; position += 6)
{
- DeviceGeometry geometry = new DeviceGeometry();
- geometry.CardInterface = data[position];
- geometry.EraseBlockSize = data[position + 1];
- geometry.ReadBlockSize = data[position + 2];
- geometry.WriteBlockSize = data[position + 3];
- geometry.Partitions = data[position + 4];
- geometry.Interleaving = data[position + 5];
+ DeviceGeometry geometry = new DeviceGeometry
+ {
+ CardInterface = data[position],
+ EraseBlockSize = data[position + 1],
+ ReadBlockSize = data[position + 2],
+ WriteBlockSize = data[position + 3],
+ Partitions = data[position + 4],
+ Interleaving = data[position + 5]
+ };
geometries.Add(geometry);
}
@@ -145,13 +146,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public static ManufacturerIdentificationTuple DecodeManufacturerIdentificationTuple(Tuple tuple)
{
- if(tuple == null) return null;
+ if(tuple?.Code != TupleCodes.CISTPL_MANFID) return null;
- if(tuple.Code != TupleCodes.CISTPL_MANFID) return null;
-
- if(tuple.Data == null) return null;
-
- return DecodeManufacturerIdentificationTuple(tuple.Data);
+ return tuple.Data == null ? null : DecodeManufacturerIdentificationTuple(tuple.Data);
}
public static ManufacturerIdentificationTuple DecodeManufacturerIdentificationTuple(byte[] data)
@@ -160,20 +157,18 @@ namespace DiscImageChef.Decoders.PCMCIA
if(data.Length < 6) return null;
- ManufacturerIdentificationTuple tuple = new ManufacturerIdentificationTuple();
- tuple.Code = (TupleCodes)data[0];
- tuple.Link = data[1];
- tuple.ManufacturerID = BitConverter.ToUInt16(data, 2);
- tuple.CardID = BitConverter.ToUInt16(data, 4);
-
- return tuple;
+ return new ManufacturerIdentificationTuple
+ {
+ Code = (TupleCodes)data[0],
+ Link = data[1],
+ ManufacturerID = BitConverter.ToUInt16(data, 2),
+ CardID = BitConverter.ToUInt16(data, 4)
+ };
}
public static string PrettifyManufacturerIdentificationTuple(ManufacturerIdentificationTuple tuple)
{
- if(tuple == null) return null;
-
- if(tuple.Code != TupleCodes.CISTPL_MANFID) return null;
+ if(tuple?.Code != TupleCodes.CISTPL_MANFID) return null;
StringBuilder sb = new StringBuilder();
sb.AppendLine("PCMCIA Manufacturer Identification Tuple:");
@@ -195,13 +190,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public static Level1VersionTuple DecodeLevel1VersionTuple(Tuple tuple)
{
- if(tuple == null) return null;
+ if(tuple?.Code != TupleCodes.CISTPL_VERS_1) return null;
- if(tuple.Code != TupleCodes.CISTPL_VERS_1) return null;
-
- if(tuple.Data == null) return null;
-
- return DecodeLevel1VersionTuple(tuple.Data);
+ return tuple.Data == null ? null : DecodeLevel1VersionTuple(tuple.Data);
}
public static Level1VersionTuple DecodeLevel1VersionTuple(byte[] data)
@@ -215,11 +206,13 @@ namespace DiscImageChef.Decoders.PCMCIA
bool firstString = false;
bool secondString = false;
- Level1VersionTuple tuple = new Level1VersionTuple();
- tuple.Code = (TupleCodes)data[0];
- tuple.Link = data[1];
- tuple.MajorVersion = data[2];
- tuple.MinorVersion = data[3];
+ Level1VersionTuple tuple = new Level1VersionTuple
+ {
+ Code = (TupleCodes)data[0],
+ Link = data[1],
+ MajorVersion = data[2],
+ MinorVersion = data[3]
+ };
for(int position = 4; position < data.Length; position++)
{
@@ -259,9 +252,7 @@ namespace DiscImageChef.Decoders.PCMCIA
public static string PrettifyLevel1VersionTuple(Level1VersionTuple tuple)
{
- if(tuple == null) return null;
-
- if(tuple.Code != TupleCodes.CISTPL_VERS_1) return null;
+ if(tuple?.Code != TupleCodes.CISTPL_VERS_1) return null;
StringBuilder sb = new StringBuilder();
sb.AppendLine("PCMCIA Level 1 Version / Product Information Tuple:");
diff --git a/PCMCIA/Enums.cs b/PCMCIA/Enums.cs
index 5a627639d..74c0a886f 100644
--- a/PCMCIA/Enums.cs
+++ b/PCMCIA/Enums.cs
@@ -30,11 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.PCMCIA
{
///
/// Tuple codes.
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum TupleCodes : byte
{
///
@@ -199,6 +202,7 @@ namespace DiscImageChef.Decoders.PCMCIA
CISTPL_SPCL = 0x90
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum DeviceTypeCodes : byte
{
///
@@ -243,6 +247,7 @@ namespace DiscImageChef.Decoders.PCMCIA
DTYPE_EXTEND = 14
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum DeviceSpeedCodes : byte
{
///
@@ -271,6 +276,7 @@ namespace DiscImageChef.Decoders.PCMCIA
DSPEED_EXT = 7
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum FunctionCodes : byte
{
MultiFunction = 0x00,
diff --git a/PCMCIA/Types.cs b/PCMCIA/Types.cs
index 2f41af3d0..18767aa7a 100644
--- a/PCMCIA/Types.cs
+++ b/PCMCIA/Types.cs
@@ -30,11 +30,16 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.PCMCIA
{
///
/// Basic classure of a PCMCIA tuple
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class Tuple
{
public TupleCodes Code;
@@ -45,6 +50,9 @@ namespace DiscImageChef.Decoders.PCMCIA
///
/// Checksum tuple
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class ChecksumTuple
{
///
@@ -72,6 +80,9 @@ namespace DiscImageChef.Decoders.PCMCIA
///
/// Indirect Access PC Card Memory
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class IndirectTuple
{
///
@@ -87,6 +98,9 @@ namespace DiscImageChef.Decoders.PCMCIA
///
/// Link target tuple
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class LinkTargetTuple
{
///
@@ -106,6 +120,9 @@ namespace DiscImageChef.Decoders.PCMCIA
///
/// 16-bit PC Card Long Link Tuple
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class LongLinkTuple
{
///
@@ -122,6 +139,10 @@ namespace DiscImageChef.Decoders.PCMCIA
public uint Address;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
public class ConfigurationAddress
{
///
@@ -137,6 +158,9 @@ namespace DiscImageChef.Decoders.PCMCIA
///
/// Multiple function link tuple
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class MultipleFunctionLinkTuple
{
///
@@ -157,6 +181,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public ConfigurationAddress[] Addresses;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class NoLinkTuple
{
///
@@ -169,6 +196,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public byte Link;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class AlternateStringTuple
{
///
@@ -185,6 +215,10 @@ namespace DiscImageChef.Decoders.PCMCIA
public string[] Strings;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
public class ExtendedDeviceSpeed
{
///
@@ -201,6 +235,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public byte Exponent;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public struct DeviceInfo
{
///
@@ -233,6 +270,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public byte SizeCode;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class DeviceTuple
{
///
@@ -249,6 +289,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public DeviceInfo[] Infos;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public struct OtherConditionInfo
{
///
@@ -265,6 +308,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public bool MWAIT;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class OtherConditionTuple
{
///
@@ -285,6 +331,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public DeviceInfo[] Infos;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public struct DeviceGeometry
{
///
@@ -317,6 +366,10 @@ namespace DiscImageChef.Decoders.PCMCIA
public byte Interleaving;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public class DeviceGeometryTuple
{
///
@@ -333,6 +386,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public DeviceGeometry[] Geometries;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class FunctionIdentificationTuple
{
///
@@ -357,6 +413,10 @@ namespace DiscImageChef.Decoders.PCMCIA
public bool POST;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public class ManufacturerIdentificationTuple
{
///
@@ -377,6 +437,10 @@ namespace DiscImageChef.Decoders.PCMCIA
public ushort CardID;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public class Level1VersionTuple
{
///
@@ -409,6 +473,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public string[] AdditionalInformation;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class Level2VersionTuple
{
///
@@ -453,6 +520,9 @@ namespace DiscImageChef.Decoders.PCMCIA
public string Information;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class GeometryTuple
{
///
diff --git a/PCMCIA/VendorCode.cs b/PCMCIA/VendorCode.cs
index 9a4fd69e9..364b8a41f 100644
--- a/PCMCIA/VendorCode.cs
+++ b/PCMCIA/VendorCode.cs
@@ -30,8 +30,11 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.PCMCIA
{
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
public static class VendorCode
{
public static string Prettify(ushort id)
diff --git a/SCSI/DiscStructureCapabilities.cs b/SCSI/DiscStructureCapabilities.cs
index b4289f4e3..ef202bb4d 100644
--- a/SCSI/DiscStructureCapabilities.cs
+++ b/SCSI/DiscStructureCapabilities.cs
@@ -31,9 +31,14 @@
// ****************************************************************************/
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class DiscStructureCapabilities
{
public struct Capability
@@ -64,10 +69,12 @@ namespace DiscImageChef.Decoders.SCSI
while(offset < response.Length)
{
- Capability cap = new Capability();
- cap.FormatCode = response[offset];
- cap.SDS = (response[offset + 1] & 0x80) == 0x80;
- cap.RDS = (response[offset + 1] & 0x40) == 0x40;
+ Capability cap = new Capability
+ {
+ FormatCode = response[offset],
+ SDS = (response[offset + 1] & 0x80) == 0x80,
+ RDS = (response[offset + 1] & 0x40) == 0x40
+ };
caps.Add(cap);
offset += 4;
}
diff --git a/SCSI/EVPD.cs b/SCSI/EVPD.cs
index d14ac39aa..752a1ff22 100644
--- a/SCSI/EVPD.cs
+++ b/SCSI/EVPD.cs
@@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
@@ -39,6 +40,11 @@ using DiscImageChef.Decoders.ATA;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
+ [SuppressMessage("ReSharper", "UnassignedField.Global")]
public static class EVPD
{
///
@@ -48,9 +54,7 @@ namespace DiscImageChef.Decoders.SCSI
/// Page 0x00.
public static byte[] DecodePage00(byte[] page)
{
- if(page == null) return null;
-
- if(page[1] != 0) return null;
+ if(page?[1] != 0) return null;
if(page.Length != page[3] + 4) return null;
@@ -88,9 +92,7 @@ namespace DiscImageChef.Decoders.SCSI
/// Page 0x80.
public static string DecodePage80(byte[] page)
{
- if(page == null) return null;
-
- if(page[1] != 0x80) return null;
+ if(page?[1] != 0x80) return null;
if(page.Length != page[3] + 4) return null;
@@ -140,21 +142,20 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_81? DecodePage_81(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0x81) return null;
+ if(pageResponse?[1] != 0x81) return null;
if(pageResponse[3] + 4 != pageResponse.Length) return null;
if(pageResponse.Length < 6) return null;
- Page_81 decoded = new Page_81();
-
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
- decoded.Current = (ScsiDefinitions)(pageResponse[4] & 0x7F);
- decoded.Default = (ScsiDefinitions)(pageResponse[5] & 0x7F);
+ Page_81 decoded = new Page_81
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4),
+ Current = (ScsiDefinitions)(pageResponse[4] & 0x7F),
+ Default = (ScsiDefinitions)(pageResponse[5] & 0x7F)
+ };
int position = 6;
List definitions = new List();
@@ -222,9 +223,7 @@ namespace DiscImageChef.Decoders.SCSI
/// Page 0x82.
public static string DecodePage82(byte[] page)
{
- if(page == null) return null;
-
- if(page[1] != 0x82) return null;
+ if(page?[1] != 0x82) return null;
if(page.Length != page[3] + 4) return null;
@@ -378,32 +377,34 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_83? DecodePage_83(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0x83) return null;
+ if(pageResponse?[1] != 0x83) return null;
if(pageResponse[3] + 4 != pageResponse.Length) return null;
if(pageResponse.Length < 6) return null;
- Page_83 decoded = new Page_83();
+ Page_83 decoded = new Page_83
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4)
+ };
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
int position = 4;
List descriptors = new List();
while(position < pageResponse.Length)
{
- IdentificatonDescriptor descriptor = new IdentificatonDescriptor();
- descriptor.ProtocolIdentifier = (ProtocolIdentifiers)((pageResponse[position] & 0xF0) >> 4);
- descriptor.CodeSet = (IdentificationCodeSet)(pageResponse[position] & 0x0F);
- descriptor.PIV |= (pageResponse[position + 1] & 0x80) == 0x80;
- descriptor.Association = (IdentificationAssociation)((pageResponse[position + 1] & 0x30) >> 4);
- descriptor.Type = (IdentificationTypes)(pageResponse[position + 1] & 0x0F);
- descriptor.Length = pageResponse[position + 3];
+ IdentificatonDescriptor descriptor = new IdentificatonDescriptor
+ {
+ ProtocolIdentifier = (ProtocolIdentifiers)((pageResponse[position] & 0xF0) >> 4),
+ CodeSet = (IdentificationCodeSet)(pageResponse[position] & 0x0F),
+ PIV = (pageResponse[position + 1] & 0x80) == 0x80,
+ Association = (IdentificationAssociation)((pageResponse[position + 1] & 0x30) >> 4),
+ Type = (IdentificationTypes)(pageResponse[position + 1] & 0x0F),
+ Length = pageResponse[position + 3]
+ };
descriptor.Binary = new byte[descriptor.Length];
if(descriptor.Length + position + 4 >= pageResponse.Length)
descriptor.Length = (byte)(pageResponse.Length - position - 4);
@@ -534,6 +535,7 @@ namespace DiscImageChef.Decoders.SCSI
(byte)descriptor.CodeSet).AppendLine();
break;
}
+
break;
case IdentificationTypes.Inquiry:
switch(descriptor.CodeSet) {
@@ -550,6 +552,7 @@ namespace DiscImageChef.Decoders.SCSI
(byte)descriptor.CodeSet).AppendLine();
break;
}
+
break;
case IdentificationTypes.EUI:
if(descriptor.CodeSet == IdentificationCodeSet.ASCII ||
@@ -782,27 +785,26 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_84? DecodePage_84(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0x84) return null;
+ if(pageResponse?[1] != 0x84) return null;
if(pageResponse[3] + 4 != pageResponse.Length) return null;
if(pageResponse.Length < 10) return null;
- Page_84 decoded = new Page_84();
+ Page_84 decoded = new Page_84
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4)
+ };
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
int position = 4;
List identifiers = new List();
while(position < pageResponse.Length)
{
- SoftwareIdentifier identifier = new SoftwareIdentifier();
- identifier.Identifier = new byte[6];
+ SoftwareIdentifier identifier = new SoftwareIdentifier {Identifier = new byte[6]};
Array.Copy(pageResponse, position, identifier.Identifier, 0, 6);
identifiers.Add(identifier);
position += 6;
@@ -909,29 +911,31 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_85? DecodePage_85(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0x85) return null;
+ if(pageResponse?[1] != 0x85) return null;
if((pageResponse[2] << 8) + pageResponse[3] + 4 != pageResponse.Length) return null;
if(pageResponse.Length < 4) return null;
- Page_85 decoded = new Page_85();
+ Page_85 decoded = new Page_85
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4)
+ };
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4);
int position = 4;
List descriptors = new List();
while(position < pageResponse.Length)
{
- NetworkDescriptor descriptor = new NetworkDescriptor();
- descriptor.Association = (IdentificationAssociation)((pageResponse[position] & 0x60) >> 5);
- descriptor.Type = (NetworkServiceTypes)(pageResponse[position] & 0x1F);
- descriptor.Length = (ushort)((pageResponse[position + 2] << 8) + pageResponse[position + 3]);
+ NetworkDescriptor descriptor = new NetworkDescriptor
+ {
+ Association = (IdentificationAssociation)((pageResponse[position] & 0x60) >> 5),
+ Type = (NetworkServiceTypes)(pageResponse[position] & 0x1F),
+ Length = (ushort)((pageResponse[position + 2] << 8) + pageResponse[position + 3])
+ };
descriptor.Address = new byte[descriptor.Length];
Array.Copy(pageResponse, position + 4, descriptor.Address, 0, descriptor.Length);
@@ -1164,49 +1168,45 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_86? DecodePage_86(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0x86) return null;
+ if(pageResponse?[1] != 0x86) return null;
if(pageResponse[3] + 4 != pageResponse.Length) return null;
if(pageResponse.Length < 64) return null;
- Page_86 decoded = new Page_86();
-
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
-
- decoded.ActivateMicrocode = (byte)((pageResponse[4] & 0xC0) >> 6);
- decoded.SPT = (byte)((pageResponse[4] & 0x38) >> 3);
- decoded.GRD_CHK |= (pageResponse[4] & 0x04) == 0x04;
- decoded.APP_CHK |= (pageResponse[4] & 0x02) == 0x02;
- decoded.REF_CHK |= (pageResponse[4] & 0x01) == 0x01;
- decoded.UASK_SUP |= (pageResponse[5] & 0x20) == 0x20;
- decoded.GROUP_SUP |= (pageResponse[5] & 0x10) == 0x10;
- decoded.PRIOR_SUP |= (pageResponse[5] & 0x08) == 0x08;
- decoded.HEADSUP |= (pageResponse[5] & 0x04) == 0x04;
- decoded.ORDSUP |= (pageResponse[5] & 0x02) == 0x02;
- decoded.SIMPSUP |= (pageResponse[5] & 0x01) == 0x01;
- decoded.WU_SUP |= (pageResponse[6] & 0x08) == 0x08;
- decoded.CRD_SUP |= (pageResponse[6] & 0x04) == 0x04;
- decoded.NV_SUP |= (pageResponse[6] & 0x02) == 0x02;
- decoded.V_SUP |= (pageResponse[6] & 0x01) == 0x01;
- decoded.NO_PI_CHK |= (pageResponse[7] & 0x20) == 0x20;
- decoded.P_I_I_SUP |= (pageResponse[7] & 0x10) == 0x10;
- decoded.LUICLR |= (pageResponse[7] & 0x01) == 0x01;
- decoded.R_SUP |= (pageResponse[8] & 0x10) == 0x10;
- decoded.HSSRELEF |= (pageResponse[8] & 0x02) == 0x02;
- decoded.CBCS |= (pageResponse[8] & 0x01) == 0x01;
- decoded.Nexus = (byte)(pageResponse[9] & 0x0F);
- decoded.ExtendedTestMinutes = (ushort)((pageResponse[10] << 8) + pageResponse[11]);
- decoded.POA_SUP |= (pageResponse[12] & 0x80) == 0x80;
- decoded.HRA_SUP |= (pageResponse[12] & 0x40) == 0x40;
- decoded.VSA_SUP |= (pageResponse[12] & 0x20) == 0x20;
- decoded.MaximumSenseLength = pageResponse[13];
-
- return decoded;
+ return new Page_86
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4),
+ ActivateMicrocode = (byte)((pageResponse[4] & 0xC0) >> 6),
+ SPT = (byte)((pageResponse[4] & 0x38) >> 3),
+ GRD_CHK = (pageResponse[4] & 0x04) == 0x04,
+ APP_CHK = (pageResponse[4] & 0x02) == 0x02,
+ REF_CHK = (pageResponse[4] & 0x01) == 0x01,
+ UASK_SUP = (pageResponse[5] & 0x20) == 0x20,
+ GROUP_SUP = (pageResponse[5] & 0x10) == 0x10,
+ PRIOR_SUP = (pageResponse[5] & 0x08) == 0x08,
+ HEADSUP = (pageResponse[5] & 0x04) == 0x04,
+ ORDSUP = (pageResponse[5] & 0x02) == 0x02,
+ SIMPSUP = (pageResponse[5] & 0x01) == 0x01,
+ WU_SUP = (pageResponse[6] & 0x08) == 0x08,
+ CRD_SUP = (pageResponse[6] & 0x04) == 0x04,
+ NV_SUP = (pageResponse[6] & 0x02) == 0x02,
+ V_SUP = (pageResponse[6] & 0x01) == 0x01,
+ NO_PI_CHK = (pageResponse[7] & 0x20) == 0x20,
+ P_I_I_SUP = (pageResponse[7] & 0x10) == 0x10,
+ LUICLR = (pageResponse[7] & 0x01) == 0x01,
+ R_SUP = (pageResponse[8] & 0x10) == 0x10,
+ HSSRELEF = (pageResponse[8] & 0x02) == 0x02,
+ CBCS = (pageResponse[8] & 0x01) == 0x01,
+ Nexus = (byte)(pageResponse[9] & 0x0F),
+ ExtendedTestMinutes = (ushort)((pageResponse[10] << 8) + pageResponse[11]),
+ POA_SUP = (pageResponse[12] & 0x80) == 0x80,
+ HRA_SUP = (pageResponse[12] & 0x40) == 0x40,
+ VSA_SUP = (pageResponse[12] & 0x20) == 0x20,
+ MaximumSenseLength = pageResponse[13]
+ };
}
public static string PrettifyPage_86(byte[] pageResponse)
@@ -1254,6 +1254,7 @@ namespace DiscImageChef.Decoders.SCSI
.AppendLine();
break;
}
+
break;
case PeripheralDeviceTypes.SequentialAccess when page.SPT == 1: sb.AppendLine("Logical unit supports logical block protection");
break;
@@ -1346,25 +1347,23 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_89? DecodePage_89(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0x89) return null;
+ if(pageResponse?[1] != 0x89) return null;
if((pageResponse[2] << 8) + pageResponse[3] + 4 != pageResponse.Length) return null;
if(pageResponse.Length < 572) return null;
- Page_89 decoded = new Page_89();
-
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4);
-
- decoded.VendorIdentification = new byte[8];
- decoded.ProductIdentification = new byte[16];
- decoded.ProductRevisionLevel = new byte[4];
- decoded.Signature = new byte[20];
- decoded.IdentifyData = new byte[512];
+ Page_89 decoded = new Page_89
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4),
+ VendorIdentification = new byte[8],
+ ProductIdentification = new byte[16],
+ ProductRevisionLevel = new byte[4],
+ Signature = new byte[20],
+ IdentifyData = new byte[512]
+ };
Array.Copy(pageResponse, 8, decoded.VendorIdentification, 0, 8);
Array.Copy(pageResponse, 8, decoded.ProductIdentification, 0, 16);
@@ -1478,25 +1477,25 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_C0_Quantum? DecodePage_C0_Quantum(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0xC0) return null;
+ if(pageResponse?[1] != 0xC0) return null;
if(pageResponse[3] != 20) return null;
if(pageResponse.Length != 36) return null;
- Page_C0_Quantum decoded = new Page_C0_Quantum();
+ Page_C0_Quantum decoded = new Page_C0_Quantum
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4),
+ ServoFirmwareChecksum = (ushort)((pageResponse[4] << 8) + pageResponse[5]),
+ ServoEEPROMChecksum = (ushort)((pageResponse[6] << 8) + pageResponse[7]),
+ ReadWriteFirmwareChecksum =
+ (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) + (pageResponse[10] << 8) +
+ pageResponse[11]),
+ ReadWriteFirmwareBuildData = new byte[24]
+ };
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
-
- decoded.ServoFirmwareChecksum = (ushort)((pageResponse[4] << 8) + pageResponse[5]);
- decoded.ServoEEPROMChecksum = (ushort)((pageResponse[6] << 8) + pageResponse[7]);
- decoded.ReadWriteFirmwareChecksum = (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) +
- (pageResponse[10] << 8) + pageResponse[11]);
- decoded.ReadWriteFirmwareBuildData = new byte[24];
Array.Copy(pageResponse, 12, decoded.ReadWriteFirmwareBuildData, 0, 24);
return decoded;
@@ -1565,16 +1564,16 @@ namespace DiscImageChef.Decoders.SCSI
if(pageResponse.Length != 96) return null;
- Page_C0_C1_Certance decoded = new Page_C0_C1_Certance();
-
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
-
- decoded.Component = new byte[26];
- decoded.Version = new byte[19];
- decoded.Date = new byte[24];
- decoded.Variant = new byte[23];
+ Page_C0_C1_Certance decoded = new Page_C0_C1_Certance
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4),
+ Component = new byte[26],
+ Version = new byte[19],
+ Date = new byte[24],
+ Variant = new byte[23]
+ };
Array.Copy(pageResponse, 4, decoded.Component, 0, 26);
Array.Copy(pageResponse, 30, decoded.Version, 0, 19);
@@ -1644,13 +1643,14 @@ namespace DiscImageChef.Decoders.SCSI
if(pageResponse.Length != 16) return null;
- Page_C2_C3_C4_C5_C6_Certance decoded = new Page_C2_C3_C4_C5_C6_Certance();
+ Page_C2_C3_C4_C5_C6_Certance decoded = new Page_C2_C3_C4_C5_C6_Certance
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4),
+ SerialNumber = new byte[12]
+ };
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
-
- decoded.SerialNumber = new byte[12];
Array.Copy(pageResponse, 4, decoded.SerialNumber, 0, 12);
return decoded;
@@ -1789,41 +1789,38 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_DF_Certance? DecodePage_DF_Certance(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0xDF) return null;
+ if(pageResponse?[1] != 0xDF) return null;
if(pageResponse[3] != 60) return null;
if(pageResponse.Length != 64) return null;
- Page_DF_Certance decoded = new Page_DF_Certance();
-
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
-
- decoded.CmdFwd = (byte)((pageResponse[5] & 0xC0) >> 5);
- decoded.Alerts |= (pageResponse[5] & 0x20) == 0x20;
- decoded.NoRemov |= (pageResponse[5] & 0x08) == 0x08;
- decoded.UnitRsvd |= (pageResponse[5] & 0x04) == 0x04;
- decoded.Clean |= (pageResponse[5] & 0x01) == 0x01;
- decoded.Threaded |= (pageResponse[6] & 0x10) == 0x10;
- decoded.Lun1Cmd |= (pageResponse[6] & 0x08) == 0x08;
- decoded.AutoloadMode = (byte)(pageResponse[6] & 0x07);
- decoded.CartridgeType = pageResponse[8];
- decoded.CartridgeFormat = pageResponse[9];
- decoded.CartridgeCapacity = (ushort)((pageResponse[10] << 8) + pageResponse[11] + 4);
- decoded.PortATransportType = pageResponse[12];
- decoded.PortASelectionID = pageResponse[15];
- decoded.OperatingHours = (uint)((pageResponse[20] << 24) + (pageResponse[21] << 16) +
- (pageResponse[22] << 8) + pageResponse[23]);
+ Page_DF_Certance decoded = new Page_DF_Certance
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4),
+ CmdFwd = (byte)((pageResponse[5] & 0xC0) >> 5),
+ Alerts = (pageResponse[5] & 0x20) == 0x20,
+ NoRemov = (pageResponse[5] & 0x08) == 0x08,
+ UnitRsvd = (pageResponse[5] & 0x04) == 0x04,
+ Clean = (pageResponse[5] & 0x01) == 0x01,
+ Threaded = (pageResponse[6] & 0x10) == 0x10,
+ Lun1Cmd = (pageResponse[6] & 0x08) == 0x08,
+ AutoloadMode = (byte)(pageResponse[6] & 0x07),
+ CartridgeType = pageResponse[8],
+ CartridgeFormat = pageResponse[9],
+ CartridgeCapacity = (ushort)((pageResponse[10] << 8) + pageResponse[11] + 4),
+ PortATransportType = pageResponse[12],
+ PortASelectionID = pageResponse[15],
+ OperatingHours = (uint)((pageResponse[20] << 24) + (pageResponse[21] << 16) + (pageResponse[22] << 8) +
+ pageResponse[23]),
+ CartridgeSerialNumber = new byte[32]
+ };
byte[] buf = new byte[8];
Array.Copy(pageResponse, 24, buf, 0, 8);
decoded.InitiatorID = BitConverter.ToUInt64(buf.Reverse().ToArray(), 0);
-
- decoded.CartridgeSerialNumber = new byte[32];
Array.Copy(pageResponse, 32, decoded.CartridgeSerialNumber, 0, 32);
return decoded;
@@ -1984,22 +1981,22 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_C0_IBM? DecodePage_C0_IBM(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0xC0) return null;
+ if(pageResponse?[1] != 0xC0) return null;
if(pageResponse[3] != 39) return null;
if(pageResponse.Length != 43) return null;
- Page_C0_IBM decoded = new Page_C0_IBM();
+ Page_C0_IBM decoded = new Page_C0_IBM
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4),
+ CodeName = new byte[12],
+ Date = new byte[8]
+ };
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
- decoded.CodeName = new byte[12];
- decoded.Date = new byte[8];
Array.Copy(pageResponse, 4, decoded.CodeName, 0, 12);
Array.Copy(pageResponse, 23, decoded.Date, 0, 8);
@@ -2057,22 +2054,20 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_C1_IBM? DecodePage_C1_IBM(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0xC1) return null;
+ if(pageResponse?[1] != 0xC1) return null;
if(pageResponse[3] != 24) return null;
if(pageResponse.Length != 28) return null;
- Page_C1_IBM decoded = new Page_C1_IBM();
-
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
-
- decoded.ManufacturingSerial = new byte[12];
- decoded.ReportedSerial = new byte[12];
+ Page_C1_IBM decoded = new Page_C1_IBM
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4),
+ ManufacturingSerial = new byte[12],
+ ReportedSerial = new byte[12]
+ };
Array.Copy(pageResponse, 4, decoded.ManufacturingSerial, 0, 12);
Array.Copy(pageResponse, 16, decoded.ReportedSerial, 0, 12);
@@ -2132,22 +2127,20 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_B0? DecodePage_B0(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0xB0) return null;
+ if(pageResponse?[1] != 0xB0) return null;
if((pageResponse[2] << 8) + pageResponse[3] + 4 != pageResponse.Length) return null;
if(pageResponse.Length < 5) return null;
- Page_B0 decoded = new Page_B0();
-
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4);
-
- decoded.TSMC = (pageResponse[4] & 0x02) == 0x02;
- decoded.WORM = (pageResponse[4] & 0x01) == 0x01;
+ Page_B0 decoded = new Page_B0
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4),
+ TSMC = (pageResponse[4] & 0x02) == 0x02,
+ WORM = (pageResponse[4] & 0x01) == 0x01
+ };
return decoded;
}
@@ -2176,9 +2169,7 @@ namespace DiscImageChef.Decoders.SCSI
#region EVPD Page 0xB1: Manufacturer-assigned Serial Number page
public static string DecodePageB1(byte[] page)
{
- if(page == null) return null;
-
- if(page[1] != 0xB1) return null;
+ if(page?[1] != 0xB1) return null;
if(page.Length != page[3] + 4) return null;
@@ -2193,9 +2184,7 @@ namespace DiscImageChef.Decoders.SCSI
#region EVPD Page 0xB2: TapeAlert Supported Flags page
public static ulong DecodePageB2(byte[] page)
{
- if(page == null) return 0;
-
- if(page[1] != 0xB2) return 0;
+ if(page?[1] != 0xB2) return 0;
if(page.Length != 12) return 0;
@@ -2210,9 +2199,7 @@ namespace DiscImageChef.Decoders.SCSI
#region EVPD Page 0xB3: Automation Device Serial Number page
public static string DecodePageB3(byte[] page)
{
- if(page == null) return null;
-
- if(page[1] != 0xB3) return null;
+ if(page?[1] != 0xB3) return null;
if(page.Length != page[3] + 4) return null;
@@ -2227,9 +2214,7 @@ namespace DiscImageChef.Decoders.SCSI
#region EVPD Page 0xB4: Data Transfer Device Element Address page
public static string DecodePageB4(byte[] page)
{
- if(page == null) return null;
-
- if(page[1] != 0xB3) return null;
+ if(page?[1] != 0xB3) return null;
if(page.Length != page[3] + 4) return null;
@@ -2280,12 +2265,13 @@ namespace DiscImageChef.Decoders.SCSI
if(pageResponse.Length < 4) return null;
- Page_C0_to_C5_HP decoded = new Page_C0_to_C5_HP();
-
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
- decoded.PageCode = pageResponse[1];
+ Page_C0_to_C5_HP decoded = new Page_C0_to_C5_HP
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4),
+ PageCode = pageResponse[1]
+ };
if(pageResponse[3] == 92 && pageResponse.Length >= 96)
{
@@ -2305,24 +2291,20 @@ namespace DiscImageChef.Decoders.SCSI
if(pageResponse[4] != pageResponse[3] - 1) return null;
List array = new List();
- string fwRegExStr =
- "Firmware Rev\\s+=\\s+(?\\d+\\.\\d+)\\s+Build date\\s+=\\s+(?(\\w|\\d|\\s*.)*)\\s*$";
- string fwcRegExStr = "FW_CONF\\s+=\\s+(?0x[0-9A-Fa-f]{8})\\s*$";
- string servoRegExStr = "Servo\\s+Rev\\s+=\\s+(?\\d+\\.\\d+)\\s*$";
+ const string fwRegExStr = @"Firmware Rev\s+=\s+(?\d+\.\d+)\s+Build date\s+=\s+(?(\w|\d|\s*.)*)\s*$";
+ const string fwcRegExStr = @"FW_CONF\s+=\s+(?0x[0-9A-Fa-f]{8})\s*$";
+ const string servoRegExStr = @"Servo\s+Rev\s+=\s+(?\d+\.\d+)\s*$";
Regex fwRegEx = new Regex(fwRegExStr);
Regex fwcRegEx = new Regex(fwcRegExStr);
Regex servoRegEx = new Regex(servoRegExStr);
- Match fwMatch;
- Match fwcMatch;
- Match servoMatch;
for(int pos = 5; pos < pageResponse.Length; pos++)
if(pageResponse[pos] == 0x00)
{
string str = StringHandlers.CToString(array.ToArray());
- fwMatch = fwRegEx.Match(str);
- fwcMatch = fwcRegEx.Match(str);
- servoMatch = servoRegEx.Match(str);
+ Match fwMatch = fwRegEx.Match(str);
+ Match fwcMatch = fwcRegEx.Match(str);
+ Match servoMatch = servoRegEx.Match(str);
if(str.ToLowerInvariant().StartsWith("copyright", StringComparison.Ordinal))
decoded.Copyright = Encoding.ASCII.GetBytes(str);
@@ -2426,24 +2408,24 @@ namespace DiscImageChef.Decoders.SCSI
public static Page_C0_Seagate? DecodePage_C0_Seagate(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if(pageResponse[1] != 0xC0) return null;
+ if(pageResponse?[1] != 0xC0) return null;
if(pageResponse[3] != 12) return null;
if(pageResponse.Length != 16) return null;
- Page_C0_Seagate decoded = new Page_C0_Seagate();
+ Page_C0_Seagate decoded = new Page_C0_Seagate
+ {
+ PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
+ PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
+ PageLength = (byte)(pageResponse[3] + 4),
+ PageCode = pageResponse[1],
+ ControllerFirmware = new byte[4],
+ BootFirmware = new byte[4],
+ ServoFirmware = new byte[4]
+ };
- decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
- decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
- decoded.PageLength = (byte)(pageResponse[3] + 4);
- decoded.PageCode = pageResponse[1];
- decoded.ControllerFirmware = new byte[4];
- decoded.BootFirmware = new byte[4];
- decoded.ServoFirmware = new byte[4];
Array.Copy(pageResponse, 4, decoded.ControllerFirmware, 0, 4);
Array.Copy(pageResponse, 8, decoded.BootFirmware, 0, 4);
diff --git a/SCSI/Enums.cs b/SCSI/Enums.cs
index 225ae4cc7..e2b7b246b 100644
--- a/SCSI/Enums.cs
+++ b/SCSI/Enums.cs
@@ -30,6 +30,8 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.SCSI
{
public enum PeripheralQualifiers : byte
@@ -56,6 +58,7 @@ namespace DiscImageChef.Decoders.SCSI
VendorMask = 0x04
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum PeripheralDeviceTypes : byte
{
///
@@ -152,6 +155,7 @@ namespace DiscImageChef.Decoders.SCSI
UnknownDevice = 0x1F
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum ANSIVersions : byte
{
///
@@ -184,6 +188,7 @@ namespace DiscImageChef.Decoders.SCSI
ANSI2008Version = 0x06
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum ECMAVersions : byte
{
///
@@ -196,6 +201,7 @@ namespace DiscImageChef.Decoders.SCSI
ECMA111 = 0x01
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum ISOVersions : byte
{
///
@@ -208,6 +214,7 @@ namespace DiscImageChef.Decoders.SCSI
ISO1995Version = 0x02
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum SPIClocking : byte
{
///
@@ -228,6 +235,7 @@ namespace DiscImageChef.Decoders.SCSI
STandDT = 0x03
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum TGPSValues : byte
{
///
@@ -248,6 +256,7 @@ namespace DiscImageChef.Decoders.SCSI
Both = 0x03
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum ProtocolIdentifiers : byte
{
///
@@ -304,6 +313,7 @@ namespace DiscImageChef.Decoders.SCSI
NoProtocol = 15
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum ScsiDefinitions : byte
{
Current = 0,
diff --git a/SCSI/Inquiry.cs b/SCSI/Inquiry.cs
index 805a2a85a..4beb2b6d4 100644
--- a/SCSI/Inquiry.cs
+++ b/SCSI/Inquiry.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using DiscImageChef.Console;
@@ -48,6 +49,9 @@ namespace DiscImageChef.Decoders.SCSI
/// RFC 7144
/// ECMA-111
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Inquiry
{
#region Public methods
diff --git a/SCSI/MMC/AACS.cs b/SCSI/MMC/AACS.cs
index 1b93a7b7b..f5c7dfa49 100644
--- a/SCSI/MMC/AACS.cs
+++ b/SCSI/MMC/AACS.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI.MMC
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class AACS
{
public struct AACSVolumeIdentifier
@@ -463,8 +468,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
StringBuilder sb = new StringBuilder();
if(response.MaxLBAExtents == 0)
- if(response.DataLength > 2) sb.AppendLine("Drive can store 256 LBA Extents");
- else sb.AppendLine("Drive cannot store LBA Extents");
+ sb.AppendLine(response.DataLength > 2
+ ? "Drive can store 256 LBA Extents"
+ : "Drive cannot store LBA Extents");
else sb.AppendFormat("Drive can store {0} LBA Extents", response.MaxLBAExtents).AppendLine();
for(int i = 0; i < response.Extents.Length; i++)
diff --git a/SCSI/MMC/CPRM.cs b/SCSI/MMC/CPRM.cs
index db291bb5b..a07b3d05d 100644
--- a/SCSI/MMC/CPRM.cs
+++ b/SCSI/MMC/CPRM.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI.MMC
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class CPRM
{
public struct CPRMMediaKeyBlock
diff --git a/SCSI/MMC/DiscInformation.cs b/SCSI/MMC/DiscInformation.cs
index 2bcd1ec18..6de866fc4 100644
--- a/SCSI/MMC/DiscInformation.cs
+++ b/SCSI/MMC/DiscInformation.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI.MMC
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class DiscInformation
{
public struct StandardDiscInformation
@@ -279,8 +284,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
if((response[2] & 0xE0) != 0) return null;
- StandardDiscInformation decoded = new StandardDiscInformation();
- decoded.DataLength = (ushort)((response[0] << 8) + response[1]);
+ StandardDiscInformation decoded =
+ new StandardDiscInformation {DataLength = (ushort)((response[0] << 8) + response[1])};
if(decoded.DataLength + 2 != response.Length) return null;
@@ -417,8 +422,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
(decoded.LastPossibleLeadOutStartLBA & 0xFF00) >> 8,
decoded.LastPossibleLeadOutStartLBA & 0xFF).AppendLine();
- if(decoded.URU) sb.AppendLine("Disc is defined for unrestricted use");
- else sb.AppendLine("Disc is defined for restricted use");
+ sb.AppendLine(decoded.URU ? "Disc is defined for unrestricted use" : "Disc is defined for restricted use");
if(decoded.DID_V) sb.AppendFormat("Disc ID: {0:X6}", decoded.DiscIdentification & 0x00FFFFFF).AppendLine();
if(decoded.DBC_V) sb.AppendFormat("Disc barcode: {0:X16}", decoded.DiscBarcode).AppendLine();
@@ -440,8 +444,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
if((response[2] & 0xE0) != 0x20) return null;
- TrackResourcesInformation decoded = new TrackResourcesInformation();
- decoded.DataLength = (ushort)((response[0] << 8) + response[1]);
+ TrackResourcesInformation decoded =
+ new TrackResourcesInformation {DataLength = (ushort)((response[0] << 8) + response[1])};
if(decoded.DataLength + 2 != response.Length) return null;
@@ -479,8 +483,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
if((response[2] & 0xE0) != 0x40) return null;
- POWResourcesInformation decoded = new POWResourcesInformation();
- decoded.DataLength = (ushort)((response[0] << 8) + response[1]);
+ POWResourcesInformation decoded =
+ new POWResourcesInformation {DataLength = (ushort)((response[0] << 8) + response[1])};
if(decoded.DataLength + 2 != response.Length) return null;
diff --git a/SCSI/MMC/Enums.cs b/SCSI/MMC/Enums.cs
index 28fce67f8..94c5448a0 100644
--- a/SCSI/MMC/Enums.cs
+++ b/SCSI/MMC/Enums.cs
@@ -30,8 +30,12 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.SCSI.MMC
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
public enum FormatLayerTypeCodes : ushort
{
CDLayer = 0x0008,
@@ -40,6 +44,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
HDDVDLayer = 0x0050
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
public enum SessionStatusCodes : byte
{
Empty = 0x00,
@@ -48,6 +54,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
Complete = 0x03
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
public enum DiscStatusCodes : byte
{
Empty = 0x00,
@@ -56,6 +64,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
Others = 0x03
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
public enum BGFormatStatusCodes : byte
{
NoFormattable = 0x00,
@@ -64,6 +74,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
FormatComplete = 0x03
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
public enum DiscTypeCodes : byte
{
///
diff --git a/SCSI/MMC/Features.cs b/SCSI/MMC/Features.cs
index 462e2c4d0..db3c5152c 100644
--- a/SCSI/MMC/Features.cs
+++ b/SCSI/MMC/Features.cs
@@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
// ReSharper disable MemberCanBePrivate.Global
@@ -41,6 +42,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// MMC Feature enumeration
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum FeatureNumber : ushort
{
///
@@ -285,6 +287,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// MMC Profile enumeration
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum ProfileNumber : ushort
{
///
@@ -445,6 +448,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
Unconforming = 0xFFFF
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum PhysicalInterfaces : uint
{
///
@@ -489,6 +493,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
Vendor = 0xFFFF
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Profile
{
public ProfileNumber Number;
@@ -498,6 +505,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Profile List Feature (0000h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0000
{
///
@@ -521,6 +531,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Core Feature (0001h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0001
{
///
@@ -552,6 +565,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Morphing Feature (0002h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0002
{
///
@@ -580,6 +596,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Removable Medium Feature (0003h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0003
{
///
@@ -623,6 +642,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Write Protect Feature (0004h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0004
{
///
@@ -658,6 +680,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Random Readable Feature (0010h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0010
{
///
@@ -689,6 +714,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Multi-Read Feature (001Dh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_001D
{
///
@@ -708,6 +736,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// CD Read Feature (001Eh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_001E
{
///
@@ -739,6 +770,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// DVD Read Feature (001Fh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_001F
{
///
@@ -770,6 +804,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Random Writable Feature (0020h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0020
{
///
@@ -805,6 +842,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Incremental Streaming Writable Feature (0021h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0021
{
///
@@ -844,6 +884,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Sector Erasable Feature (0022h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0022
{
///
@@ -863,6 +906,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Formattable Feature (0023h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0023
{
///
@@ -906,6 +952,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Hardware Defect Management Feature (0024h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0024
{
///
@@ -929,6 +978,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Write Once Feature (0025h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0025
{
///
@@ -960,6 +1012,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Restricted Overwrite Feature (0026h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0026
{
///
@@ -979,6 +1034,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// CD-RW CAV Write Feature (0027h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0027
{
///
@@ -998,6 +1056,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// MRW Feature (0028h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0028
{
///
@@ -1029,6 +1090,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Enhanced Defect Reporting Feature (0029h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0029
{
///
@@ -1060,6 +1124,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// DVD+RW Feature (002Ah)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_002A
{
///
@@ -1091,6 +1158,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// DVD+R Feature (002Bh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_002B
{
///
@@ -1114,6 +1184,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Rigid Restricted Overwrite Feature (002Ch)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_002C
{
///
@@ -1149,6 +1222,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// CD Track at Once Feature (002Dh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_002D
{
///
@@ -1196,6 +1272,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// CD Mastering (Session at Once) Feature (002Eh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_002E
{
///
@@ -1247,6 +1326,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// DVD-R/-RW Write Feature (002Fh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_002F
{
///
@@ -1282,6 +1364,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Double Density CD Read Feature (0030h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0030
{
///
@@ -1301,6 +1386,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Double Density CD-R Write Feature (0031h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0031
{
///
@@ -1324,6 +1412,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Double Density CD-RW Write Feature (0032h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0032
{
///
@@ -1351,6 +1442,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Layer Jump Recording Feature (0033h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0033
{
///
@@ -1371,6 +1465,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Stop Long Operation Feature (0035h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0035
{
///
@@ -1390,6 +1487,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// CD-RW Media Write Support Feature (0037h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0037
{
///
@@ -1413,6 +1513,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// BD-R Pseudo-Overwrite (POW) Feature (0038h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0038
{
///
@@ -1432,6 +1535,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// DVD+RW Dual Layer Feature (003Ah)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_003A
{
///
@@ -1463,6 +1569,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// DVD+R Dual Layer Feature (003Bh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_003B
{
///
@@ -1494,6 +1603,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// BD Read Feature (0040h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0040
{
///
@@ -1545,6 +1657,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// BD Write Feature (0041h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0041
{
///
@@ -1588,6 +1703,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// TSR Feature (0042h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0042
{
///
@@ -1607,6 +1725,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// HD DVD Read Feature (0050h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0050
{
///
@@ -1634,6 +1755,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// HD DVD Write Feature (0051h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0051
{
///
@@ -1661,6 +1785,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Hybrid Disc Feature (0080h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0080
{
///
@@ -1684,6 +1811,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Power Management Feature (0100h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0100
{
///
@@ -1703,6 +1833,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// S.M.A.R.T. Feature (0101h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0101
{
///
@@ -1726,6 +1859,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Embedded Changer Feature (0102h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0102
{
///
@@ -1757,6 +1893,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// CD Audio External Play Feature (0103h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0103
{
///
@@ -1792,6 +1931,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Microcode Upgrade Feature (0104h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0104
{
///
@@ -1815,6 +1957,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Time-Out Feature (0105h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0105
{
///
@@ -1842,6 +1987,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// DVD-CSS Feature (0106h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0106
{
///
@@ -1865,6 +2013,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Real Time Streaming Feature (0107h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0107
{
///
@@ -1908,6 +2059,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Drive serial number (0108h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0108
{
///
@@ -1931,6 +2085,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Media Serial Number Feature (0109h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0109
{
///
@@ -1950,6 +2107,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Disc Control Blocks Feature (010Ah)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_010A
{
///
@@ -1970,6 +2130,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// DVD CPRM Feature (010Bh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_010B
{
///
@@ -1993,6 +2156,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// Firmware Information Feature (010Ch)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_010C
{
///
@@ -2019,6 +2185,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// AACS Feature (010Dh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_010D
{
///
@@ -2070,6 +2239,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// DVD CSS Managed Recording Feature (010Eh)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_010E
{
///
@@ -2093,6 +2265,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// SecurDisc Feature (0113h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0113
{
///
@@ -2112,6 +2287,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// OSSC Feature (0142h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0142
{
///
@@ -2144,6 +2322,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
///
/// VCPS Feature (0110h)
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct Feature_0110
{
///
@@ -2184,8 +2365,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
List listProfiles = new List();
while(offset < feature.Length)
{
- Profile prof = new Profile();
- prof.Number = (ProfileNumber)((feature[offset] << 8) + feature[offset + 1]);
+ Profile prof = new Profile {Number = (ProfileNumber)((feature[offset] << 8) + feature[offset + 1])};
prof.Current |= (feature[offset + 2] & 0x01) == 0x01;
listProfiles.Add(prof);
offset += 4;
@@ -3861,8 +4041,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
sb.AppendLine("MMC Morphing:");
- if(ftr.Async) sb.AppendLine("\tDrive supports polling and asynchronous GET EVENT STATUS NOTIFICATION");
- else sb.AppendLine("\tDrive supports only polling GET EVENT STATUS NOTIFICATION");
+ sb.AppendLine(ftr.Async
+ ? "\tDrive supports polling and asynchronous GET EVENT STATUS NOTIFICATION"
+ : "\tDrive supports only polling GET EVENT STATUS NOTIFICATION");
if(ftr.OCEvent) sb.AppendLine("\tDrive supports operational change request / notification class events");
@@ -4159,8 +4340,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
sb.AppendLine("MMC Enhanced Defect Reporting Feature:");
- if(ftr.DRTDM) sb.AppendLine("\tDrive supports DRT-DM mode");
- else sb.AppendLine("\tDrive supports Persistent-DM mode");
+ sb.AppendLine(ftr.DRTDM ? "\tDrive supports DRT-DM mode" : "\tDrive supports Persistent-DM mode");
if(ftr.DBICacheZones > 0)
sb.AppendFormat("\tDrive has {0} DBI cache zones", ftr.DBICacheZones).AppendLine();
@@ -4181,8 +4361,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
sb.Append("Drive can read and write DVD+RW");
if(ftr.Current) sb.AppendLine(" (current)");
else sb.AppendLine();
- if(ftr.CloseOnly) sb.AppendLine("\tDrive supports only the read compatibility stop");
- else sb.AppendLine("\tDrive supports both forms of background format stopping");
+ sb.AppendLine(ftr.CloseOnly
+ ? "\tDrive supports only the read compatibility stop"
+ : "\tDrive supports both forms of background format stopping");
if(ftr.QuickStart) sb.AppendLine("\tDrive can do a quick start formatting");
}
else
@@ -4226,8 +4407,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
StringBuilder sb = new StringBuilder();
sb.Append("MMC Rigid Restricted Overwrite");
- if(ftr.Current) sb.AppendLine(" (current):");
- else sb.AppendLine(":");
+ sb.AppendLine(ftr.Current ? " (current):" : ":");
if(ftr.Blank) sb.AppendLine("\tDrive supports the BLANK command");
if(ftr.Intermediate)
@@ -4423,8 +4603,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
sb.Append("Drive can read and write DVD+RW DL");
if(ftr.Current) sb.AppendLine(" (current)");
else sb.AppendLine();
- if(ftr.CloseOnly) sb.AppendLine("\tDrive supports only the read compatibility stop");
- else sb.AppendLine("\tDrive supports both forms of background format stopping");
+ sb.AppendLine(ftr.CloseOnly
+ ? "\tDrive supports only the read compatibility stop"
+ : "\tDrive supports both forms of background format stopping");
if(ftr.QuickStart) sb.AppendLine("\tDrive can do a quick start formatting");
}
else
@@ -4468,8 +4649,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
StringBuilder sb = new StringBuilder();
sb.Append("MMC BD Read");
- if(ftr.Current) sb.AppendLine(" (current):");
- else sb.AppendLine(":");
+ sb.AppendLine(ftr.Current ? " (current):" : ":");
if(ftr.OldROM) sb.AppendLine("\tDrive can read BD-ROM pre-1.0");
if(ftr.ROM) sb.AppendLine("\tDrive can read BD-ROM Ver.1");
@@ -4492,8 +4672,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
StringBuilder sb = new StringBuilder();
sb.Append("MMC BD Write");
- if(ftr.Current) sb.AppendLine(" (current):");
- else sb.AppendLine(":");
+ sb.AppendLine(ftr.Current ? " (current):" : ":");
if(ftr.OldR) sb.AppendLine("\tDrive can write BD-R pre-1.0");
if(ftr.R) sb.AppendLine("\tDrive can write BD-R Ver.1");
@@ -4712,7 +4891,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
if(ftr.DCBs == null) return sb.ToString();
- foreach(uint DCB in ftr.DCBs) sb.AppendFormat("Drive supports DCB {0:X8}h", DCB).AppendLine();
+ foreach(uint dcb in ftr.DCBs) sb.AppendFormat("Drive supports DCB {0:X8}h", dcb).AppendLine();
return sb.ToString();
}
@@ -4738,35 +4917,32 @@ namespace DiscImageChef.Decoders.SCSI.MMC
Feature_010C ftr = feature.Value;
StringBuilder sb = new StringBuilder();
- string syear, smonth, sday, shour, sminute, ssecond;
- byte[] temp;
-
- temp = new byte[4];
+ byte[] temp = new byte[4];
temp[0] = (byte)((ftr.Century & 0xFF00) >> 8);
temp[1] = (byte)(ftr.Century & 0xFF);
temp[2] = (byte)((ftr.Year & 0xFF00) >> 8);
temp[3] = (byte)(ftr.Year & 0xFF);
- syear = Encoding.ASCII.GetString(temp);
+ string syear = Encoding.ASCII.GetString(temp);
temp = new byte[2];
temp[0] = (byte)((ftr.Month & 0xFF00) >> 8);
temp[1] = (byte)(ftr.Month & 0xFF);
- smonth = Encoding.ASCII.GetString(temp);
+ string smonth = Encoding.ASCII.GetString(temp);
temp = new byte[2];
temp[0] = (byte)((ftr.Day & 0xFF00) >> 8);
temp[1] = (byte)(ftr.Day & 0xFF);
- sday = Encoding.ASCII.GetString(temp);
+ string sday = Encoding.ASCII.GetString(temp);
temp = new byte[2];
temp[0] = (byte)((ftr.Hour & 0xFF00) >> 8);
temp[1] = (byte)(ftr.Hour & 0xFF);
- shour = Encoding.ASCII.GetString(temp);
+ string shour = Encoding.ASCII.GetString(temp);
temp = new byte[2];
temp[0] = (byte)((ftr.Minute & 0xFF00) >> 8);
temp[1] = (byte)(ftr.Minute & 0xFF);
- sminute = Encoding.ASCII.GetString(temp);
+ string sminute = Encoding.ASCII.GetString(temp);
temp = new byte[2];
temp[0] = (byte)((ftr.Second & 0xFF00) >> 8);
temp[1] = (byte)(ftr.Second & 0xFF);
- ssecond = Encoding.ASCII.GetString(temp);
+ string ssecond = Encoding.ASCII.GetString(temp);
try
{
@@ -4776,7 +4952,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
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 { }
+ catch
+ {
+ // ignored
+ }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
return sb.ToString();
@@ -4834,8 +5013,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
Feature_0110 ftr = feature.Value;
StringBuilder sb = new StringBuilder();
- if(ftr.Current) sb.AppendLine("Drive and currently inserted media support VCPS");
- else sb.AppendLine("Drive supports VCPS");
+ sb.AppendLine(ftr.Current ? "Drive and currently inserted media support VCPS" : "Drive supports VCPS");
return sb.ToString();
}
@@ -4847,8 +5025,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
Feature_0113 ftr = feature.Value;
StringBuilder sb = new StringBuilder();
- if(ftr.Current) sb.AppendLine("Drive and currently inserted media support SecurDisc");
- else sb.AppendLine("Drive supports SecurDisc");
+ sb.AppendLine(ftr.Current
+ ? "Drive and currently inserted media support SecurDisc"
+ : "Drive supports SecurDisc");
return sb.ToString();
}
@@ -5165,12 +5344,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC
return Prettify_0142(Decode_0142(feature));
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct FeatureDescriptor
{
public ushort Code;
public byte[] Data;
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct SeparatedFeatures
{
public uint DataLength;
@@ -5180,17 +5365,21 @@ namespace DiscImageChef.Decoders.SCSI.MMC
public static SeparatedFeatures Separate(byte[] response)
{
- SeparatedFeatures dec = new SeparatedFeatures();
- dec.DataLength = (uint)((response[0] << 24) + (response[1] << 16) + (response[2] << 8) + response[4]);
- dec.CurrentProfile = (ushort)((response[6] << 8) + response[7]);
+ SeparatedFeatures dec = new SeparatedFeatures
+ {
+ DataLength = (uint)((response[0] << 24) + (response[1] << 16) + (response[2] << 8) + response[4]),
+ CurrentProfile = (ushort)((response[6] << 8) + response[7])
+ };
uint offset = 8;
List descLst = new List();
while(offset + 4 < response.Length)
{
- FeatureDescriptor desc = new FeatureDescriptor();
- desc.Code = (ushort)((response[offset + 0] << 8) + response[offset + 1]);
- desc.Data = new byte[response[offset + 3] + 4];
+ FeatureDescriptor desc = new FeatureDescriptor
+ {
+ Code = (ushort)((response[offset + 0] << 8) + response[offset + 1]),
+ Data = new byte[response[offset + 3] + 4]
+ };
if(desc.Data.Length + offset > response.Length) desc.Data = new byte[response.Length - offset];
Array.Copy(response, offset, desc.Data, 0, desc.Data.Length);
offset += (uint)desc.Data.Length;
diff --git a/SCSI/MMC/Hybrid.cs b/SCSI/MMC/Hybrid.cs
index 227001d05..633e54f2c 100644
--- a/SCSI/MMC/Hybrid.cs
+++ b/SCSI/MMC/Hybrid.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI.MMC
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class Hybrid
{
public struct RecognizedFormatLayers
diff --git a/SCSI/MMC/WriteProtect.cs b/SCSI/MMC/WriteProtect.cs
index ad1362cd6..0ac4b2ff6 100644
--- a/SCSI/MMC/WriteProtect.cs
+++ b/SCSI/MMC/WriteProtect.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI.MMC
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
/// T10/1675-D revision 4
/// T10/1836-D revision 2g
///
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class WriteProtect
{
public struct WriteProtectionStatus
diff --git a/SCSI/Modes/00_SFF.cs b/SCSI/Modes/00_SFF.cs
index fde4894d4..0610196fc 100644
--- a/SCSI/Modes/00_SFF.cs
+++ b/SCSI/Modes/00_SFF.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x00: Drive Operation Mode page
diff --git a/SCSI/Modes/01.cs b/SCSI/Modes/01.cs
index f54424c63..af79ce502 100644
--- a/SCSI/Modes/01.cs
+++ b/SCSI/Modes/01.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x01: Read-write error recovery page
diff --git a/SCSI/Modes/01_MMC.cs b/SCSI/Modes/01_MMC.cs
index affb08cad..8aa632ab8 100644
--- a/SCSI/Modes/01_MMC.cs
+++ b/SCSI/Modes/01_MMC.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x01: Read error recovery page for MultiMedia Devices
diff --git a/SCSI/Modes/02.cs b/SCSI/Modes/02.cs
index 94ae2bbc4..ae0581247 100644
--- a/SCSI/Modes/02.cs
+++ b/SCSI/Modes/02.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x02: Disconnect-reconnect page
diff --git a/SCSI/Modes/03.cs b/SCSI/Modes/03.cs
index f88b289c1..bb241cee6 100644
--- a/SCSI/Modes/03.cs
+++ b/SCSI/Modes/03.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x03: Format device page
diff --git a/SCSI/Modes/04.cs b/SCSI/Modes/04.cs
index bb7edbb02..6a654b7ca 100644
--- a/SCSI/Modes/04.cs
+++ b/SCSI/Modes/04.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x04: Rigid disk drive geometry page
diff --git a/SCSI/Modes/05.cs b/SCSI/Modes/05.cs
index 6d0e9e1c9..f81a9d975 100644
--- a/SCSI/Modes/05.cs
+++ b/SCSI/Modes/05.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x05: Flexible disk page
@@ -263,18 +267,15 @@ namespace DiscImageChef.Decoders.SCSI
break;
case 1:
sb.Append("\tPin 34 indicates drive is ready when active ");
- if((page.Pin34 & 0x08) == 0x08) sb.Append("high");
- else sb.Append("low");
+ sb.Append((page.Pin34 & 0x08) == 0x08 ? "high" : "low");
break;
case 2:
sb.Append("\tPin 34 indicates disk has changed when active ");
- if((page.Pin34 & 0x08) == 0x08) sb.Append("high");
- else sb.Append("low");
+ sb.Append((page.Pin34 & 0x08) == 0x08 ? "high" : "low");
break;
default:
sb.AppendFormat("\tPin 34 indicates unknown function {0} when active ", page.Pin34 & 0x07);
- if((page.Pin34 & 0x08) == 0x08) sb.Append("high");
- else sb.Append("low");
+ sb.Append((page.Pin34 & 0x08) == 0x08 ? "high" : "low");
break;
}
@@ -285,23 +286,19 @@ namespace DiscImageChef.Decoders.SCSI
break;
case 1:
sb.Append("\tPin 4 indicates drive is in use when active ");
- if((page.Pin4 & 0x08) == 0x08) sb.Append("high");
- else sb.Append("low");
+ sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
break;
case 2:
sb.Append("\tPin 4 indicates eject when active ");
- if((page.Pin4 & 0x08) == 0x08) sb.Append("high");
- else sb.Append("low");
+ sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
break;
case 3:
sb.Append("\tPin 4 indicates head load when active ");
- if((page.Pin4 & 0x08) == 0x08) sb.Append("high");
- else sb.Append("low");
+ sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
break;
default:
sb.AppendFormat("\tPin 4 indicates unknown function {0} when active ", page.Pin4 & 0x07);
- if((page.Pin4 & 0x08) == 0x08) sb.Append("high");
- else sb.Append("low");
+ sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
break;
}
@@ -312,8 +309,7 @@ namespace DiscImageChef.Decoders.SCSI
break;
default:
sb.AppendFormat("\tPin 2 indicates unknown function {0} when active ", page.Pin2 & 0x07);
- if((page.Pin2 & 0x08) == 0x08) sb.Append("high");
- else sb.Append("low");
+ sb.Append((page.Pin2 & 0x08) == 0x08 ? "high" : "low");
break;
}
@@ -324,13 +320,11 @@ namespace DiscImageChef.Decoders.SCSI
break;
case 1:
sb.Append("\tPin 1 indicates disk change reset when active ");
- if((page.Pin1 & 0x08) == 0x08) sb.Append("high");
- else sb.Append("low");
+ sb.Append((page.Pin1 & 0x08) == 0x08 ? "high" : "low");
break;
default:
sb.AppendFormat("\tPin 1 indicates unknown function {0} when active ", page.Pin1 & 0x07);
- if((page.Pin1 & 0x08) == 0x08) sb.Append("high");
- else sb.Append("low");
+ sb.Append((page.Pin1 & 0x08) == 0x08 ? "high" : "low");
break;
}
diff --git a/SCSI/Modes/06.cs b/SCSI/Modes/06.cs
index 1dcc5c00f..51f443f8b 100644
--- a/SCSI/Modes/06.cs
+++ b/SCSI/Modes/06.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x06: Optical memory page
diff --git a/SCSI/Modes/07.cs b/SCSI/Modes/07.cs
index efba1ae23..cf0c172b5 100644
--- a/SCSI/Modes/07.cs
+++ b/SCSI/Modes/07.cs
@@ -30,10 +30,15 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static partial class Modes
{
#region Mode Page 0x07: Verify error recovery page
diff --git a/SCSI/Modes/07_MMC.cs b/SCSI/Modes/07_MMC.cs
index 502689735..48bc92958 100644
--- a/SCSI/Modes/07_MMC.cs
+++ b/SCSI/Modes/07_MMC.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x07: Verify error recovery page for MultiMedia Devices
diff --git a/SCSI/Modes/08.cs b/SCSI/Modes/08.cs
index ae73cbd55..3141c5930 100644
--- a/SCSI/Modes/08.cs
+++ b/SCSI/Modes/08.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x08: Caching page
diff --git a/SCSI/Modes/0A.cs b/SCSI/Modes/0A.cs
index 20323f31e..6eec37c51 100644
--- a/SCSI/Modes/0A.cs
+++ b/SCSI/Modes/0A.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x0A: Control mode page
@@ -391,9 +395,7 @@ namespace DiscImageChef.Decoders.SCSI
public static ModePage_0A_S01? DecodeModePage_0A_S01(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if((pageResponse[0] & 0x40) != 0x40) return null;
+ if((pageResponse?[0] & 0x40) != 0x40) return null;
if((pageResponse[0] & 0x3F) != 0x0A) return null;
diff --git a/SCSI/Modes/0B.cs b/SCSI/Modes/0B.cs
index 491e68bc2..63f6a759b 100644
--- a/SCSI/Modes/0B.cs
+++ b/SCSI/Modes/0B.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x0B: Medium types supported page
diff --git a/SCSI/Modes/0D.cs b/SCSI/Modes/0D.cs
index 545b374ad..3dc0fe323 100644
--- a/SCSI/Modes/0D.cs
+++ b/SCSI/Modes/0D.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x0D: CD-ROM parameteres page
diff --git a/SCSI/Modes/0E.cs b/SCSI/Modes/0E.cs
index d698c8ff3..0a21ad758 100644
--- a/SCSI/Modes/0E.cs
+++ b/SCSI/Modes/0E.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x0E: CD-ROM audio control parameters page
@@ -147,8 +151,9 @@ namespace DiscImageChef.Decoders.SCSI
sb.AppendLine("SCSI CD-ROM audio control parameters page:");
if(page.PS) sb.AppendLine("\tParameters can be saved");
- if(page.Immed) sb.AppendLine("\tDrive will return from playback command immediately");
- else sb.AppendLine("\tDrive will return from playback command when playback ends");
+ sb.AppendLine(page.Immed
+ ? "\tDrive will return from playback command immediately"
+ : "\tDrive will return from playback command when playback ends");
if(page.SOTC) sb.AppendLine("\tDrive will stop playback on track end");
if(page.APRVal)
diff --git a/SCSI/Modes/0F.cs b/SCSI/Modes/0F.cs
index a86344ef2..aa1d5cbbb 100644
--- a/SCSI/Modes/0F.cs
+++ b/SCSI/Modes/0F.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x0F: Data compression page
diff --git a/SCSI/Modes/10.cs b/SCSI/Modes/10.cs
index b450a6287..84bbc111f 100644
--- a/SCSI/Modes/10.cs
+++ b/SCSI/Modes/10.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x10: XOR control mode page
diff --git a/SCSI/Modes/10_SSC.cs b/SCSI/Modes/10_SSC.cs
index 12ebb3a7d..b730188b9 100644
--- a/SCSI/Modes/10_SSC.cs
+++ b/SCSI/Modes/10_SSC.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x10: Device configuration page
@@ -237,8 +241,9 @@ namespace DiscImageChef.Decoders.SCSI
if(page.DBR)
{
sb.AppendLine("\tDrive supports recovering data from buffer");
- if(page.RBO) sb.AppendLine("\tRecovered buffer data comes in LIFO order");
- else sb.AppendLine("\tRecovered buffer data comes in FIFO order");
+ sb.AppendLine(page.RBO
+ ? "\tRecovered buffer data comes in LIFO order"
+ : "\tRecovered buffer data comes in FIFO order");
}
if(page.BIS) sb.AppendLine("\tMedium supports block IDs");
if(page.RSmk) sb.AppendLine("\tDrive reports setmarks");
@@ -313,8 +318,9 @@ namespace DiscImageChef.Decoders.SCSI
if(page.PRMWP) sb.AppendLine("\tPermanent write protect is enabled");
if(page.BAML)
- if(page.BAM) sb.AppendLine("\tDrive operates using explicit address mode");
- else sb.AppendLine("\tDrive operates using implicit address mode");
+ sb.AppendLine(page.BAM
+ ? "\tDrive operates using explicit address mode"
+ : "\tDrive operates using implicit address mode");
switch(page.RewindOnReset)
{
diff --git a/SCSI/Modes/11.cs b/SCSI/Modes/11.cs
index 42638bccc..a918b2980 100644
--- a/SCSI/Modes/11.cs
+++ b/SCSI/Modes/11.cs
@@ -31,10 +31,14 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x11: Medium partition page (1)
diff --git a/SCSI/Modes/12_13_14.cs b/SCSI/Modes/12_13_14.cs
index 8cc211b73..25183d810 100644
--- a/SCSI/Modes/12_13_14.cs
+++ b/SCSI/Modes/12_13_14.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Pages 0x12, 0x13, 0x14: Medium partition page (2-4)
diff --git a/SCSI/Modes/1A.cs b/SCSI/Modes/1A.cs
index 69dd53da8..796ccfefc 100644
--- a/SCSI/Modes/1A.cs
+++ b/SCSI/Modes/1A.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x1A: Power condition page
@@ -219,9 +223,7 @@ namespace DiscImageChef.Decoders.SCSI
public static ModePage_1A_S01? DecodeModePage_1A_S01(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if((pageResponse[0] & 0x40) != 0x40) return null;
+ if((pageResponse?[0] & 0x40) != 0x40) return null;
if((pageResponse[0] & 0x3F) != 0x1A) return null;
diff --git a/SCSI/Modes/1B.cs b/SCSI/Modes/1B.cs
index 9a7f02eb9..75f1a46ef 100644
--- a/SCSI/Modes/1B.cs
+++ b/SCSI/Modes/1B.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x1B: Removable Block Access Capabilities page
diff --git a/SCSI/Modes/1C.cs b/SCSI/Modes/1C.cs
index 80e934943..5ef6239be 100644
--- a/SCSI/Modes/1C.cs
+++ b/SCSI/Modes/1C.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x1C: Informational exceptions control page
@@ -247,9 +251,7 @@ namespace DiscImageChef.Decoders.SCSI
public static ModePage_1C_S01? DecodeModePage_1C_S01(byte[] pageResponse)
{
- if(pageResponse == null) return null;
-
- if((pageResponse[0] & 0x40) != 0x40) return null;
+ if((pageResponse?[0] & 0x40) != 0x40) return null;
if((pageResponse[0] & 0x3F) != 0x1C) return null;
diff --git a/SCSI/Modes/1C_SFF.cs b/SCSI/Modes/1C_SFF.cs
index 8cee682cd..5ac84b2f5 100644
--- a/SCSI/Modes/1C_SFF.cs
+++ b/SCSI/Modes/1C_SFF.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x1C: Timer & Protect page
diff --git a/SCSI/Modes/1D.cs b/SCSI/Modes/1D.cs
index 72a69bba9..d2b87b753 100644
--- a/SCSI/Modes/1D.cs
+++ b/SCSI/Modes/1D.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x1D: Medium Configuration Mode Page
diff --git a/SCSI/Modes/21_Certance.cs b/SCSI/Modes/21_Certance.cs
index e11d9316f..695d190a4 100644
--- a/SCSI/Modes/21_Certance.cs
+++ b/SCSI/Modes/21_Certance.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Certance Mode Page 0x21: Drive Capabilities Control Mode page
diff --git a/SCSI/Modes/22_Certance.cs b/SCSI/Modes/22_Certance.cs
index bcd7b5496..ea02cf213 100644
--- a/SCSI/Modes/22_Certance.cs
+++ b/SCSI/Modes/22_Certance.cs
@@ -30,10 +30,15 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static partial class Modes
{
#region Certance Mode Page 0x22: Interface Control Mode Page
@@ -124,8 +129,9 @@ namespace DiscImageChef.Decoders.SCSI
break;
}
- if(page.StopBits) sb.AppendLine("Library interface transmits 2 stop bits per byte");
- else sb.AppendLine("Library interface transmits 1 stop bits per byte");
+ sb.AppendLine(page.StopBits
+ ? "Library interface transmits 2 stop bits per byte"
+ : "Library interface transmits 1 stop bits per byte");
switch(page.CmdFwd)
{
@@ -160,11 +166,11 @@ namespace DiscImageChef.Decoders.SCSI
.AppendLine();
sb.AppendFormat("\tDrive jumpers choose SCSI ID {0}", page.JumperedSelectionID).AppendLine();
- if(page.PortAEnabled) sb.AppendLine("\tSCSI port is enabled");
- else sb.AppendLine("\tSCSI port is disabled");
+ sb.AppendLine(page.PortAEnabled ? "\tSCSI port is enabled" : "\tSCSI port is disabled");
- if(page.PortAEnabledOnPower) sb.AppendLine("\tSCSI port will be enabled on next power up");
- else sb.AppendLine("\tSCSI port will be disabled on next power up");
+ sb.AppendLine(page.PortAEnabledOnPower
+ ? "\tSCSI port will be enabled on next power up"
+ : "\tSCSI port will be disabled on next power up");
return sb.ToString();
}
diff --git a/SCSI/Modes/24_IBM.cs b/SCSI/Modes/24_IBM.cs
index 683a0c4e8..f57a35a25 100644
--- a/SCSI/Modes/24_IBM.cs
+++ b/SCSI/Modes/24_IBM.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region IBM Mode Page 0x24: Drive Capabilities Control Mode page
diff --git a/SCSI/Modes/2A.cs b/SCSI/Modes/2A.cs
index 8ea416d50..7c32372ea 100644
--- a/SCSI/Modes/2A.cs
+++ b/SCSI/Modes/2A.cs
@@ -30,11 +30,16 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static partial class Modes
{
#region Mode Page 0x2A: CD-ROM capabilities page
@@ -279,11 +284,11 @@ namespace DiscImageChef.Decoders.SCSI
for(int i = 0; i < descriptors; i++)
{
- decoded.WriteSpeedPerformanceDescriptors[i] = new ModePage_2A_WriteDescriptor();
- decoded.WriteSpeedPerformanceDescriptors[i].RotationControl =
- (byte)(pageResponse[1 + 32 + i * 4] & 0x07);
- decoded.WriteSpeedPerformanceDescriptors[i].WriteSpeed =
- (ushort)((pageResponse[2 + 32 + i * 4] << 8) + pageResponse[3 + 32 + i * 4]);
+ decoded.WriteSpeedPerformanceDescriptors[i] = new ModePage_2A_WriteDescriptor
+ {
+ RotationControl = (byte)(pageResponse[1 + 32 + i * 4] & 0x07),
+ WriteSpeed = (ushort)((pageResponse[2 + 32 + i * 4] << 8) + pageResponse[3 + 32 + i * 4])
+ };
}
return decoded;
@@ -345,14 +350,15 @@ namespace DiscImageChef.Decoders.SCSI
if(page.PreventJumper)
{
sb.AppendLine("\tDrive power ups locked");
- if(page.LockState) sb.AppendLine("\tDrive is locked, media cannot be ejected or inserted");
- else sb.AppendLine("\tDrive is not locked, media can be ejected and inserted");
+ sb.AppendLine(page.LockState
+ ? "\tDrive is locked, media cannot be ejected or inserted"
+ : "\tDrive is not locked, media can be ejected and inserted");
}
else
{
- if(page.LockState)
- sb.AppendLine("\tDrive is locked, media cannot be ejected, but if empty, can be inserted");
- else sb.AppendLine("\tDrive is not locked, media can be ejected and inserted");
+ sb.AppendLine(page.LockState
+ ? "\tDrive is locked, media cannot be ejected, but if empty, can be inserted"
+ : "\tDrive is not locked, media can be ejected and inserted");
}
if(page.Eject) sb.AppendLine("\tDrive can eject media");
@@ -369,23 +375,19 @@ namespace DiscImageChef.Decoders.SCSI
if(page.ReadCDR)
{
- if(page.WriteCDR) sb.AppendLine("\tDrive can read and write CD-R");
- else sb.AppendLine("\tDrive can read CD-R");
+ sb.AppendLine(page.WriteCDR ? "\tDrive can read and write CD-R" : "\tDrive can read CD-R");
if(page.Method2) sb.AppendLine("\tDrive supports reading CD-R packet media");
}
if(page.ReadCDRW)
- if(page.WriteCDRW) sb.AppendLine("\tDrive can read and write CD-RW");
- else sb.AppendLine("\tDrive can read CD-RW");
+ sb.AppendLine(page.WriteCDRW ? "\tDrive can read and write CD-RW" : "\tDrive can read CD-RW");
if(page.ReadDVDROM) sb.AppendLine("\tDrive can read DVD-ROM");
if(page.ReadDVDR)
- if(page.WriteDVDR) sb.AppendLine("\tDrive can read and write DVD-R");
- else sb.AppendLine("\tDrive can read DVD-R");
+ sb.AppendLine(page.WriteDVDR ? "\tDrive can read and write DVD-R" : "\tDrive can read DVD-R");
if(page.ReadDVDRAM)
- if(page.WriteDVDRAM) sb.AppendLine("\tDrive can read and write DVD-RAM");
- else sb.AppendLine("\tDrive can read DVD-RAM");
+ sb.AppendLine(page.WriteDVDRAM ? "\tDrive can read and write DVD-RAM" : "\tDrive can read DVD-RAM");
if(page.Composite) sb.AppendLine("\tDrive can deliver a composite audio and video data stream");
if(page.DigitalPort1) sb.AppendLine("\tDrive supports IEC-958 digital output on port 1");
diff --git a/SCSI/Modes/2F_IBM.cs b/SCSI/Modes/2F_IBM.cs
index 1d83c5efa..7116c8f0e 100644
--- a/SCSI/Modes/2F_IBM.cs
+++ b/SCSI/Modes/2F_IBM.cs
@@ -30,10 +30,15 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "UnassignedField.Global")]
public static partial class Modes
{
#region IBM Mode Page 0x2F: Behaviour Configuration Mode page
@@ -66,22 +71,20 @@ namespace DiscImageChef.Decoders.SCSI
if(pageResponse.Length < 8) return null;
- IBM_ModePage_2F decoded = new IBM_ModePage_2F();
-
- decoded.PS |= (pageResponse[0] & 0x80) == 0x80;
- decoded.FenceBehaviour = pageResponse[2];
- decoded.CleanBehaviour = pageResponse[3];
- decoded.WORMEmulation = pageResponse[4];
- decoded.SenseDataBehaviour = pageResponse[5];
- decoded.CCDM |= (pageResponse[6] & 0x04) == 0x04;
- decoded.DDEOR |= (pageResponse[6] & 0x02) == 0x02;
- decoded.CLNCHK |= (pageResponse[6] & 0x01) == 0x01;
- decoded.FirmwareUpdateBehaviour = pageResponse[7];
- decoded.UOE_C = (byte)((pageResponse[8] & 0x30) >> 4);
- decoded.UOE_F = (byte)((pageResponse[8] & 0x0C) >> 2);
- decoded.UOE_F = (byte)(pageResponse[8] & 0x03);
-
- return decoded;
+ return new IBM_ModePage_2F
+ {
+ PS = (pageResponse[0] & 0x80) == 0x80,
+ FenceBehaviour = pageResponse[2],
+ CleanBehaviour = pageResponse[3],
+ WORMEmulation = pageResponse[4],
+ SenseDataBehaviour = pageResponse[5],
+ CCDM = (pageResponse[6] & 0x04) == 0x04,
+ DDEOR = (pageResponse[6] & 0x02) == 0x02,
+ CLNCHK = (pageResponse[6] & 0x01) == 0x01,
+ FirmwareUpdateBehaviour = pageResponse[7],
+ UOE_C = (byte)((pageResponse[8] & 0x30) >> 4),
+ UOE_F = (byte)((pageResponse[8] & 0x0C) >> 2)
+ };
}
public static string PrettifyIBMModePage_2F(byte[] pageResponse)
diff --git a/SCSI/Modes/30_Apple.cs b/SCSI/Modes/30_Apple.cs
index cd71298c8..802eb6d06 100644
--- a/SCSI/Modes/30_Apple.cs
+++ b/SCSI/Modes/30_Apple.cs
@@ -31,10 +31,14 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Apple Mode Page 0x30: Apple OEM String
diff --git a/SCSI/Modes/3B_HP.cs b/SCSI/Modes/3B_HP.cs
index 83a112832..1a5ffc39b 100644
--- a/SCSI/Modes/3B_HP.cs
+++ b/SCSI/Modes/3B_HP.cs
@@ -31,10 +31,14 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region HP Mode Page 0x3B: Serial Number Override Mode page
diff --git a/SCSI/Modes/3C_HP.cs b/SCSI/Modes/3C_HP.cs
index 2d15f9b16..5bf307ead 100644
--- a/SCSI/Modes/3C_HP.cs
+++ b/SCSI/Modes/3C_HP.cs
@@ -31,10 +31,14 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region HP Mode Page 0x3C: Device Time Mode page
diff --git a/SCSI/Modes/3D_HP.cs b/SCSI/Modes/3D_HP.cs
index 24291cb7b..037225792 100644
--- a/SCSI/Modes/3D_HP.cs
+++ b/SCSI/Modes/3D_HP.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region HP Mode Page 0x3D: Extended Reset Mode page
diff --git a/SCSI/Modes/3D_IBM.cs b/SCSI/Modes/3D_IBM.cs
index 4a722e125..a1dce0416 100644
--- a/SCSI/Modes/3D_IBM.cs
+++ b/SCSI/Modes/3D_IBM.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region IBM Mode Page 0x3D: Behaviour Configuration Mode page
diff --git a/SCSI/Modes/3E_Fujitsu.cs b/SCSI/Modes/3E_Fujitsu.cs
index 93cce9014..90db56528 100644
--- a/SCSI/Modes/3E_Fujitsu.cs
+++ b/SCSI/Modes/3E_Fujitsu.cs
@@ -31,10 +31,15 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static partial class Modes
{
#region Fujitsu Mode Page 0x3E: Verify Control page
diff --git a/SCSI/Modes/3E_HP.cs b/SCSI/Modes/3E_HP.cs
index da5c7743a..3b6bad1a7 100644
--- a/SCSI/Modes/3E_HP.cs
+++ b/SCSI/Modes/3E_HP.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region HP Mode Page 0x3E: CD-ROM Emulation/Disaster Recovery Mode page
@@ -82,8 +86,7 @@ namespace DiscImageChef.Decoders.SCSI
if(page.PS) sb.AppendLine("\tParameters can be saved");
- if(page.CDmode) sb.AppendLine("\tDrive is emulating a CD-ROM drive");
- else sb.AppendLine("\tDrive is not emulating a CD-ROM drive");
+ sb.AppendLine(page.CDmode ? "\tDrive is emulating a CD-ROM drive" : "\tDrive is not emulating a CD-ROM drive");
if(page.NonAuto) sb.AppendLine("\tDrive will not exit emulation automatically");
return sb.ToString();
diff --git a/SCSI/Modes/Headers.cs b/SCSI/Modes/Headers.cs
index 5f66c9fc8..aa65b94cc 100644
--- a/SCSI/Modes/Headers.cs
+++ b/SCSI/Modes/Headers.cs
@@ -30,10 +30,14 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
public static string GetMediumTypeDescription(MediumTypes type)
diff --git a/SCSI/Modes/Mode10.cs b/SCSI/Modes/Mode10.cs
index d2d255af3..0ad5137a7 100644
--- a/SCSI/Modes/Mode10.cs
+++ b/SCSI/Modes/Mode10.cs
@@ -32,10 +32,14 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
public static ModeHeader? DecodeModeHeader10(byte[] modeResponse, PeripheralDeviceTypes deviceType)
@@ -50,8 +54,7 @@ namespace DiscImageChef.Decoders.SCSI
if(modeResponse.Length < modeLength) return null;
- ModeHeader header = new ModeHeader();
- header.MediumType = (MediumTypes)modeResponse[2];
+ ModeHeader header = new ModeHeader {MediumType = (MediumTypes)modeResponse[2]};
bool longLBA = (modeResponse[4] & 0x01) == 0x01;
@@ -61,8 +64,7 @@ namespace DiscImageChef.Decoders.SCSI
header.BlockDescriptors = new BlockDescriptor[blockDescLength / 16];
for(int i = 0; i < header.BlockDescriptors.Length; i++)
{
- header.BlockDescriptors[i] = new BlockDescriptor();
- header.BlockDescriptors[i].Density = DensityType.Default;
+ header.BlockDescriptors[i] = new BlockDescriptor {Density = DensityType.Default};
byte[] temp = new byte[8];
temp[0] = modeResponse[7 + i * 16 + 8];
temp[1] = modeResponse[6 + i * 16 + 8];
@@ -134,8 +136,7 @@ namespace DiscImageChef.Decoders.SCSI
ModeHeader? hdr = DecodeModeHeader10(modeResponse, deviceType);
if(!hdr.HasValue) return null;
- DecodedMode decoded = new DecodedMode();
- decoded.Header = hdr.Value;
+ DecodedMode decoded = new DecodedMode {Header = hdr.Value};
bool longlba = (modeResponse[4] & 0x01) == 0x01;
int offset;
int blkDrLength = 0;
@@ -199,18 +200,12 @@ namespace DiscImageChef.Decoders.SCSI
return decoded;
}
- public static byte[] EncodeModeHeader10(ModeHeader header, PeripheralDeviceTypes deviceType)
- {
- return EncodeModeHeader10(header, deviceType, false);
- }
-
- public static byte[] EncodeModeHeader10(ModeHeader header, PeripheralDeviceTypes deviceType, bool longLBA)
+ public static byte[] EncodeModeHeader10(ModeHeader header, PeripheralDeviceTypes deviceType, bool longLBA = false)
{
byte[] hdr;
if(header.BlockDescriptors != null)
- if(longLBA) hdr = new byte[8 + header.BlockDescriptors.Length * 16];
- else hdr = new byte[8 + header.BlockDescriptors.Length * 8];
+ hdr = longLBA ? new byte[8 + header.BlockDescriptors.Length * 16] : new byte[8 + header.BlockDescriptors.Length * 8];
else hdr = new byte[8];
hdr[2] = (byte)header.MediumType;
diff --git a/SCSI/Modes/Mode6.cs b/SCSI/Modes/Mode6.cs
index f532d0370..387ed3f75 100644
--- a/SCSI/Modes/Mode6.cs
+++ b/SCSI/Modes/Mode6.cs
@@ -32,10 +32,14 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
public static ModeHeader? DecodeModeHeader6(byte[] modeResponse, PeripheralDeviceTypes deviceType)
@@ -43,8 +47,7 @@ namespace DiscImageChef.Decoders.SCSI
if(modeResponse == null || modeResponse.Length < 4 || modeResponse.Length < modeResponse[0] + 1)
return null;
- ModeHeader header = new ModeHeader();
- header.MediumType = (MediumTypes)modeResponse[1];
+ ModeHeader header = new ModeHeader {MediumType = (MediumTypes)modeResponse[1]};
if(modeResponse[3] > 0)
{
@@ -94,8 +97,7 @@ namespace DiscImageChef.Decoders.SCSI
ModeHeader? hdr = DecodeModeHeader6(modeResponse, deviceType);
if(!hdr.HasValue) return null;
- DecodedMode decoded = new DecodedMode();
- decoded.Header = hdr.Value;
+ DecodedMode decoded = new DecodedMode {Header = hdr.Value};
int blkDrLength = 0;
if(decoded.Header.BlockDescriptors != null) blkDrLength = decoded.Header.BlockDescriptors.Length;
@@ -158,10 +160,7 @@ namespace DiscImageChef.Decoders.SCSI
public static byte[] EncodeModeHeader6(ModeHeader header, PeripheralDeviceTypes deviceType)
{
- byte[] hdr;
-
- if(header.BlockDescriptors != null) hdr = new byte[4 + header.BlockDescriptors.Length * 8];
- else hdr = new byte[4];
+ byte[] hdr = header.BlockDescriptors != null ? new byte[4 + header.BlockDescriptors.Length * 8] : new byte[4];
hdr[1] = (byte)header.MediumType;
diff --git a/SCSI/Modes/Structs.cs b/SCSI/Modes/Structs.cs
index dc918a3de..966055c9d 100644
--- a/SCSI/Modes/Structs.cs
+++ b/SCSI/Modes/Structs.cs
@@ -30,8 +30,13 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
public struct BlockDescriptor
diff --git a/SCSI/SSC/BlockLimits.cs b/SCSI/SSC/BlockLimits.cs
index 2f391d71f..b712ec137 100644
--- a/SCSI/SSC/BlockLimits.cs
+++ b/SCSI/SSC/BlockLimits.cs
@@ -31,10 +31,14 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI.SSC
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class BlockLimits
{
public struct BlockLimitsData
@@ -55,17 +59,14 @@ namespace DiscImageChef.Decoders.SCSI.SSC
public static BlockLimitsData? Decode(byte[] response)
{
- if(response == null) return null;
+ if(response?.Length != 6) return null;
- if(response.Length != 6) return null;
-
- BlockLimitsData dec = new BlockLimitsData();
-
- dec.granularity = (byte)(response[0] & 0x1F);
- dec.maxBlockLen = (uint)((response[1] << 16) + (response[2] << 8) + response[3]);
- dec.minBlockLen = (ushort)((response[4] << 8) + response[5]);
-
- return dec;
+ return new BlockLimitsData
+ {
+ granularity = (byte)(response[0] & 0x1F),
+ maxBlockLen = (uint)((response[1] << 16) + (response[2] << 8) + response[3]),
+ minBlockLen = (ushort)((response[4] << 8) + response[5])
+ };
}
public static string Prettify(BlockLimitsData? decoded)
diff --git a/SCSI/SSC/DensitySupport.cs b/SCSI/SSC/DensitySupport.cs
index 09b691670..ce03cd8ac 100644
--- a/SCSI/SSC/DensitySupport.cs
+++ b/SCSI/SSC/DensitySupport.cs
@@ -32,10 +32,15 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SCSI.SSC
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class DensitySupport
{
public struct DensitySupportHeader
@@ -99,26 +104,26 @@ namespace DiscImageChef.Decoders.SCSI.SSC
List descriptors = new List();
int offset = 4;
- byte[] tmp;
while(offset < response.Length)
{
- DensitySupportDescriptor descriptor = new DensitySupportDescriptor();
- descriptor.primaryCode = response[offset + 0];
- descriptor.secondaryCode = response[offset + 1];
- descriptor.writable |= (response[offset + 2] & 0x80) == 0x80;
- descriptor.duplicate |= (response[offset + 2] & 0x40) == 0x40;
- descriptor.defaultDensity |= (response[offset + 2] & 0x20) == 0x20;
- descriptor.reserved = (byte)((response[offset + 2] & 0x1E) >> 1);
- descriptor.lenvalid |= (response[offset + 2] & 0x01) == 0x01;
- descriptor.len = (ushort)((response[offset + 3] << 8) + response[offset + 4]);
- descriptor.bpmm =
- (uint)((response[offset + 5] << 16) + (response[offset + 6] << 8) + response[offset + 7]);
- descriptor.width = (ushort)((response[offset + 8] << 8) + response[offset + 9]);
- descriptor.tracks = (ushort)((response[offset + 10] << 8) + response[offset + 11]);
- descriptor.capacity = (uint)((response[offset + 12] << 24) + (response[offset + 13] << 16) +
- (response[offset + 14] << 8) + response[offset + 15]);
- tmp = new byte[8];
+ DensitySupportDescriptor descriptor = new DensitySupportDescriptor
+ {
+ primaryCode = response[offset + 0],
+ secondaryCode = response[offset + 1],
+ writable = (response[offset + 2] & 0x80) == 0x80,
+ duplicate = (response[offset + 2] & 0x40) == 0x40,
+ defaultDensity = (response[offset + 2] & 0x20) == 0x20,
+ reserved = (byte)((response[offset + 2] & 0x1E) >> 1),
+ lenvalid = (response[offset + 2] & 0x01) == 0x01,
+ len = (ushort)((response[offset + 3] << 8) + response[offset + 4]),
+ bpmm = (uint)((response[offset + 5] << 16) + (response[offset + 6] << 8) + response[offset + 7]),
+ width = (ushort)((response[offset + 8] << 8) + response[offset + 9]),
+ tracks = (ushort)((response[offset + 10] << 8) + response[offset + 11]),
+ capacity = (uint)((response[offset + 12] << 24) + (response[offset + 13] << 16) +
+ (response[offset + 14] << 8) + response[offset + 15])
+ };
+ byte[] tmp = new byte[8];
Array.Copy(response, offset + 16, tmp, 0, 8);
descriptor.organization = StringHandlers.CToString(tmp).Trim();
tmp = new byte[8];
@@ -134,10 +139,12 @@ namespace DiscImageChef.Decoders.SCSI.SSC
descriptors.Add(descriptor);
}
- DensitySupportHeader decoded = new DensitySupportHeader();
- decoded.length = responseLen;
- decoded.reserved = (ushort)((response[2] << 8) + response[3] + 2);
- decoded.descriptors = descriptors.ToArray();
+ DensitySupportHeader decoded = new DensitySupportHeader
+ {
+ length = responseLen,
+ reserved = (ushort)((response[2] << 8) + response[3] + 2),
+ descriptors = descriptors.ToArray()
+ };
return decoded;
}
@@ -187,14 +194,15 @@ namespace DiscImageChef.Decoders.SCSI.SSC
List descriptors = new List();
int offset = 4;
- byte[] tmp;
while(offset < response.Length)
{
- MediaTypeSupportDescriptor descriptor = new MediaTypeSupportDescriptor();
- descriptor.mediumType = response[offset + 0];
- descriptor.reserved1 = response[offset + 1];
- descriptor.len = (ushort)((response[offset + 2] << 8) + response[offset + 3]);
+ MediaTypeSupportDescriptor descriptor = new MediaTypeSupportDescriptor
+ {
+ mediumType = response[offset + 0],
+ reserved1 = response[offset + 1],
+ len = (ushort)((response[offset + 2] << 8) + response[offset + 3])
+ };
if(descriptor.len != 52) return null;
descriptor.numberOfCodes = response[offset + 4];
@@ -204,7 +212,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC
descriptor.length = (ushort)((response[offset + 16] << 8) + response[offset + 17]);
descriptor.reserved1 = response[offset + 18];
descriptor.reserved1 = response[offset + 19];
- tmp = new byte[8];
+ byte[] tmp = new byte[8];
Array.Copy(response, offset + 20, tmp, 0, 8);
descriptor.organization = StringHandlers.CToString(tmp).Trim();
tmp = new byte[8];
@@ -219,10 +227,12 @@ namespace DiscImageChef.Decoders.SCSI.SSC
descriptors.Add(descriptor);
}
- MediaTypeSupportHeader decoded = new MediaTypeSupportHeader();
- decoded.length = responseLen;
- decoded.reserved = (ushort)((response[2] << 8) + response[3] + 2);
- decoded.descriptors = descriptors.ToArray();
+ MediaTypeSupportHeader decoded = new MediaTypeSupportHeader
+ {
+ length = responseLen,
+ reserved = (ushort)((response[2] << 8) + response[3] + 2),
+ descriptors = descriptors.ToArray()
+ };
return decoded;
}
diff --git a/SCSI/Sense.cs b/SCSI/Sense.cs
index ac0c90bc3..fe174ab05 100644
--- a/SCSI/Sense.cs
+++ b/SCSI/Sense.cs
@@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Decoders.ATA;
@@ -48,6 +49,9 @@ namespace DiscImageChef.Decoders.SCSI
Unknown
}
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public struct StandardSense
{
///
@@ -140,6 +144,11 @@ namespace DiscImageChef.Decoders.SCSI
Completed = 0xF
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "UnassignedField.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct FixedSense
{
///
@@ -195,6 +204,9 @@ namespace DiscImageChef.Decoders.SCSI
public byte[] AdditionalSense;
}
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct DescriptorSense
{
///
@@ -216,6 +228,9 @@ namespace DiscImageChef.Decoders.SCSI
public Dictionary Descriptors;
}
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct AnotherProgressIndicationSenseDescriptor
{
public SenseKeys SenseKey;
@@ -224,6 +239,7 @@ namespace DiscImageChef.Decoders.SCSI
public ushort Progress;
}
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Sense
{
///
@@ -265,8 +281,7 @@ namespace DiscImageChef.Decoders.SCSI
public static FixedSense? DecodeFixed(byte[] sense)
{
- string foo;
- return DecodeFixed(sense, out foo);
+ return DecodeFixed(sense, out _);
}
public static FixedSense? DecodeFixed(byte[] sense, out string senseDescription)
@@ -276,16 +291,17 @@ namespace DiscImageChef.Decoders.SCSI
if(sense.Length < 8) return null;
- FixedSense decoded = new FixedSense();
-
- decoded.InformationValid |= (sense[0] & 0x80) == 0x80;
- decoded.SegmentNumber = sense[1];
- decoded.Filemark |= (sense[2] & 0x80) == 0x80;
- decoded.EOM |= (sense[2] & 0x40) == 0x40;
- decoded.ILI |= (sense[2] & 0x20) == 0x20;
- decoded.SenseKey = (SenseKeys)(sense[2] & 0x0F);
- decoded.Information = (uint)((sense[3] << 24) + (sense[4] << 16) + (sense[5] << 8) + sense[6]);
- decoded.AdditionalLength = sense[7];
+ FixedSense decoded = new FixedSense
+ {
+ InformationValid = (sense[0] & 0x80) == 0x80,
+ SegmentNumber = sense[1],
+ Filemark = (sense[2] & 0x80) == 0x80,
+ EOM = (sense[2] & 0x40) == 0x40,
+ ILI = (sense[2] & 0x20) == 0x20,
+ SenseKey = (SenseKeys)(sense[2] & 0x0F),
+ Information = (uint)((sense[3] << 24) + (sense[4] << 16) + (sense[5] << 8) + sense[6]),
+ AdditionalLength = sense[7]
+ };
if(sense.Length >= 12)
decoded.CommandSpecific = (uint)((sense[8] << 24) + (sense[9] << 16) + (sense[10] << 8) + sense[11]);
@@ -311,8 +327,7 @@ namespace DiscImageChef.Decoders.SCSI
public static DescriptorSense? DecodeDescriptor(byte[] sense)
{
- string foo;
- return DecodeDescriptor(sense, out foo);
+ return DecodeDescriptor(sense, out _);
}
public static DescriptorSense? DecodeDescriptor(byte[] sense, out string senseDescription)
@@ -323,13 +338,15 @@ namespace DiscImageChef.Decoders.SCSI
if(sense.Length < 8) return null;
- DescriptorSense decoded = new DescriptorSense();
+ DescriptorSense decoded = new DescriptorSense
+ {
+ SenseKey = (SenseKeys)(sense[1] & 0x0F),
+ ASC = sense[2],
+ ASCQ = sense[3],
+ Overflow = (sense[4] & 0x80) == 0x80,
+ Descriptors = new Dictionary()
+ };
- decoded.SenseKey = (SenseKeys)(sense[1] & 0x0F);
- decoded.ASC = sense[2];
- decoded.ASCQ = sense[3];
- decoded.Overflow |= (sense[4] & 0x80) == 0x80;
- decoded.Descriptors = new Dictionary();
senseDescription = GetSenseDescription(decoded.ASC, decoded.ASCQ);
int offset = 8;
@@ -402,8 +419,9 @@ namespace DiscImageChef.Decoders.SCSI
{
case SenseKeys.IllegalRequest:
{
- if((decoded.SenseKeySpecific & 0x400000) == 0x400000) sb.AppendLine("Illegal field in CDB");
- else sb.AppendLine("Illegal field in data parameters");
+ sb.AppendLine((decoded.SenseKeySpecific & 0x400000) == 0x400000
+ ? "Illegal field in CDB"
+ : "Illegal field in data parameters");
if((decoded.SenseKeySpecific & 0x200000) == 0x200000)
sb.AppendFormat("Invalid value in bit {0} in field {1} of CDB",
@@ -533,14 +551,13 @@ namespace DiscImageChef.Decoders.SCSI
{
if(descriptor.Length != 8 || descriptor[0] != 0x0A) return null;
- AnotherProgressIndicationSenseDescriptor decoded = new AnotherProgressIndicationSenseDescriptor();
-
- decoded.SenseKey = (SenseKeys)descriptor[2];
- decoded.ASC = descriptor[3];
- decoded.ASCQ = descriptor[4];
- decoded.Progress = (ushort)((descriptor[6] << 8) + descriptor[7]);
-
- return decoded;
+ return new AnotherProgressIndicationSenseDescriptor
+ {
+ SenseKey = (SenseKeys)descriptor[2],
+ ASC = descriptor[3],
+ ASCQ = descriptor[4],
+ Progress = (ushort)((descriptor[6] << 8) + descriptor[7])
+ };
}
public static void DecodeDescriptor04(byte[] descriptor)
@@ -568,19 +585,18 @@ namespace DiscImageChef.Decoders.SCSI
throw new NotImplementedException("Check OSD");
}
- public static AtaErrorRegistersLBA48 DecodeDescriptor09(byte[] descriptor)
+ public static AtaErrorRegistersLba48 DecodeDescriptor09(byte[] descriptor)
{
- AtaErrorRegistersLBA48 errorRegisters = new AtaErrorRegistersLBA48();
-
- errorRegisters.error = descriptor[3];
- errorRegisters.sectorCount = (ushort)((descriptor[4] << 8) + descriptor[5]);
- errorRegisters.lbaLow = (ushort)((descriptor[6] << 8) + descriptor[7]);
- errorRegisters.lbaMid = (ushort)((descriptor[8] << 8) + descriptor[9]);
- errorRegisters.lbaHigh = (ushort)((descriptor[10] << 8) + descriptor[11]);
- errorRegisters.deviceHead = descriptor[12];
- errorRegisters.status = descriptor[13];
-
- return errorRegisters;
+ return new AtaErrorRegistersLba48
+ {
+ Error = descriptor[3],
+ SectorCount = (ushort)((descriptor[4] << 8) + descriptor[5]),
+ LbaLow = (ushort)((descriptor[6] << 8) + descriptor[7]),
+ LbaMid = (ushort)((descriptor[8] << 8) + descriptor[9]),
+ LbaHigh = (ushort)((descriptor[10] << 8) + descriptor[11]),
+ DeviceHead = descriptor[12],
+ Status = descriptor[13]
+ };
}
public static void DecodeDescriptor0B(byte[] descriptor)
@@ -626,6 +642,7 @@ namespace DiscImageChef.Decoders.SCSI
}
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public static string GetSenseDescription(byte ASC, byte ASCQ)
{
switch(ASC)
diff --git a/SCSI/Types.cs b/SCSI/Types.cs
index c22ca28e9..32fcddd76 100644
--- a/SCSI/Types.cs
+++ b/SCSI/Types.cs
@@ -30,8 +30,11 @@
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
+using System.Diagnostics.CodeAnalysis;
+
namespace DiscImageChef.Decoders.SCSI
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum MediumTypes : byte
{
Default = 0x00,
@@ -585,6 +588,7 @@ namespace DiscImageChef.Decoders.SCSI
#endregion Medium Types found in vendor documents
}
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum DensityType : byte
{
Default = 0x00,
diff --git a/SCSI/VendorString.cs b/SCSI/VendorString.cs
index 0e5aecffc..8b063957b 100644
--- a/SCSI/VendorString.cs
+++ b/SCSI/VendorString.cs
@@ -34,9 +34,9 @@ namespace DiscImageChef.Decoders.SCSI
{
public static class VendorString
{
- public static string Prettify(string SCSIVendorString)
+ public static string Prettify(string scsiVendorString)
{
- switch(SCSIVendorString)
+ switch(scsiVendorString)
{
case "0B4C": return "MOOSIK Ltd.";
case "13FE": return "PHISON";
@@ -836,7 +836,7 @@ namespace DiscImageChef.Decoders.SCSI
case "ZETTA": return "Zetta Systems, Inc.";
case "ZTE": return "ZTE Corporation";
case "ZVAULT": return "Zetavault";
- default: return SCSIVendorString;
+ default: return scsiVendorString;
}
}
}
diff --git a/SecureDigital/CID.cs b/SecureDigital/CID.cs
index d00ba5ea4..257e441b9 100644
--- a/SecureDigital/CID.cs
+++ b/SecureDigital/CID.cs
@@ -31,10 +31,14 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SecureDigital
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class CID
{
public byte Manufacturer;
@@ -46,18 +50,18 @@ namespace DiscImageChef.Decoders.SecureDigital
public byte CRC;
}
- public partial class Decoders
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ public static partial class Decoders
{
public static CID DecodeCID(uint[] response)
{
- if(response == null) return null;
-
- if(response.Length != 4) return null;
+ if(response?.Length != 4) return null;
byte[] data = new byte[16];
- byte[] tmp;
- tmp = BitConverter.GetBytes(response[0]);
+ byte[] tmp = BitConverter.GetBytes(response[0]);
Array.Copy(tmp, 0, data, 0, 4);
tmp = BitConverter.GetBytes(response[1]);
Array.Copy(tmp, 0, data, 4, 4);
@@ -71,24 +75,22 @@ namespace DiscImageChef.Decoders.SecureDigital
public static CID DecodeCID(byte[] response)
{
- if(response == null) return null;
+ if(response?.Length != 16) return null;
- if(response.Length != 16) return null;
-
- byte[] tmp;
-
- CID cid = new CID();
- cid.Manufacturer = response[0];
- tmp = new byte[2];
+ CID cid = new CID
+ {
+ Manufacturer = response[0],
+ ProductRevision = response[8],
+ ProductSerialNumber = BitConverter.ToUInt32(response, 9),
+ ManufacturingDate = (ushort)(((response[13] & 0x0F) << 4) + response[14]),
+ CRC = (byte)((response[15] & 0xFE) >> 1)
+ };
+ byte[] tmp = new byte[2];
Array.Copy(response, 1, tmp, 0, 2);
cid.ApplicationID = StringHandlers.CToString(tmp);
tmp = new byte[5];
Array.Copy(response, 3, tmp, 0, 5);
cid.ProductName = StringHandlers.CToString(tmp);
- cid.ProductRevision = response[8];
- cid.ProductSerialNumber = BitConverter.ToUInt32(response, 9);
- cid.ManufacturingDate = (ushort)(((response[13] & 0x0F) << 4) + response[14]);
- cid.CRC = (byte)((response[15] & 0xFE) >> 1);
return cid;
}
diff --git a/SecureDigital/CSD.cs b/SecureDigital/CSD.cs
index 076643bf9..e4f9e0041 100644
--- a/SecureDigital/CSD.cs
+++ b/SecureDigital/CSD.cs
@@ -31,10 +31,14 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SecureDigital
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public class CSD
{
public byte Structure;
@@ -68,18 +72,17 @@ namespace DiscImageChef.Decoders.SecureDigital
public byte CRC;
}
- public partial class Decoders
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ public static partial class Decoders
{
public static CSD DecodeCSD(uint[] response)
{
- if(response == null) return null;
-
- if(response.Length != 4) return null;
+ if(response?.Length != 4) return null;
byte[] data = new byte[16];
- byte[] tmp;
- tmp = BitConverter.GetBytes(response[0]);
+ byte[] tmp = BitConverter.GetBytes(response[0]);
Array.Copy(tmp, 0, data, 0, 4);
tmp = BitConverter.GetBytes(response[1]);
Array.Copy(tmp, 0, data, 4, 4);
@@ -93,22 +96,35 @@ namespace DiscImageChef.Decoders.SecureDigital
public static CSD DecodeCSD(byte[] response)
{
- if(response == null) return null;
+ if(response?.Length != 16) return null;
- if(response.Length != 16) return null;
+ CSD csd = new CSD
+ {
+ Structure = (byte)((response[0] & 0xC0) >> 6),
+ TAAC = response[1],
+ NSAC = response[2],
+ Speed = response[3],
+ Classes = (ushort)((response[4] << 4) + ((response[5] & 0xF0) >> 4)),
+ ReadBlockLength = (byte)(response[5] & 0x0F),
+ ReadsPartialBlocks = (response[6] & 0x80) == 0x80,
+ WriteMisalignment = (response[6] & 0x40) == 0x40,
+ ReadMisalignment = (response[6] & 0x20) == 0x20,
+ DSRImplemented = (response[6] & 0x10) == 0x10,
+ EraseBlockEnable = (response[10] & 0x40) == 0x40,
+ EraseSectorSize = (byte)(((response[10] & 0x3F) << 1) + ((response[11] & 0x80) >> 7)),
+ WriteProtectGroupSize = (byte)(response[11] & 0x7F),
+ WriteProtectGroupEnable = (response[12] & 0x80) == 0x80,
+ WriteSpeedFactor = (byte)((response[12] & 0x1C) >> 2),
+ WriteBlockLength = (byte)(((response[12] & 0x03) << 2) + ((response[13] & 0xC0) >> 6)),
+ WritesPartialBlocks = (response[13] & 0x20) == 0x20,
+ FileFormatGroup = (response[14] & 0x80) == 0x80,
+ Copy = (response[14] & 0x40) == 0x40,
+ PermanentWriteProtect = (response[14] & 0x20) == 0x20,
+ TemporaryWriteProtect = (response[14] & 0x10) == 0x10,
+ FileFormat = (byte)((response[14] & 0x0C) >> 2),
+ CRC = (byte)((response[15] & 0xFE) >> 1)
+ };
- CSD csd = new CSD();
-
- csd.Structure = (byte)((response[0] & 0xC0) >> 6);
- csd.TAAC = response[1];
- csd.NSAC = response[2];
- csd.Speed = response[3];
- csd.Classes = (ushort)((response[4] << 4) + ((response[5] & 0xF0) >> 4));
- csd.ReadBlockLength = (byte)(response[5] & 0x0F);
- csd.ReadsPartialBlocks = (response[6] & 0x80) == 0x80;
- csd.WriteMisalignment = (response[6] & 0x40) == 0x40;
- csd.ReadMisalignment = (response[6] & 0x20) == 0x20;
- csd.DSRImplemented = (response[6] & 0x10) == 0x10;
if(csd.Structure == 0)
{
csd.Size = (ushort)(((response[6] & 0x03) << 10) + (response[7] << 2) + ((response[8] & 0xC0) >> 6));
@@ -119,19 +135,6 @@ namespace DiscImageChef.Decoders.SecureDigital
csd.SizeMultiplier = (byte)(((response[9] & 0x03) << 1) + ((response[10] & 0x80) >> 7));
}
else csd.Size = (uint)(((response[7] & 0x3F) << 16) + (response[8] << 8) + response[9]);
- csd.EraseBlockEnable = (response[10] & 0x40) == 0x40;
- csd.EraseSectorSize = (byte)(((response[10] & 0x3F) << 1) + ((response[11] & 0x80) >> 7));
- csd.WriteProtectGroupSize = (byte)(response[11] & 0x7F);
- csd.WriteProtectGroupEnable = (response[12] & 0x80) == 0x80;
- csd.WriteSpeedFactor = (byte)((response[12] & 0x1C) >> 2);
- csd.WriteBlockLength = (byte)(((response[12] & 0x03) << 2) + ((response[13] & 0xC0) >> 6));
- csd.WritesPartialBlocks = (response[13] & 0x20) == 0x20;
- csd.FileFormatGroup = (response[14] & 0x80) == 0x80;
- csd.Copy = (response[14] & 0x40) == 0x40;
- csd.PermanentWriteProtect = (response[14] & 0x20) == 0x20;
- csd.TemporaryWriteProtect = (response[14] & 0x10) == 0x10;
- csd.FileFormat = (byte)((response[14] & 0x0C) >> 2);
- csd.CRC = (byte)((response[15] & 0xFE) >> 1);
return csd;
}
diff --git a/SecureDigital/OCR.cs b/SecureDigital/OCR.cs
index c1f9fc086..2c387dfce 100644
--- a/SecureDigital/OCR.cs
+++ b/SecureDigital/OCR.cs
@@ -31,10 +31,16 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SecureDigital
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "UnassignedField.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public class OCR
{
public bool PowerUp;
@@ -53,37 +59,34 @@ namespace DiscImageChef.Decoders.SecureDigital
public bool LowPower;
}
- public partial class Decoders
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ public static partial class Decoders
{
public static OCR DecodeOCR(uint response)
{
- OCR ocr = new OCR();
-
- ocr.PowerUp = (response & 0x80000000) == 0x80000000;
- ocr.CCS = (response & 0x40000000) == 0x40000000;
- ocr.PowerUp = (response & 0x20000000) == 0x20000000;
- ocr.OneEight = (response & 0x01000000) == 0x01000000;
- ocr.ThreeFive = (response & 0x00800000) == 0x00800000;
- ocr.ThreeFour = (response & 0x00400000) == 0x00400000;
- ocr.ThreeThree = (response & 0x00200000) == 0x00200000;
- ocr.ThreeTwo = (response & 0x00100000) == 0x00100000;
- ocr.ThreeOne = (response & 0x00080000) == 0x00080000;
- ocr.ThreeZero = (response & 0x00040000) == 0x00040000;
- ocr.TwoNine = (response & 0x00020000) == 0x00020000;
- ocr.TwoEight = (response & 0x00010000) == 0x00010000;
- ocr.TwoSeven = (response & 0x00008000) == 0x00008000;
- ocr.LowPower = (response & 0x00000080) == 0x00000080;
-
- return ocr;
+ return new OCR
+ {
+ PowerUp = (response & 0x80000000) == 0x80000000,
+ CCS = (response & 0x40000000) == 0x40000000,
+ UHS = (response & 0x20000000) == 0x20000000,
+ OneEight = (response & 0x01000000) == 0x01000000,
+ ThreeFive = (response & 0x00800000) == 0x00800000,
+ ThreeFour = (response & 0x00400000) == 0x00400000,
+ ThreeThree = (response & 0x00200000) == 0x00200000,
+ ThreeTwo = (response & 0x00100000) == 0x00100000,
+ ThreeOne = (response & 0x00080000) == 0x00080000,
+ ThreeZero = (response & 0x00040000) == 0x00040000,
+ TwoNine = (response & 0x00020000) == 0x00020000,
+ TwoEight = (response & 0x00010000) == 0x00010000,
+ TwoSeven = (response & 0x00008000) == 0x00008000,
+ LowPower = (response & 0x00000080) == 0x00000080
+ };
}
public static OCR DecodeOCR(byte[] response)
{
- if(response == null) return null;
-
- if(response.Length != 4) return null;
-
- return DecodeOCR(BitConverter.ToUInt32(response, 0));
+ return response?.Length != 4 ? null : DecodeOCR(BitConverter.ToUInt32(response, 0));
}
public static string PrettifyOCR(OCR ocr)
diff --git a/SecureDigital/SCR.cs b/SecureDigital/SCR.cs
index 35f272413..5e9b38a3b 100644
--- a/SecureDigital/SCR.cs
+++ b/SecureDigital/SCR.cs
@@ -31,10 +31,15 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.SecureDigital
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public class SCR
{
public byte Structure;
@@ -50,18 +55,17 @@ namespace DiscImageChef.Decoders.SecureDigital
public byte[] ManufacturerReserved;
}
- public partial class Decoders
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ public static partial class Decoders
{
public static SCR DecodeSCR(uint[] response)
{
- if(response == null) return null;
-
- if(response.Length != 2) return null;
+ if(response?.Length != 2) return null;
byte[] data = new byte[8];
- byte[] tmp;
- tmp = BitConverter.GetBytes(response[0]);
+ byte[] tmp = BitConverter.GetBytes(response[0]);
Array.Copy(tmp, 0, data, 0, 4);
tmp = BitConverter.GetBytes(response[1]);
Array.Copy(tmp, 0, data, 4, 4);
@@ -71,22 +75,22 @@ namespace DiscImageChef.Decoders.SecureDigital
public static SCR DecodeSCR(byte[] response)
{
- if(response == null) return null;
+ if(response?.Length != 8) return null;
- if(response.Length != 8) return null;
-
- SCR scr = new SCR();
- scr.Structure = (byte)((response[0] & 0xF0) >> 4);
- scr.Spec = (byte)(response[0] & 0x0F);
- scr.DataStatusAfterErase = (response[1] & 0x80) == 0x80;
- scr.Security = (byte)((response[1] & 0x70) >> 4);
- scr.BusWidth = (byte)(response[1] & 0x0F);
- scr.Spec3 = (response[2] & 0x80) == 0x80;
- scr.ExtendedSecurity = (byte)((response[2] & 0x78) >> 3);
- scr.Spec4 = (response[2] & 0x04) == 0x04;
- scr.SpecX = (byte)(((response[2] & 0x03) << 2) + ((response[3] & 0xC0) >> 6));
- scr.CommandSupport = (byte)(response[3] & 0x0F);
- scr.ManufacturerReserved = new byte[4];
+ SCR scr = new SCR
+ {
+ Structure = (byte)((response[0] & 0xF0) >> 4),
+ Spec = (byte)(response[0] & 0x0F),
+ DataStatusAfterErase = (response[1] & 0x80) == 0x80,
+ Security = (byte)((response[1] & 0x70) >> 4),
+ BusWidth = (byte)(response[1] & 0x0F),
+ Spec3 = (response[2] & 0x80) == 0x80,
+ ExtendedSecurity = (byte)((response[2] & 0x78) >> 3),
+ Spec4 = (response[2] & 0x04) == 0x04,
+ SpecX = (byte)(((response[2] & 0x03) << 2) + ((response[3] & 0xC0) >> 6)),
+ CommandSupport = (byte)(response[3] & 0x0F),
+ ManufacturerReserved = new byte[4]
+ };
Array.Copy(response, 4, scr.ManufacturerReserved, 0, 4);
return scr;
diff --git a/SecureDigital/VendorString.cs b/SecureDigital/VendorString.cs
index 3938a5eb3..545e0f532 100644
--- a/SecureDigital/VendorString.cs
+++ b/SecureDigital/VendorString.cs
@@ -34,12 +34,12 @@ namespace DiscImageChef.Decoders.SecureDigital
{
public static class VendorString
{
- public static string Prettify(byte SDVendorID)
+ public static string Prettify(byte sdVendorId)
{
- switch(SDVendorID)
+ switch(sdVendorId)
{
case 0xAA: return "QEMU";
- default: return $"Unknown manufacturer ID 0x{SDVendorID:X2}";
+ default: return $"Unknown manufacturer ID 0x{sdVendorId:X2}";
}
}
}
diff --git a/Sega/CD.cs b/Sega/CD.cs
index 758914f44..fc6f75319 100644
--- a/Sega/CD.cs
+++ b/Sega/CD.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
@@ -38,6 +39,9 @@ using DiscImageChef.Console;
namespace DiscImageChef.Decoders.Sega
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class CD
{
// TODO: Check if it is big or little endian
@@ -114,10 +118,9 @@ namespace DiscImageChef.Decoders.Sega
if(ipbin_sector.Length < 512) return null;
- IPBin ipbin;
IntPtr ptr = Marshal.AllocHGlobal(512);
Marshal.Copy(ipbin_sector, 0, ptr, 512);
- ipbin = (IPBin)Marshal.PtrToStructure(ptr, typeof(IPBin));
+ IPBin ipbin = (IPBin)Marshal.PtrToStructure(ptr, typeof(IPBin));
Marshal.FreeHGlobal(ptr);
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.volume_name = \"{0}\"",
@@ -186,7 +189,8 @@ namespace DiscImageChef.Decoders.Sega
provider);
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
- catch { }
+ catch { // ignored
+ }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
}
diff --git a/Sega/Dreamcast.cs b/Sega/Dreamcast.cs
index 646d2c193..163faa44c 100644
--- a/Sega/Dreamcast.cs
+++ b/Sega/Dreamcast.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
@@ -38,6 +39,9 @@ using DiscImageChef.Console;
namespace DiscImageChef.Decoders.Sega
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Dreamcast
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
@@ -91,10 +95,9 @@ namespace DiscImageChef.Decoders.Sega
if(ipbin_sector.Length < 512) return null;
- IPBin ipbin;
IntPtr ptr = Marshal.AllocHGlobal(512);
Marshal.Copy(ipbin_sector, 0, ptr, 512);
- ipbin = (IPBin)Marshal.PtrToStructure(ptr, typeof(IPBin));
+ IPBin ipbin = (IPBin)Marshal.PtrToStructure(ptr, typeof(IPBin));
Marshal.FreeHGlobal(ptr);
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.maker_id = \"{0}\"",
diff --git a/Sega/Saturn.cs b/Sega/Saturn.cs
index 220ffd290..c7f24280d 100644
--- a/Sega/Saturn.cs
+++ b/Sega/Saturn.cs
@@ -31,6 +31,7 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
@@ -38,6 +39,9 @@ using DiscImageChef.Console;
namespace DiscImageChef.Decoders.Sega
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class Saturn
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
@@ -77,10 +81,9 @@ namespace DiscImageChef.Decoders.Sega
if(ipbin_sector.Length < 512) return null;
- IPBin ipbin;
IntPtr ptr = Marshal.AllocHGlobal(512);
Marshal.Copy(ipbin_sector, 0, ptr, 512);
- ipbin = (IPBin)Marshal.PtrToStructure(ptr, typeof(IPBin));
+ IPBin ipbin = (IPBin)Marshal.PtrToStructure(ptr, typeof(IPBin));
Marshal.FreeHGlobal(ptr);
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.maker_id = \"{0}\"",
diff --git a/Xbox/DMI.cs b/Xbox/DMI.cs
index a64dbb5c5..59121ed70 100644
--- a/Xbox/DMI.cs
+++ b/Xbox/DMI.cs
@@ -31,16 +31,20 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace DiscImageChef.Decoders.Xbox
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class DMI
{
public static bool IsXbox(byte[] dmi)
{
- if(dmi == null) return false;
- if(dmi.Length != 2052) return false;
+ if(dmi?.Length != 2052) return false;
// Version is 1
if(BitConverter.ToUInt32(dmi, 4) != 1) return false;
@@ -54,15 +58,12 @@ namespace DiscImageChef.Decoders.Xbox
long timestamp = BitConverter.ToInt64(dmi, 20);
// Game cannot exist before the Xbox
- if(timestamp < 0x1BD164833DFC000) return false;
-
- return true;
+ return timestamp >= 0x1BD164833DFC000;
}
public static bool IsXbox360(byte[] dmi)
{
- if(dmi == null) return false;
- if(dmi.Length != 2052) return false;
+ if(dmi?.Length != 2052) return false;
uint signature = BitConverter.ToUInt32(dmi, 0x7EC);
@@ -155,14 +156,15 @@ namespace DiscImageChef.Decoders.Xbox
bool isXbox = IsXbox(response);
if(!isXbox) return null;
- XboxDMI dmi = new XboxDMI();
+ XboxDMI dmi = new XboxDMI
+ {
+ DataLength = (ushort)((response[0] << 8) + response[1]),
+ Reserved1 = response[2],
+ Reserved2 = response[3],
+ Version = BitConverter.ToUInt32(response, 4),
+ Timestamp = BitConverter.ToInt64(response, 20)
+ };
- dmi.DataLength = (ushort)((response[0] << 8) + response[1]);
- dmi.Reserved1 = response[2];
- dmi.Reserved2 = response[3];
-
- dmi.Version = BitConverter.ToUInt32(response, 4);
- dmi.Timestamp = BitConverter.ToInt64(response, 20);
byte[] tmp = new byte[8];
Array.Copy(response, 12, tmp, 0, 8);
dmi.CatalogNumber = StringHandlers.CToString(tmp);
@@ -175,23 +177,22 @@ namespace DiscImageChef.Decoders.Xbox
bool isX360 = IsXbox360(response);
if(!isX360) return null;
- Xbox360DMI dmi = new Xbox360DMI();
+ Xbox360DMI dmi = new Xbox360DMI
+ {
+ DataLength = (ushort)((response[0] << 8) + response[1]),
+ Reserved1 = response[2],
+ Reserved2 = response[3],
+ Version = BitConverter.ToUInt32(response, 4),
+ Timestamp = BitConverter.ToInt64(response, 20),
+ MediaID = new byte[16]
+ };
- dmi.DataLength = (ushort)((response[0] << 8) + response[1]);
- dmi.Reserved1 = response[2];
- dmi.Reserved2 = response[3];
-
- dmi.Version = BitConverter.ToUInt32(response, 4);
- dmi.Timestamp = BitConverter.ToInt64(response, 20);
- dmi.MediaID = new byte[16];
Array.Copy(response, 36, dmi.MediaID, 0, 16);
byte[] tmp = new byte[16];
Array.Copy(response, 68, tmp, 0, 16);
dmi.CatalogNumber = StringHandlers.CToString(tmp);
- if(dmi.CatalogNumber == null || dmi.CatalogNumber.Length < 13) return null;
-
- return dmi;
+ return dmi.CatalogNumber == null || dmi.CatalogNumber.Length < 13 ? (Xbox360DMI?)null : dmi;
}
public static string PrettifyXbox(XboxDMI? dmi)
diff --git a/Xbox/SS.cs b/Xbox/SS.cs
index 62393399d..c66a38af7 100644
--- a/Xbox/SS.cs
+++ b/Xbox/SS.cs
@@ -31,11 +31,16 @@
// ****************************************************************************/
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using DiscImageChef.Decoders.DVD;
namespace DiscImageChef.Decoders.Xbox
{
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("ReSharper", "MemberCanBeInternal")]
+ [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
+ [SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class SS
{
public struct SecuritySector
@@ -221,82 +226,92 @@ namespace DiscImageChef.Decoders.Xbox
if(response.Length < 2048) return null;
- SecuritySector ss = new SecuritySector();
+ SecuritySector ss = new SecuritySector
+ {
+ DiskCategory = (DiskCategory)((response[0] & 0xF0) >> 4),
+ PartVersion = (byte)(response[0] & 0x0F),
+ DiscSize = (DVDSize)((response[1] & 0xF0) >> 4),
+ MaximumRate = (MaximumRateField)(response[1] & 0x0F),
+ Reserved3 = (response[2] & 0x80) == 0x80,
+ Layers = (byte)((response[2] & 0x60) >> 5),
+ TrackPath = (response[2] & 0x08) == 0x08,
+ LayerType = (LayerTypeFieldMask)(response[2] & 0x07),
+ LinearDensity = (LinearDensityField)((response[3] & 0xF0) >> 4),
+ TrackDensity = (TrackDensityField)(response[3] & 0x0F),
+ DataAreaStartPSN = (uint)((response[4] << 24) + (response[5] << 16) + (response[6] << 8) + response[7]),
+ DataAreaEndPSN = (uint)((response[8] << 24) + (response[9] << 16) + (response[10] << 8) + response[11]),
+ Layer0EndPSN = (uint)((response[12] << 24) + (response[13] << 16) + (response[14] << 8) + response[15]),
+ Unknown1 = response[27],
+ Unknown2 = new byte[28],
+ Unknown3 = new byte[436],
+ Unknown4 = new byte[4],
+ Unknown5 = new byte[43],
+ ChallengeTableVersion = response[768],
+ NoChallengeEntries = response[769],
+ ChallengeEntries = new ChallengeEntry[23],
+ Unknown6 = response[1023],
+ Unknown7 = new byte[48],
+ Unknown8 = new byte[16],
+ Unknown9 = new byte[16],
+ Unknown10 = new byte[303],
+ Unknown11 = new byte[104],
+ Extents = new SecuritySectorExtent[23],
+ ExtentsCopy = new SecuritySectorExtent[23]
+ };
- // Common
- ss.DiskCategory = (DiskCategory)((response[0] & 0xF0) >> 4);
- ss.PartVersion = (byte)(response[0] & 0x0F);
- ss.DiscSize = (DVDSize)((response[1] & 0xF0) >> 4);
- ss.MaximumRate = (MaximumRateField)(response[1] & 0x0F);
- ss.Reserved3 |= (response[2] & 0x80) == 0x80;
- ss.Layers = (byte)((response[2] & 0x60) >> 5);
- ss.TrackPath |= (response[2] & 0x08) == 0x08;
- ss.LayerType = (LayerTypeFieldMask)(response[2] & 0x07);
- ss.LinearDensity = (LinearDensityField)((response[3] & 0xF0) >> 4);
- ss.TrackDensity = (TrackDensityField)(response[3] & 0x0F);
- ss.DataAreaStartPSN = (uint)((response[4] << 24) + (response[5] << 16) + (response[6] << 8) + response[7]);
- ss.DataAreaEndPSN = (uint)((response[8] << 24) + (response[9] << 16) + (response[10] << 8) + response[11]);
- ss.Layer0EndPSN = (uint)((response[12] << 24) + (response[13] << 16) + (response[14] << 8) + response[15]);
-
- ss.Unknown1 = response[27];
- ss.Unknown2 = new byte[28];
Array.Copy(response, 256, ss.Unknown2, 0, 28);
- ss.Unknown3 = new byte[436];
Array.Copy(response, 284, ss.Unknown3, 0, 436);
- ss.Unknown4 = new byte[4];
Array.Copy(response, 720, ss.Unknown4, 0, 4);
- ss.Unknown5 = new byte[43];
Array.Copy(response, 724, ss.Unknown5, 0, 43);
- ss.ChallengeTableVersion = response[768];
- ss.NoChallengeEntries = response[769];
- ss.ChallengeEntries = new ChallengeEntry[23];
+
for(int i = 0; i < 23; i++)
{
- ss.ChallengeEntries[i] = new ChallengeEntry();
- ss.ChallengeEntries[i].Level = response[770 + i * 11 + 0];
- ss.ChallengeEntries[i].ChallengeId = response[770 + i * 11 + 1];
- ss.ChallengeEntries[i].ChallengeValue =
- (uint)((response[770 + i * 11 + 2] << 24) + (response[770 + i * 11 + 3] << 16) +
- (response[770 + i * 11 + 4] << 8) + response[770 + i * 11 + 5]);
- ss.ChallengeEntries[i].ResponseModifier = response[770 + i * 11 + 6];
- ss.ChallengeEntries[i].ResponseValue =
- (uint)((response[770 + i * 11 + 7] << 24) + (response[770 + i * 11 + 8] << 16) +
- (response[770 + i * 11 + 9] << 8) + response[770 + i * 11 + 10]);
+ ss.ChallengeEntries[i] = new ChallengeEntry
+ {
+ Level = response[770 + i * 11 + 0],
+ ChallengeId = response[770 + i * 11 + 1],
+ ChallengeValue =
+ (uint)((response[770 + i * 11 + 2] << 24) + (response[770 + i * 11 + 3] << 16) +
+ (response[770 + i * 11 + 4] << 8) + response[770 + i * 11 + 5]),
+ ResponseModifier = response[770 + i * 11 + 6],
+ ResponseValue = (uint)((response[770 + i * 11 + 7] << 24) + (response[770 + i * 11 + 8] << 16) +
+ (response[770 + i * 11 + 9] << 8) + response[770 + i * 11 + 10])
+ };
}
- ss.Unknown6 = response[1023];
- ss.Unknown7 = new byte[48];
Array.Copy(response, 1052, ss.Unknown7, 0, 48);
- ss.Unknown8 = new byte[16];
Array.Copy(response, 1120, ss.Unknown8, 0, 16);
- ss.Unknown9 = new byte[16];
Array.Copy(response, 1180, ss.Unknown9, 0, 16);
- ss.Unknown10 = new byte[303];
Array.Copy(response, 1208, ss.Unknown10, 0, 303);
- ss.Unknown11 = new byte[104];
Array.Copy(response, 1528, ss.Unknown11, 0, 104);
- ss.Extents = new SecuritySectorExtent[23];
for(int i = 0; i < 23; i++)
{
- ss.Extents[i] = new SecuritySectorExtent();
- ss.Extents[i].Unknown = (uint)((response[1633 + i * 9 + 0] << 16) + (response[1633 + i * 9 + 1] << 8) +
- response[1633 + i * 9 + 2]);
- ss.Extents[i].StartPSN = (uint)((response[1633 + i * 9 + 3] << 16) + (response[1633 + i * 9 + 4] << 8) +
- response[1633 + i * 9 + 5]);
- ss.Extents[i].EndPSN = (uint)((response[1633 + i * 9 + 6] << 16) + (response[1633 + i * 9 + 7] << 8) +
- response[1633 + i * 9 + 8]);
+ ss.Extents[i] = new SecuritySectorExtent
+ {
+ Unknown =
+ (uint)((response[1633 + i * 9 + 0] << 16) + (response[1633 + i * 9 + 1] << 8) +
+ response[1633 + i * 9 + 2]),
+ StartPSN =
+ (uint)((response[1633 + i * 9 + 3] << 16) + (response[1633 + i * 9 + 4] << 8) +
+ response[1633 + i * 9 + 5]),
+ EndPSN = (uint)((response[1633 + i * 9 + 6] << 16) + (response[1633 + i * 9 + 7] << 8) +
+ response[1633 + i * 9 + 8])
+ };
}
- ss.ExtentsCopy = new SecuritySectorExtent[23];
for(int i = 0; i < 23; i++)
{
- ss.ExtentsCopy[i] = new SecuritySectorExtent();
- ss.ExtentsCopy[i].Unknown = (uint)((response[1840 + i * 9 + 0] << 16) +
- (response[1840 + i * 9 + 1] << 8) + response[1840 + i * 9 + 2]);
- ss.ExtentsCopy[i].StartPSN = (uint)((response[1840 + i * 9 + 3] << 16) +
- (response[1840 + i * 9 + 4] << 8) + response[1840 + i * 9 + 5]);
- ss.ExtentsCopy[i].EndPSN = (uint)((response[1840 + i * 9 + 6] << 16) +
- (response[1840 + i * 9 + 7] << 8) + response[1840 + i * 9 + 8]);
+ ss.ExtentsCopy[i] = new SecuritySectorExtent
+ {
+ Unknown =
+ (uint)((response[1840 + i * 9 + 0] << 16) + (response[1840 + i * 9 + 1] << 8) +
+ response[1840 + i * 9 + 2]),
+ StartPSN =
+ (uint)((response[1840 + i * 9 + 3] << 16) + (response[1840 + i * 9 + 4] << 8) +
+ response[1840 + i * 9 + 5]),
+ EndPSN = (uint)((response[1840 + i * 9 + 6] << 16) + (response[1840 + i * 9 + 7] << 8) +
+ response[1840 + i * 9 + 8])
+ };
}
return ss;
@@ -323,7 +338,7 @@ namespace DiscImageChef.Decoders.Xbox
break;
}
- string categorySentence = "Disc is a {0} {1} version {2}";
+ const string categorySentence = "Disc is a {0} {1} version {2}";
switch(decoded.DiskCategory)
{