General code refactor and reformat.

This commit is contained in:
2018-12-31 13:17:27 +00:00
parent 06a27f18b0
commit e2bbb9994f
72 changed files with 433 additions and 897 deletions

View File

@@ -116,14 +116,8 @@ namespace DiscImageChef.Decoders.SecureDigital
return sb.ToString();
}
public static string PrettifyCID(uint[] response)
{
return PrettifyCID(DecodeCID(response));
}
public static string PrettifyCID(uint[] response) => PrettifyCID(DecodeCID(response));
public static string PrettifyCID(byte[] response)
{
return PrettifyCID(DecodeCID(response));
}
public static string PrettifyCID(byte[] response) => PrettifyCID(DecodeCID(response));
}
}

View File

@@ -538,14 +538,8 @@ namespace DiscImageChef.Decoders.SecureDigital
return sb.ToString();
}
public static string PrettifyCSD(uint[] response)
{
return PrettifyCSD(DecodeCSD(response));
}
public static string PrettifyCSD(uint[] response) => PrettifyCSD(DecodeCSD(response));
public static string PrettifyCSD(byte[] response)
{
return PrettifyCSD(DecodeCSD(response));
}
public static string PrettifyCSD(byte[] response) => PrettifyCSD(DecodeCSD(response));
}
}

View File

@@ -63,9 +63,8 @@ namespace DiscImageChef.Decoders.SecureDigital
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Decoders
{
public static OCR DecodeOCR(uint response)
{
return new OCR
public static OCR DecodeOCR(uint response) =>
new OCR
{
PowerUp = (response & 0x80000000) == 0x80000000,
CCS = (response & 0x40000000) == 0x40000000,
@@ -82,12 +81,9 @@ namespace DiscImageChef.Decoders.SecureDigital
TwoSeven = (response & 0x00008000) == 0x00008000,
LowPower = (response & 0x00000080) == 0x00000080
};
}
public static OCR DecodeOCR(byte[] response)
{
return response?.Length != 4 ? null : DecodeOCR(BitConverter.ToUInt32(response, 0));
}
public static OCR DecodeOCR(byte[] response) =>
response?.Length != 4 ? null : DecodeOCR(BitConverter.ToUInt32(response, 0));
public static string PrettifyOCR(OCR ocr)
{
@@ -112,14 +108,8 @@ namespace DiscImageChef.Decoders.SecureDigital
return sb.ToString();
}
public static string PrettifyOCR(byte[] response)
{
return PrettifyOCR(DecodeOCR(response));
}
public static string PrettifyOCR(byte[] response) => PrettifyOCR(DecodeOCR(response));
public static string PrettifyOCR(uint response)
{
return PrettifyOCR(DecodeOCR(response));
}
public static string PrettifyOCR(uint response) => PrettifyOCR(DecodeOCR(response));
}
}

View File

@@ -159,14 +159,8 @@ namespace DiscImageChef.Decoders.SecureDigital
return sb.ToString();
}
public static string PrettifySCR(uint[] response)
{
return PrettifySCR(DecodeSCR(response));
}
public static string PrettifySCR(uint[] response) => PrettifySCR(DecodeSCR(response));
public static string PrettifySCR(byte[] response)
{
return PrettifySCR(DecodeSCR(response));
}
public static string PrettifySCR(byte[] response) => PrettifySCR(DecodeSCR(response));
}
}