General cleanup and refactor.

This commit is contained in:
2022-03-07 07:36:42 +00:00
parent 0deebadaa0
commit bd76adc35e
119 changed files with 1647 additions and 2151 deletions

View File

@@ -30,6 +30,8 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Decoders.PCMCIA;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@@ -37,8 +39,6 @@ using System.Linq;
using System.Text;
using Aaru.Helpers;
namespace Aaru.Decoders.PCMCIA;
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class CIS
@@ -46,8 +46,8 @@ public static class CIS
// TODO: Handle links? Or are they removed in lower layers of the operating system drivers?
public static Tuple[] GetTuples(byte[] data)
{
List<Tuple> tuples = new List<Tuple>();
int position = 0;
var tuples = new List<Tuple>();
var position = 0;
while(position < data.Length)
{
@@ -94,10 +94,10 @@ public static class CIS
if((data?.Length - 2) % 6 != 0)
return null;
var tuple = new DeviceGeometryTuple();
List<DeviceGeometry> geometries = new List<DeviceGeometry>();
var tuple = new DeviceGeometryTuple();
var geometries = new List<DeviceGeometry>();
for(int position = 2; position < data.Length; position += 6)
for(var position = 2; position < data.Length; position += 6)
{
var geometry = new DeviceGeometry
{
@@ -219,10 +219,10 @@ public static class CIS
if(data.Length < 4)
return null;
List<byte> buffer = new List<byte>();
var buffer = new List<byte>();
List<string> strings = null;
bool firstString = false;
bool secondString = false;
var firstString = false;
var secondString = false;
var tuple = new Level1VersionTuple
{
@@ -232,7 +232,7 @@ public static class CIS
MinorVersion = data[3]
};
for(int position = 4; position < data.Length; position++)
for(var position = 4; position < data.Length; position++)
{
if(data[position] == 0xFF)
break;

View File

@@ -30,10 +30,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
namespace Aaru.Decoders.PCMCIA;
using System.Diagnostics.CodeAnalysis;
/// <summary>Tuple codes.</summary>
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum TupleCodes : byte
@@ -165,9 +165,17 @@ public enum DeviceSpeedCodes : byte
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum FunctionCodes : byte
{
MultiFunction = 0x00, Memory = 0x01, Serial = 0x02,
Parallel = 0x03, FixedDisk = 0x04, Video = 0x05,
Network = 0x06, AIMS = 0x07, SCSI = 0x08,
Security = 0x09, Instrument = 0x0A, HighSpeedSerial = 0x0B,
VendorSpecific = 0xFE
MultiFunction = 0x00,
Memory = 0x01,
Serial = 0x02,
Parallel = 0x03,
FixedDisk = 0x04,
Video = 0x05,
Network = 0x06,
AIMS = 0x07,
SCSI = 0x08,
Security = 0x09,
Instrument = 0x0A,
HighSpeedSerial = 0x0B,
VendorSpecific = 0xFE
}

View File

@@ -30,10 +30,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
namespace Aaru.Decoders.PCMCIA;
using System.Diagnostics.CodeAnalysis;
/// <summary>Basic classure of a PCMCIA tuple</summary>
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]

View File

@@ -30,10 +30,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
namespace Aaru.Decoders.PCMCIA;
using System.Diagnostics.CodeAnalysis;
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
public static class VendorCode
{