mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use object initializer.
This commit is contained in:
Submodule Aaru.Decoders updated: 83612d6084...f9e9b07584
@@ -133,11 +133,10 @@ public partial class Device
|
||||
Command = (byte)AtaCommands.ReadLogExt,
|
||||
SectorCount = count,
|
||||
LbaMidCurrent = (byte)(pageNumber & 0xFF),
|
||||
LbaMidPrevious = (byte)((pageNumber & 0xFF00) / 0x100)
|
||||
LbaMidPrevious = (byte)((pageNumber & 0xFF00) / 0x100),
|
||||
LbaLowCurrent = logAddress
|
||||
};
|
||||
|
||||
registers.LbaLowCurrent = logAddress;
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.SectorCount,
|
||||
ref buffer, timeout, true, out duration, out bool sense);
|
||||
|
||||
@@ -167,11 +166,10 @@ public partial class Device
|
||||
Command = (byte)AtaCommands.ReadLogDmaExt,
|
||||
SectorCount = count,
|
||||
LbaMidCurrent = (byte)(pageNumber & 0xFF),
|
||||
LbaMidPrevious = (byte)((pageNumber & 0xFF00) / 0x100)
|
||||
LbaMidPrevious = (byte)((pageNumber & 0xFF00) / 0x100),
|
||||
LbaLowCurrent = logAddress
|
||||
};
|
||||
|
||||
registers.LbaLowCurrent = logAddress;
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.Dma, AtaTransferRegister.SectorCount,
|
||||
ref buffer, timeout, true, out duration, out bool sense);
|
||||
|
||||
|
||||
@@ -90,10 +90,12 @@ partial class Device : Devices.Device
|
||||
}
|
||||
|
||||
// Windows is answering SCSI INQUIRY for all device types so it needs to be detected first
|
||||
var query = new StoragePropertyQuery();
|
||||
query.PropertyId = StoragePropertyId.Device;
|
||||
query.QueryType = StorageQueryType.Standard;
|
||||
query.AdditionalParameters = new byte[1];
|
||||
var query = new StoragePropertyQuery
|
||||
{
|
||||
PropertyId = StoragePropertyId.Device,
|
||||
QueryType = StorageQueryType.Standard,
|
||||
AdditionalParameters = new byte[1]
|
||||
};
|
||||
|
||||
IntPtr descriptorPtr = Marshal.AllocHGlobal(1000);
|
||||
var descriptorB = new byte[1000];
|
||||
|
||||
@@ -705,9 +705,11 @@ static partial class Usb
|
||||
if(!_portIsHub)
|
||||
return null;
|
||||
|
||||
var hub = new UsbHub();
|
||||
hub._hubIsRootHub = false;
|
||||
hub._hubDeviceDesc = "External Hub";
|
||||
var hub = new UsbHub
|
||||
{
|
||||
_hubIsRootHub = false,
|
||||
_hubDeviceDesc = "External Hub"
|
||||
};
|
||||
|
||||
// Open a handle to the Host Controller
|
||||
IntPtr h = CreateFile(_portHubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0,
|
||||
|
||||
@@ -203,11 +203,10 @@ public sealed partial class ISO9660
|
||||
Filename = Encoding.GetString(data, entryOff + _directoryRecordSize, record.name_len),
|
||||
VolumeSequenceNumber = record.volume_sequence_number,
|
||||
Timestamp = DecodeHighSierraDateTime(record.date),
|
||||
XattrLength = record.xattr_len
|
||||
XattrLength = record.xattr_len,
|
||||
Extents = new List<(uint extent, uint size)>()
|
||||
};
|
||||
|
||||
entry.Extents = new List<(uint extent, uint size)>();
|
||||
|
||||
if(record.size != 0)
|
||||
entry.Extents.Add((record.start_lbn, record.size));
|
||||
|
||||
@@ -286,11 +285,10 @@ public sealed partial class ISO9660
|
||||
VolumeSequenceNumber = record.volume_sequence_number,
|
||||
Filename = Encoding.GetString(data, entryOff + _directoryRecordSize, record.name_len),
|
||||
Timestamp = DecodeHighSierraDateTime(record.date),
|
||||
XattrLength = record.xattr_len
|
||||
XattrLength = record.xattr_len,
|
||||
Extents = new List<(uint extent, uint size)>()
|
||||
};
|
||||
|
||||
entry.Extents = new List<(uint extent, uint size)>();
|
||||
|
||||
if(record.size != 0)
|
||||
entry.Extents.Add((record.extent, record.size));
|
||||
|
||||
@@ -363,11 +361,10 @@ public sealed partial class ISO9660
|
||||
Interleave = record.interleave,
|
||||
VolumeSequenceNumber = record.volume_sequence_number,
|
||||
Timestamp = DecodeIsoDateTime(record.date),
|
||||
XattrLength = record.xattr_len
|
||||
XattrLength = record.xattr_len,
|
||||
Extents = new List<(uint extent, uint size)>()
|
||||
};
|
||||
|
||||
entry.Extents = new List<(uint extent, uint size)>();
|
||||
|
||||
if(record.size != 0)
|
||||
entry.Extents.Add((record.extent, record.size));
|
||||
|
||||
@@ -581,10 +578,13 @@ public sealed partial class ISO9660
|
||||
|
||||
hasResourceFork = true;
|
||||
|
||||
fInfo = new AppleCommon.FInfo();
|
||||
fInfo.fdCreator = appleHfsSystemUse.creator;
|
||||
fInfo.fdFlags = appleHfsSystemUse.finder_flags;
|
||||
fInfo.fdType = appleHfsSystemUse.type;
|
||||
fInfo = new AppleCommon.FInfo
|
||||
{
|
||||
fdCreator = appleHfsSystemUse.creator,
|
||||
fdFlags = appleHfsSystemUse.finder_flags,
|
||||
fdType = appleHfsSystemUse.type
|
||||
};
|
||||
|
||||
entry.FinderInfo = fInfo;
|
||||
|
||||
break;
|
||||
@@ -617,9 +617,12 @@ public sealed partial class ISO9660
|
||||
|
||||
hasResourceFork = true;
|
||||
|
||||
fInfo = new AppleCommon.FInfo();
|
||||
fInfo.fdCreator = appleHfsTypeCreatorSystemUse.creator;
|
||||
fInfo.fdType = appleHfsTypeCreatorSystemUse.type;
|
||||
fInfo = new AppleCommon.FInfo
|
||||
{
|
||||
fdCreator = appleHfsTypeCreatorSystemUse.creator,
|
||||
fdType = appleHfsTypeCreatorSystemUse.type
|
||||
};
|
||||
|
||||
entry.FinderInfo = fInfo;
|
||||
|
||||
systemAreaOff += Marshal.SizeOf<AppleHFSTypeCreatorSystemUse>();
|
||||
@@ -633,9 +636,12 @@ public sealed partial class ISO9660
|
||||
|
||||
hasResourceFork = true;
|
||||
|
||||
fInfo = new AppleCommon.FInfo();
|
||||
fInfo.fdCreator = appleHfsIconSystemUse.creator;
|
||||
fInfo.fdType = appleHfsIconSystemUse.type;
|
||||
fInfo = new AppleCommon.FInfo
|
||||
{
|
||||
fdCreator = appleHfsIconSystemUse.creator,
|
||||
fdType = appleHfsIconSystemUse.type
|
||||
};
|
||||
|
||||
entry.FinderInfo = fInfo;
|
||||
entry.AppleIcon = appleHfsIconSystemUse.icon;
|
||||
|
||||
@@ -649,10 +655,13 @@ public sealed partial class ISO9660
|
||||
|
||||
hasResourceFork = true;
|
||||
|
||||
fInfo = new AppleCommon.FInfo();
|
||||
fInfo.fdCreator = appleHfsSystemUse.creator;
|
||||
fInfo.fdFlags = (AppleCommon.FinderFlags)appleHfsSystemUse.finder_flags;
|
||||
fInfo.fdType = appleHfsSystemUse.type;
|
||||
fInfo = new AppleCommon.FInfo
|
||||
{
|
||||
fdCreator = appleHfsSystemUse.creator,
|
||||
fdFlags = (AppleCommon.FinderFlags)appleHfsSystemUse.finder_flags,
|
||||
fdType = appleHfsSystemUse.type
|
||||
};
|
||||
|
||||
entry.FinderInfo = fInfo;
|
||||
|
||||
systemAreaOff += Marshal.SizeOf<AppleHFSOldSystemUse>();
|
||||
@@ -1096,11 +1105,10 @@ public sealed partial class ISO9660
|
||||
Filename = tEntry.Name,
|
||||
VolumeSequenceNumber = record.volume_sequence_number,
|
||||
Timestamp = DecodeHighSierraDateTime(record.date),
|
||||
XattrLength = tEntry.XattrLength
|
||||
XattrLength = tEntry.XattrLength,
|
||||
Extents = new List<(uint extent, uint size)>()
|
||||
};
|
||||
|
||||
entry.Extents = new List<(uint extent, uint size)>();
|
||||
|
||||
if(record.size != 0)
|
||||
entry.Extents.Add((record.start_lbn, record.size));
|
||||
|
||||
@@ -1152,11 +1160,10 @@ public sealed partial class ISO9660
|
||||
Interleave = record.interleave,
|
||||
VolumeSequenceNumber = record.volume_sequence_number,
|
||||
Timestamp = DecodeIsoDateTime(record.date),
|
||||
XattrLength = tEntry.XattrLength
|
||||
XattrLength = tEntry.XattrLength,
|
||||
Extents = new List<(uint extent, uint size)>()
|
||||
};
|
||||
|
||||
entry.Extents = new List<(uint extent, uint size)>();
|
||||
|
||||
if(record.size != 0)
|
||||
entry.Extents.Add((record.extent, record.size));
|
||||
|
||||
@@ -1201,11 +1208,10 @@ public sealed partial class ISO9660
|
||||
Interleave = record.interleave,
|
||||
VolumeSequenceNumber = record.volume_sequence_number,
|
||||
Timestamp = DecodeHighSierraDateTime(record.date),
|
||||
XattrLength = tEntry.XattrLength
|
||||
XattrLength = tEntry.XattrLength,
|
||||
Extents = new List<(uint extent, uint size)>()
|
||||
};
|
||||
|
||||
entry.Extents = new List<(uint extent, uint size)>();
|
||||
|
||||
if(record.size != 0)
|
||||
entry.Extents.Add((record.extent, record.size));
|
||||
|
||||
|
||||
@@ -379,8 +379,10 @@ public class SuperNintendo : IByteAddressableImage
|
||||
if(hasFlash)
|
||||
devices++;
|
||||
|
||||
mappings = new LinearMemoryMap();
|
||||
mappings.Devices = new LinearMemoryDevice[devices];
|
||||
mappings = new LinearMemoryMap
|
||||
{
|
||||
Devices = new LinearMemoryDevice[devices]
|
||||
};
|
||||
|
||||
mappings.Devices[0] = new LinearMemoryDevice
|
||||
{
|
||||
|
||||
@@ -1238,22 +1238,24 @@ public sealed partial class Nero
|
||||
return ErrorNumber.InvalidArgument;
|
||||
}
|
||||
|
||||
var track = new Track();
|
||||
|
||||
// Common track data
|
||||
track.Description = StringHandlers.CToString(_neroTracks[1].Isrc);
|
||||
|
||||
track.EndSector = (_imageNewFormat ? footerV2.FirstChunkOffset : footerV1.FirstChunkOffset) /
|
||||
_neroTracks[1].SectorSize - 150;
|
||||
|
||||
track.Sequence = _neroTracks[1].Sequence;
|
||||
track.Session = currentSession;
|
||||
track.Type = NeroTrackModeToTrackType((DaoMode)_neroTracks[1].Mode);
|
||||
track.File = imageFilter.Filename;
|
||||
track.Filter = imageFilter;
|
||||
track.FileType = "BINARY";
|
||||
track.SubchannelType = TrackSubchannelType.None;
|
||||
track.Indexes[1] = 0;
|
||||
var track = new Track
|
||||
{
|
||||
// Common track data
|
||||
Description = StringHandlers.CToString(_neroTracks[1].Isrc),
|
||||
EndSector = (_imageNewFormat ? footerV2.FirstChunkOffset : footerV1.FirstChunkOffset) /
|
||||
_neroTracks[1].SectorSize - 150,
|
||||
Sequence = _neroTracks[1].Sequence,
|
||||
Session = currentSession,
|
||||
Type = NeroTrackModeToTrackType((DaoMode)_neroTracks[1].Mode),
|
||||
File = imageFilter.Filename,
|
||||
Filter = imageFilter,
|
||||
FileType = "BINARY",
|
||||
SubchannelType = TrackSubchannelType.None,
|
||||
Indexes =
|
||||
{
|
||||
[1] = 0
|
||||
}
|
||||
};
|
||||
|
||||
var rawMode1 = false;
|
||||
var rawMode2 = false;
|
||||
|
||||
@@ -260,8 +260,10 @@ public sealed class AtariPartitions : IPartition
|
||||
if(errno != ErrorNumber.NoError)
|
||||
break;
|
||||
|
||||
var extendedTable = new AtariTable();
|
||||
extendedTable.Entries = new AtariEntry[4];
|
||||
var extendedTable = new AtariTable
|
||||
{
|
||||
Entries = new AtariEntry[4]
|
||||
};
|
||||
|
||||
for(var j = 0; j < 4; j++)
|
||||
{
|
||||
|
||||
@@ -255,8 +255,11 @@ sealed class FilesystemInfoCommand : Command
|
||||
|
||||
for(var i = 0; i < partitionsList.Count; i++)
|
||||
{
|
||||
Table table = new();
|
||||
table.Title = new TableTitle($"Partition {partitionsList[i].Sequence}:");
|
||||
Table table = new()
|
||||
{
|
||||
Title = new TableTitle($"Partition {partitionsList[i].Sequence}:")
|
||||
};
|
||||
|
||||
table.AddColumn("");
|
||||
table.AddColumn("");
|
||||
table.HideHeaders();
|
||||
|
||||
Reference in New Issue
Block a user