mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Refactor and code cleanup.
This commit is contained in:
@@ -396,9 +396,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(!sense.HasValue)
|
||||
return null;
|
||||
|
||||
return sense.Value.AddressValid ? String.Format("Error class {0} type {1} happened on block {2}\n",
|
||||
return sense.Value.AddressValid ? string.Format("Error class {0} type {1} happened on block {2}\n",
|
||||
sense.Value.ErrorClass, sense.Value.ErrorType, sense.Value.LBA) :
|
||||
String.Format("Error class {0} type {1}\n", sense.Value.ErrorClass,
|
||||
string.Format("Error class {0} type {1}\n", sense.Value.ErrorClass,
|
||||
sense.Value.ErrorType);
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
/// </summary>
|
||||
/// <returns>The information value</returns>
|
||||
/// <param name="descriptor">Descriptor.</param>
|
||||
public static UInt64 DecodeDescriptor00(byte[] descriptor)
|
||||
public static ulong DecodeDescriptor00(byte[] descriptor)
|
||||
{
|
||||
if(descriptor.Length != 12 || descriptor[0] != 0x00)
|
||||
return 0;
|
||||
@@ -523,7 +523,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
/// </summary>
|
||||
/// <returns>The command-specific information sense data descriptor.</returns>
|
||||
/// <param name="descriptor">Descriptor.</param>
|
||||
public static UInt64 DecodeDescriptor01(byte[] descriptor)
|
||||
public static ulong DecodeDescriptor01(byte[] descriptor)
|
||||
{
|
||||
if(descriptor.Length != 12 || descriptor[0] != 0x01)
|
||||
return 0;
|
||||
@@ -640,9 +640,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
throw new NotImplementedException("Check SBC-3");
|
||||
}
|
||||
|
||||
public static string PrettifyDescriptor00(UInt64 information)
|
||||
public static string PrettifyDescriptor00(ulong information)
|
||||
{
|
||||
return String.Format("On logical block {0}\n", information);
|
||||
return string.Format("On logical block {0}\n", information);
|
||||
}
|
||||
|
||||
public static string PrettifyDescriptor00(byte[] descriptor)
|
||||
@@ -1884,7 +1884,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
case 0x00:
|
||||
return "RAM FAILURE";
|
||||
default:
|
||||
return String.Format("DIAGNOSTIC FAILURE ON COMPONENT {0:X2}h", ASCQ);
|
||||
return string.Format("DIAGNOSTIC FAILURE ON COMPONENT {0:X2}h", ASCQ);
|
||||
}
|
||||
case 0x41:
|
||||
switch(ASCQ)
|
||||
@@ -2031,7 +2031,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
break;
|
||||
case 0x4E:
|
||||
return String.Format("OVERLAPPED COMMANDS ATTEMPTED FOR TASK TAG {0:X2}h", ASCQ);
|
||||
return string.Format("OVERLAPPED COMMANDS ATTEMPTED FOR TASK TAG {0:X2}h", ASCQ);
|
||||
case 0x50:
|
||||
switch(ASCQ)
|
||||
{
|
||||
@@ -2566,7 +2566,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
break;
|
||||
case 0x70:
|
||||
return String.Format("DECOMPRESSION EXCEPTION SHORT ALGORITHM ID OF {0:X2}h", ASCQ);
|
||||
return string.Format("DECOMPRESSION EXCEPTION SHORT ALGORITHM ID OF {0:X2}h", ASCQ);
|
||||
case 0x71:
|
||||
switch(ASCQ)
|
||||
{
|
||||
@@ -2684,10 +2684,10 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
|
||||
return ASC >= 0x80 ? ASCQ >= 0x80 ?
|
||||
String.Format("VENDOR-SPECIFIC ASC {0:X2}h WITH VENDOR-SPECIFIC ASCQ {1:X2}h", ASC, ASCQ) :
|
||||
String.Format("VENDOR-SPECIFIC ASC {0:X2}h WITH ASCQ {1:X2}h", ASC, ASCQ) :
|
||||
ASCQ >= 0x80 ? String.Format("ASC {0:X2}h WITH VENDOR-SPECIFIC ASCQ {1:X2}h", ASC, ASCQ) :
|
||||
String.Format("ASC {0:X2}h WITH ASCQ {1:X2}h", ASC, ASCQ);
|
||||
string.Format("VENDOR-SPECIFIC ASC {0:X2}h WITH VENDOR-SPECIFIC ASCQ {1:X2}h", ASC, ASCQ) :
|
||||
string.Format("VENDOR-SPECIFIC ASC {0:X2}h WITH ASCQ {1:X2}h", ASC, ASCQ) :
|
||||
ASCQ >= 0x80 ? string.Format("ASC {0:X2}h WITH VENDOR-SPECIFIC ASCQ {1:X2}h", ASC, ASCQ) :
|
||||
string.Format("ASC {0:X2}h WITH ASCQ {1:X2}h", ASC, ASCQ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user