mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
🎨🎨🎨 Removed methods in images that only returned what's already in the ImageInfo structure.
This commit is contained in:
@@ -79,7 +79,8 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
byte[] tmp = device.ReadSectors((ulong)entry.firstBlock, (uint)(entry.lastBlock - entry.firstBlock));
|
||||
file = new byte[(entry.lastBlock - entry.firstBlock - 1) * device.GetSectorSize() + entry.lastBytes];
|
||||
file = new byte[(entry.lastBlock - entry.firstBlock - 1) * device.ImageInfo.SectorSize +
|
||||
entry.lastBytes];
|
||||
Array.Copy(tmp, 0, file, 0, file.Length);
|
||||
}
|
||||
|
||||
@@ -110,7 +111,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
stat = new FileEntryInfo
|
||||
{
|
||||
Attributes = FileAttributes.System,
|
||||
BlockSize = device.GetSectorSize(),
|
||||
BlockSize = device.ImageInfo.SectorSize,
|
||||
DeviceNo = 0,
|
||||
GID = 0,
|
||||
Inode = 0,
|
||||
@@ -141,12 +142,12 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
{
|
||||
Attributes = FileAttributes.File,
|
||||
Blocks = entry.lastBlock - entry.firstBlock,
|
||||
BlockSize = device.GetSectorSize(),
|
||||
BlockSize = device.ImageInfo.SectorSize,
|
||||
DeviceNo = 0,
|
||||
GID = 0,
|
||||
Inode = 0,
|
||||
LastWriteTimeUtc = DateHandlers.UcsdPascalToDateTime(entry.mtime),
|
||||
Length = (entry.lastBlock - entry.firstBlock) * device.GetSectorSize() + entry.lastBytes,
|
||||
Length = (entry.lastBlock - entry.firstBlock) * device.ImageInfo.SectorSize + entry.lastBytes,
|
||||
Links = 1,
|
||||
Mode = 0x124,
|
||||
UID = 0
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
|
||||
// Last volume record block must be after first block, and before end of device
|
||||
if(volEntry.lastBlock <= volEntry.firstBlock ||
|
||||
(ulong)volEntry.lastBlock > imagePlugin.GetSectors() - 2) return false;
|
||||
(ulong)volEntry.lastBlock > imagePlugin.ImageInfo.Sectors - 2) return false;
|
||||
|
||||
// Volume record entry type must be volume or secure
|
||||
if(volEntry.entryType != PascalFileKind.Volume && volEntry.entryType != PascalFileKind.Secure) return false;
|
||||
@@ -77,7 +77,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
if(volEntry.volumeName[0] > 7) return false;
|
||||
|
||||
// Volume blocks is equal to volume sectors
|
||||
if(volEntry.blocks < 0 || (ulong)volEntry.blocks != imagePlugin.GetSectors()) return false;
|
||||
if(volEntry.blocks < 0 || (ulong)volEntry.blocks != imagePlugin.ImageInfo.Sectors) return false;
|
||||
|
||||
// There can be not less than zero files
|
||||
return volEntry.files >= 0;
|
||||
@@ -88,7 +88,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
StringBuilder sbInformation = new StringBuilder();
|
||||
information = "";
|
||||
|
||||
if(imagePlugin.GetSectors() < 3) return;
|
||||
if(imagePlugin.ImageInfo.Sectors < 3) return;
|
||||
|
||||
// Blocks 0 and 1 are boot code
|
||||
byte[] volBlock = imagePlugin.ReadSector(2 + partition.Start);
|
||||
@@ -113,7 +113,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
|
||||
// Last volume record block must be after first block, and before end of device
|
||||
if(volEntry.lastBlock <= volEntry.firstBlock ||
|
||||
(ulong)volEntry.lastBlock > imagePlugin.GetSectors() - 2) return;
|
||||
(ulong)volEntry.lastBlock > imagePlugin.ImageInfo.Sectors - 2) return;
|
||||
|
||||
// Volume record entry type must be volume or secure
|
||||
if(volEntry.entryType != PascalFileKind.Volume && volEntry.entryType != PascalFileKind.Secure) return;
|
||||
@@ -122,7 +122,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
if(volEntry.volumeName[0] > 7) return;
|
||||
|
||||
// Volume blocks is equal to volume sectors
|
||||
if(volEntry.blocks < 0 || (ulong)volEntry.blocks != imagePlugin.GetSectors()) return;
|
||||
if(volEntry.blocks < 0 || (ulong)volEntry.blocks != imagePlugin.ImageInfo.Sectors) return;
|
||||
|
||||
// There can be not less than zero files
|
||||
if(volEntry.files < 0) return;
|
||||
@@ -144,7 +144,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
{
|
||||
Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(imagePlugin.ReadSectors(partition.Start, 2)),
|
||||
Clusters = volEntry.blocks,
|
||||
ClusterSize = (int)imagePlugin.GetSectorSize(),
|
||||
ClusterSize = (int)imagePlugin.ImageInfo.SectorSize,
|
||||
Files = volEntry.files,
|
||||
FilesSpecified = true,
|
||||
Type = "UCSD Pascal",
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
public override Errno Mount(bool debug)
|
||||
{
|
||||
this.debug = debug;
|
||||
if(device.GetSectors() < 3) return Errno.InvalidArgument;
|
||||
if(device.ImageInfo.Sectors < 3) return Errno.InvalidArgument;
|
||||
|
||||
// Blocks 0 and 1 are boot code
|
||||
catalogBlocks = device.ReadSector(2);
|
||||
@@ -66,10 +66,10 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
mountedVolEntry.tail = BigEndianBitConverter.ToInt32(catalogBlocks, 0x16);
|
||||
|
||||
if(mountedVolEntry.firstBlock != 0 || mountedVolEntry.lastBlock <= mountedVolEntry.firstBlock ||
|
||||
(ulong)mountedVolEntry.lastBlock > device.GetSectors() - 2 ||
|
||||
(ulong)mountedVolEntry.lastBlock > device.ImageInfo.Sectors - 2 ||
|
||||
mountedVolEntry.entryType != PascalFileKind.Volume &&
|
||||
mountedVolEntry.entryType != PascalFileKind.Secure || mountedVolEntry.volumeName[0] > 7 ||
|
||||
mountedVolEntry.blocks < 0 || (ulong)mountedVolEntry.blocks != device.GetSectors() ||
|
||||
mountedVolEntry.blocks < 0 || (ulong)mountedVolEntry.blocks != device.ImageInfo.Sectors ||
|
||||
mountedVolEntry.files < 0) return Errno.InvalidArgument;
|
||||
|
||||
catalogBlocks = device.ReadSectors(2, (uint)(mountedVolEntry.lastBlock - mountedVolEntry.firstBlock - 2));
|
||||
@@ -100,7 +100,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
{
|
||||
Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(bootBlocks),
|
||||
Clusters = mountedVolEntry.blocks,
|
||||
ClusterSize = (int)device.GetSectorSize(),
|
||||
ClusterSize = (int)device.ImageInfo.SectorSize,
|
||||
Files = mountedVolEntry.files,
|
||||
FilesSpecified = true,
|
||||
Type = "UCSD Pascal",
|
||||
|
||||
Reference in New Issue
Block a user