[NTOS:FSTUB] Make some macros more "conforming"

i.e. parenthesized parameters; parenthesize compound macros, etc.
This commit is contained in:
Hermès Bélusca-Maïto
2026-04-11 18:16:21 +02:00
parent ff751cfa35
commit 0bbb12f991
2 changed files with 25 additions and 25 deletions
+5 -5
View File
@@ -94,11 +94,11 @@ C_ASSERT(sizeof(MASTER_BOOT_RECORD) == 512);
#define EFI_GUID_STRING_SIZE 0x27
#define IS_VALID_DISK_INFO(Disk) \
(Disk) && \
(Disk->DeviceObject) && \
(Disk->SectorSize) && \
(Disk->Buffer) && \
(Disk->SectorCount)
((Disk) && \
((Disk)->DeviceObject) && \
((Disk)->SectorSize) && \
((Disk)->Buffer) && \
((Disk)->SectorCount))
VOID
NTAPI
+20 -20
View File
@@ -240,36 +240,36 @@ xKdUnmapVirtualAddress(
//
// Various offsets in the boot record
//
#define DISK_SIGNATURE_OFFSET 0x1B8
#define PARTITION_TABLE_OFFSET 0x1BE
#define BOOT_SIGNATURE_OFFSET (0x200 - 2)
#define DISK_SIGNATURE_OFFSET 0x1B8
#define PARTITION_TABLE_OFFSET 0x1BE
#define BOOT_SIGNATURE_OFFSET (0x200 - 2)
#define BOOT_RECORD_SIGNATURE 0xAA55
#define NUM_PARTITION_TABLE_ENTRIES 4
#define BOOT_RECORD_SIGNATURE 0xAA55
#define NUM_PARTITION_TABLE_ENTRIES 4
//
// Helper Macros
//
#define GET_STARTING_SECTOR(p) \
((ULONG)(p->StartingSectorLsb0) + \
(ULONG)(p->StartingSectorLsb1 << 8 ) + \
(ULONG)(p->StartingSectorMsb0 << 16) + \
(ULONG)(p->StartingSectorMsb1 << 24))
#define GET_STARTING_SECTOR(p) \
((ULONG)((p)->StartingSectorLsb0) + \
(ULONG)((p)->StartingSectorLsb1 << 8 ) + \
(ULONG)((p)->StartingSectorMsb0 << 16) + \
(ULONG)((p)->StartingSectorMsb1 << 24))
#define GET_ENDING_S_OF_CHS(p) \
((UCHAR)(p->EndingCylinderLsb & 0x3F))
#define GET_ENDING_S_OF_CHS(p) \
((UCHAR)((p)->EndingCylinderLsb & 0x3F))
#define GET_PARTITION_LENGTH(p) \
((ULONG)(p->PartitionLengthLsb0) + \
(ULONG)(p->PartitionLengthLsb1 << 8) + \
(ULONG)(p->PartitionLengthMsb0 << 16) + \
(ULONG)(p->PartitionLengthMsb1 << 24))
((ULONG)((p)->PartitionLengthLsb0) + \
(ULONG)((p)->PartitionLengthLsb1 << 8 ) + \
(ULONG)((p)->PartitionLengthMsb0 << 16) + \
(ULONG)((p)->PartitionLengthMsb1 << 24))
#define SET_PARTITION_LENGTH(p, l) \
p->PartitionLengthLsb0 = l & 0xFF; \
p->PartitionLengthLsb1 = (l >> 8) & 0xFF; \
p->PartitionLengthMsb0 = (l >> 16) & 0xFF; \
p->PartitionLengthMsb1 = (l >> 24) & 0xFF
((p)->PartitionLengthLsb0 = (l) & 0xFF, \
(p)->PartitionLengthLsb1 = ((l) >> 8 ) & 0xFF, \
(p)->PartitionLengthMsb0 = ((l) >> 16) & 0xFF, \
(p)->PartitionLengthMsb1 = ((l) >> 24) & 0xFF)
//
// Structure describing a partition