diff --git a/ATA/Identify.cs b/ATA/Identify.cs index a3cbb3a39..ae9a194e0 100644 --- a/ATA/Identify.cs +++ b/ATA/Identify.cs @@ -1885,21 +1885,12 @@ namespace DiscImageChef.Decoders.ATA IdentifyDevice ATAID = IdentifyDeviceResponse.Value; if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.NonMagnetic)) if((ushort)ATAID.GeneralConfiguration != 0x848A) - { - //if (ATAID.CommandSet.HasFlag(CommandSetBit.Packet)) - //{ atapi = true; - cfa = false; - //} - } else - { - atapi = false; cfa = true; - } - if(atapi && !cfa) sb.AppendLine("ATAPI device"); - else if(!atapi && cfa) sb.AppendLine("CompactFlash device"); + if(atapi) sb.AppendLine("ATAPI device"); + else if(cfa) sb.AppendLine("CompactFlash device"); else sb.AppendLine("ATA device"); if(ATAID.Model != "") sb.AppendFormat("Model: {0}", ATAID.Model).AppendLine(); diff --git a/CD/ATIP.cs b/CD/ATIP.cs index 2867657ea..8356842c5 100644 --- a/CD/ATIP.cs +++ b/CD/ATIP.cs @@ -428,7 +428,7 @@ namespace DiscImageChef.Decoders.CD int type = response.LeadInStartFrame % 10; int frm = response.LeadInStartFrame - type; - string manufacturer = ""; + string manufacturer; if(response.DiscType) sb.AppendLine("Disc uses phase change"); else diff --git a/Floppy/Apple2.cs b/Floppy/Apple2.cs index 0d1cb2459..c45af811f 100644 --- a/Floppy/Apple2.cs +++ b/Floppy/Apple2.cs @@ -612,7 +612,7 @@ namespace DiscImageChef.Decoders.Floppy public static bool IsApple2GCR(byte[] data) { - int position = 0; + int position; RawSector sector = MarshalSector(data, out position, 0); return sector != null && position != 0; diff --git a/Floppy/AppleSony.cs b/Floppy/AppleSony.cs index 6302872bb..98b1c2f71 100644 --- a/Floppy/AppleSony.cs +++ b/Floppy/AppleSony.cs @@ -495,7 +495,7 @@ namespace DiscImageChef.Decoders.Floppy public static bool IsAppleSonyGCR(byte[] data) { - int position = 0; + int position; RawSector sector = MarshalSector(data, out position, 0); return sector != null && position != 0; diff --git a/LisaTag.cs b/LisaTag.cs index d6463528f..ce7638b7b 100644 --- a/LisaTag.cs +++ b/LisaTag.cs @@ -293,7 +293,7 @@ namespace DiscImageChef.Decoders { if(tag == null) return null; - PriamTag pmTag = new PriamTag(); + PriamTag pmTag; switch(tag.Length) { diff --git a/MMC/CID.cs b/MMC/CID.cs index 76cbfb78a..34e3cca93 100644 --- a/MMC/CID.cs +++ b/MMC/CID.cs @@ -56,7 +56,7 @@ namespace DiscImageChef.Decoders.MMC if(response.Length != 4) return null; byte[] data = new byte[16]; - byte[] tmp = new byte[4]; + byte[] tmp; tmp = BitConverter.GetBytes(response[0]); Array.Copy(tmp, 0, data, 0, 4); @@ -85,7 +85,6 @@ namespace DiscImageChef.Decoders.MMC Array.Copy(response, 3, tmp, 0, 6); cid.ProductName = StringHandlers.CToString(tmp); cid.ProductRevision = response[9]; - tmp = new byte[4]; cid.ProductSerialNumber = BitConverter.ToUInt32(response, 10); cid.ManufacturingDate = response[14]; cid.CRC = (byte)((response[15] & 0xFE) >> 1); diff --git a/MMC/CSD.cs b/MMC/CSD.cs index 8418f3fa7..74cf3a844 100644 --- a/MMC/CSD.cs +++ b/MMC/CSD.cs @@ -81,7 +81,7 @@ namespace DiscImageChef.Decoders.MMC if(response.Length != 4) return null; byte[] data = new byte[16]; - byte[] tmp = new byte[4]; + byte[] tmp; tmp = BitConverter.GetBytes(response[0]); Array.Copy(tmp, 0, data, 0, 4); @@ -146,7 +146,7 @@ namespace DiscImageChef.Decoders.MMC double unitFactor = 0; double multiplier = 0; - double result = 0; + double result; string unit = ""; StringBuilder sb = new StringBuilder(); @@ -483,6 +483,7 @@ namespace DiscImageChef.Decoders.MMC if(csd.WriteProtectGroupEnable) { sb.AppendLine("\tDevice can write protect regions"); + // TODO: Check specification unitFactor = Convert.ToDouble(csd.WriteProtectGroupSize); sb.AppendFormat("\tDevice can write protect a minimum of {0} blocks at a time", (int)(result + 1)) .AppendLine(); diff --git a/MMC/ExtendedCSD.cs b/MMC/ExtendedCSD.cs index 991d72efa..cd517d46e 100644 --- a/MMC/ExtendedCSD.cs +++ b/MMC/ExtendedCSD.cs @@ -205,7 +205,7 @@ namespace DiscImageChef.Decoders.MMC if(response.Length != 512) return null; - ExtendedCSD csd = new ExtendedCSD(); + ExtendedCSD csd; GCHandle handle = GCHandle.Alloc(response, GCHandleType.Pinned); csd = (ExtendedCSD)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(ExtendedCSD)); handle.Free(); diff --git a/PCMCIA/CIS.cs b/PCMCIA/CIS.cs index 8b74c68c0..7c533fa22 100644 --- a/PCMCIA/CIS.cs +++ b/PCMCIA/CIS.cs @@ -237,6 +237,7 @@ namespace DiscImageChef.Decoders.PCMCIA continue; } + // TODO: Check this if(!secondString) { tuple.Product = StringHandlers.CToString(buffer.ToArray()); diff --git a/SCSI/EVPD.cs b/SCSI/EVPD.cs index b6d9bdebd..7035f8ede 100644 --- a/SCSI/EVPD.cs +++ b/SCSI/EVPD.cs @@ -467,7 +467,7 @@ namespace DiscImageChef.Decoders.SCSI if(descriptor.PIV) { - string protocol = ""; + string protocol; switch(descriptor.ProtocolIdentifier) { case ProtocolIdentifiers.ADT: diff --git a/SCSI/Modes/11.cs b/SCSI/Modes/11.cs index f4ad40027..41755f993 100644 --- a/SCSI/Modes/11.cs +++ b/SCSI/Modes/11.cs @@ -197,7 +197,7 @@ namespace DiscImageChef.Decoders.SCSI else if(page.CLEAR && page.ADDP) sb.AppendLine("\tDevice shall erase all partitions differing on size on MODE SELECT for partitioning"); - string measure = ""; + string measure; switch(page.PSUM) { diff --git a/SCSI/Modes/Headers.cs b/SCSI/Modes/Headers.cs index b6a8b21c4..f81bc4861 100644 --- a/SCSI/Modes/Headers.cs +++ b/SCSI/Modes/Headers.cs @@ -181,7 +181,7 @@ namespace DiscImageChef.Decoders.SCSI if(header.Value.WriteProtected) sb.AppendLine("\tMedium is write protected"); - string medium = ""; + string medium; switch(header.Value.MediumType) { diff --git a/SecureDigital/CID.cs b/SecureDigital/CID.cs index e0b4ee06c..d00ba5ea4 100644 --- a/SecureDigital/CID.cs +++ b/SecureDigital/CID.cs @@ -55,7 +55,7 @@ namespace DiscImageChef.Decoders.SecureDigital if(response.Length != 4) return null; byte[] data = new byte[16]; - byte[] tmp = new byte[4]; + byte[] tmp; tmp = BitConverter.GetBytes(response[0]); Array.Copy(tmp, 0, data, 0, 4); diff --git a/SecureDigital/CSD.cs b/SecureDigital/CSD.cs index 7feaadc5d..ba404a54f 100644 --- a/SecureDigital/CSD.cs +++ b/SecureDigital/CSD.cs @@ -77,7 +77,7 @@ namespace DiscImageChef.Decoders.SecureDigital if(response.Length != 4) return null; byte[] data = new byte[16]; - byte[] tmp = new byte[4]; + byte[] tmp; tmp = BitConverter.GetBytes(response[0]); Array.Copy(tmp, 0, data, 0, 4); @@ -142,7 +142,7 @@ namespace DiscImageChef.Decoders.SecureDigital double unitFactor = 0; double multiplier = 0; - double result = 0; + double result; string unit = ""; StringBuilder sb = new StringBuilder(); diff --git a/SecureDigital/SCR.cs b/SecureDigital/SCR.cs index 74bc5a12f..35f272413 100644 --- a/SecureDigital/SCR.cs +++ b/SecureDigital/SCR.cs @@ -59,7 +59,7 @@ namespace DiscImageChef.Decoders.SecureDigital if(response.Length != 2) return null; byte[] data = new byte[8]; - byte[] tmp = new byte[4]; + byte[] tmp; tmp = BitConverter.GetBytes(response[0]); Array.Copy(tmp, 0, data, 0, 4); diff --git a/Sega/CD.cs b/Sega/CD.cs index f51cebab2..758914f44 100644 --- a/Sega/CD.cs +++ b/Sega/CD.cs @@ -114,7 +114,7 @@ namespace DiscImageChef.Decoders.Sega if(ipbin_sector.Length < 512) return null; - IPBin ipbin = new IPBin(); + IPBin ipbin; IntPtr ptr = Marshal.AllocHGlobal(512); Marshal.Copy(ipbin_sector, 0, ptr, 512); ipbin = (IPBin)Marshal.PtrToStructure(ptr, typeof(IPBin)); diff --git a/Sega/Dreamcast.cs b/Sega/Dreamcast.cs index 55186d015..646d2c193 100644 --- a/Sega/Dreamcast.cs +++ b/Sega/Dreamcast.cs @@ -91,7 +91,7 @@ namespace DiscImageChef.Decoders.Sega if(ipbin_sector.Length < 512) return null; - IPBin ipbin = new IPBin(); + IPBin ipbin; IntPtr ptr = Marshal.AllocHGlobal(512); Marshal.Copy(ipbin_sector, 0, ptr, 512); ipbin = (IPBin)Marshal.PtrToStructure(ptr, typeof(IPBin)); diff --git a/Sega/Saturn.cs b/Sega/Saturn.cs index a334efac2..220ffd290 100644 --- a/Sega/Saturn.cs +++ b/Sega/Saturn.cs @@ -77,7 +77,7 @@ namespace DiscImageChef.Decoders.Sega if(ipbin_sector.Length < 512) return null; - IPBin ipbin = new IPBin(); + IPBin ipbin; IntPtr ptr = Marshal.AllocHGlobal(512); Marshal.Copy(ipbin_sector, 0, ptr, 512); ipbin = (IPBin)Marshal.PtrToStructure(ptr, typeof(IPBin));