mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Reformat code.
This commit is contained in:
@@ -58,8 +58,7 @@ namespace DiscImageChef.PartPlugins
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
if(42 + sectorOffset >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
if(42 + sectorOffset >= imagePlugin.GetSectors()) return false;
|
||||
|
||||
byte[] tblsector = imagePlugin.ReadSector(42 + sectorOffset);
|
||||
|
||||
@@ -67,30 +66,33 @@ namespace DiscImageChef.PartPlugins
|
||||
partable xnxtbl = (partable)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(partable));
|
||||
handle.Free();
|
||||
|
||||
DicConsole.DebugWriteLine("XENIX plugin", "xnxtbl.p_magic = 0x{0:X4} (should be 0x{1:X4})", xnxtbl.p_magic, PAMAGIC);
|
||||
DicConsole.DebugWriteLine("XENIX plugin", "xnxtbl.p_magic = 0x{0:X4} (should be 0x{1:X4})", xnxtbl.p_magic,
|
||||
PAMAGIC);
|
||||
|
||||
if(xnxtbl.p_magic != PAMAGIC)
|
||||
return false;
|
||||
if(xnxtbl.p_magic != PAMAGIC) return false;
|
||||
|
||||
for(int i = 0; i < MAXPARTS; i++)
|
||||
{
|
||||
DicConsole.DebugWriteLine("XENIX plugin", "xnxtbl.p[{0}].p_off = {1}", i, xnxtbl.p[i].p_off);
|
||||
DicConsole.DebugWriteLine("XENIX plugin", "xnxtbl.p[{0}].p_size = {1}", i, xnxtbl.p[i].p_size);
|
||||
if(xnxtbl.p[i].p_size >0)
|
||||
if(xnxtbl.p[i].p_size > 0)
|
||||
{
|
||||
Partition part = new Partition
|
||||
{
|
||||
Start = ((ulong)((xnxtbl.p[i].p_off + XENIX_OFFSET) * XENIX_BSIZE) / imagePlugin.GetSectorSize()) + sectorOffset,
|
||||
Start =
|
||||
((ulong)((xnxtbl.p[i].p_off + XENIX_OFFSET) * XENIX_BSIZE) / imagePlugin.GetSectorSize()) +
|
||||
sectorOffset,
|
||||
Length = (ulong)(xnxtbl.p[i].p_size * XENIX_BSIZE) / imagePlugin.GetSectorSize(),
|
||||
Offset = (ulong)((xnxtbl.p[i].p_off + XENIX_OFFSET) * XENIX_BSIZE) + (imagePlugin.GetSectorSize() * sectorOffset),
|
||||
Offset =
|
||||
(ulong)((xnxtbl.p[i].p_off + XENIX_OFFSET) * XENIX_BSIZE) +
|
||||
(imagePlugin.GetSectorSize() * sectorOffset),
|
||||
Size = (ulong)(xnxtbl.p[i].p_size * XENIX_BSIZE),
|
||||
Sequence = (ulong)i,
|
||||
Type = "XENIX",
|
||||
Scheme = Name
|
||||
};
|
||||
|
||||
if(part.End < imagePlugin.GetSectors())
|
||||
partitions.Add(part);
|
||||
if(part.End < imagePlugin.GetSectors()) partitions.Add(part);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,16 +102,15 @@ namespace DiscImageChef.PartPlugins
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
struct partable
|
||||
{
|
||||
public ushort p_magic; /* magic number validity indicator */
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MAXPARTS)]
|
||||
public partition[] p; /*partition headers*/
|
||||
public ushort p_magic; /* magic number validity indicator */
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MAXPARTS)] public partition[] p; /*partition headers*/
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
struct partition
|
||||
{
|
||||
public int p_off; /*start 1K block no of partition*/
|
||||
public int p_size; /*# of 1K blocks in partition*/
|
||||
public int p_off; /*start 1K block no of partition*/
|
||||
public int p_size; /*# of 1K blocks in partition*/
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user