diff --git a/Floppy/AppleSony.cs b/Floppy/AppleSony.cs index 2fc370c5d..a463a306f 100644 --- a/Floppy/AppleSony.cs +++ b/Floppy/AppleSony.cs @@ -153,8 +153,6 @@ namespace DiscImageChef.Decoders.Floppy if(sector.addressField.prologue[0] != 0xD5 || sector.addressField.prologue[1] != 0xAA || sector.addressField.prologue[2] != 0x96) return null; - uint ck1, ck2, ck3; - byte w3; byte[] bf1 = new byte[175]; byte[] bf2 = new byte[175]; byte[] bf3 = new byte[175]; @@ -162,7 +160,7 @@ namespace DiscImageChef.Decoders.Floppy MemoryStream ms = new MemoryStream(); int j = 0; - w3 = 0; + byte w3 = 0; for(int i = 0; i <= 174; i++) { byte w4 = nib_data[j++]; @@ -177,9 +175,9 @@ namespace DiscImageChef.Decoders.Floppy } j = 0; - ck1 = 0; - ck2 = 0; - ck3 = 0; + uint ck1 = 0; + uint ck2 = 0; + uint ck3 = 0; while(true) { ck1 = (ck1 & 0xFF) << 1; diff --git a/MMC/CSD.cs b/MMC/CSD.cs index d9a5a997b..dffe3928d 100644 --- a/MMC/CSD.cs +++ b/MMC/CSD.cs @@ -148,7 +148,6 @@ namespace DiscImageChef.Decoders.MMC double unitFactor = 0; double multiplier = 0; - double result; string unit = ""; StringBuilder sb = new StringBuilder(); @@ -257,7 +256,7 @@ namespace DiscImageChef.Decoders.MMC break; } - result = unitFactor * multiplier; + double result = unitFactor * multiplier; sb.AppendFormat("\tAsynchronous data access time is {0}{1}", result, unit).AppendLine(); sb.AppendFormat("\tClock dependent part of data access is {0} clock cycles", csd.NSAC * 100).AppendLine(); diff --git a/MMC/ExtendedCSD.cs b/MMC/ExtendedCSD.cs index 02f7a39a1..260c81e77 100644 --- a/MMC/ExtendedCSD.cs +++ b/MMC/ExtendedCSD.cs @@ -213,9 +213,8 @@ namespace DiscImageChef.Decoders.MMC if(response.Length != 512) return null; - ExtendedCSD csd; GCHandle handle = GCHandle.Alloc(response, GCHandleType.Pinned); - csd = (ExtendedCSD)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(ExtendedCSD)); + ExtendedCSD csd = (ExtendedCSD)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(ExtendedCSD)); handle.Free(); return csd; @@ -231,8 +230,9 @@ namespace DiscImageChef.Decoders.MMC double unit; if((csd.HPIFeatures & 0x01) == 0x01) - if((csd.HPIFeatures & 0x02) == 0x02) sb.AppendLine("\tDevice implements HPI using CMD12"); - else sb.AppendLine("\tDevice implements HPI using CMD13"); + sb.AppendLine((csd.HPIFeatures & 0x02) == 0x02 + ? "\tDevice implements HPI using CMD12" + : "\tDevice implements HPI using CMD13"); if((csd.BackgroundOperationsSupport & 0x01) == 0x01) sb.AppendLine("\tDevice supports background operations"); @@ -574,9 +574,9 @@ namespace DiscImageChef.Decoders.MMC if((csd.StrobeSupport & 0x01) == 0x01) { sb.AppendLine("\tDevice supports enhanced strobe mode"); - if((csd.BusWidth & 0x80) == 0x80) - sb.AppendLine("\tDevice uses strobe during Data Out, CRC and CMD responses"); - else sb.AppendLine("\tDevice uses strobe during Data Out and CRC responses"); + sb.AppendLine((csd.BusWidth & 0x80) == 0x80 + ? "\tDevice uses strobe during Data Out, CRC and CMD responses" + : "\tDevice uses strobe during Data Out and CRC responses"); } switch(csd.BusWidth & 0x0F) diff --git a/SCSI/Modes/03.cs b/SCSI/Modes/03.cs index 3e1636a78..f6e0549a3 100644 --- a/SCSI/Modes/03.cs +++ b/SCSI/Modes/03.cs @@ -172,10 +172,9 @@ namespace DiscImageChef.Decoders.SCSI if(page.SSEC) sb.AppendLine("\tDrive supports soft-sectoring format"); if(page.HSEC) sb.AppendLine("\tDrive supports hard-sectoring format"); if(page.RMB) sb.AppendLine("\tDrive media is removable"); - if(page.SURF) - sb.AppendLine("\tSector addressing is progressively incremented in one surface before going to the next"); - else - sb.AppendLine("\tSector addressing is progressively incremented in one cylinder before going to the next"); + sb.AppendLine(page.SURF + ? "\tSector addressing is progressively incremented in one surface before going to the next" + : "\tSector addressing is progressively incremented in one cylinder before going to the next"); return sb.ToString(); } diff --git a/SCSI/Modes/Mode10.cs b/SCSI/Modes/Mode10.cs index 8538dc83a..59641ddb9 100644 --- a/SCSI/Modes/Mode10.cs +++ b/SCSI/Modes/Mode10.cs @@ -46,11 +46,8 @@ namespace DiscImageChef.Decoders.SCSI { if(modeResponse == null || modeResponse.Length < 8) return null; - ushort modeLength; - ushort blockDescLength; - - modeLength = (ushort)((modeResponse[0] << 8) + modeResponse[1]); - blockDescLength = (ushort)((modeResponse[6] << 8) + modeResponse[7]); + ushort modeLength = (ushort)((modeResponse[0] << 8) + modeResponse[1]); + ushort blockDescLength = (ushort)((modeResponse[6] << 8) + modeResponse[7]); if(modeResponse.Length < modeLength) return null; diff --git a/SecureDigital/CSD.cs b/SecureDigital/CSD.cs index e4f9e0041..2f76c0e39 100644 --- a/SecureDigital/CSD.cs +++ b/SecureDigital/CSD.cs @@ -145,7 +145,6 @@ namespace DiscImageChef.Decoders.SecureDigital double unitFactor = 0; double multiplier = 0; - double result; string unit = ""; StringBuilder sb = new StringBuilder(); @@ -248,7 +247,7 @@ namespace DiscImageChef.Decoders.SecureDigital break; } - result = unitFactor * multiplier; + double result = unitFactor * multiplier; sb.AppendFormat("\tAsynchronous data access time is {0}{1}", result, unit).AppendLine(); sb.AppendFormat("\tClock dependent part of data access is {0} clock cycles", csd.NSAC * 100).AppendLine();