[CMLIB] Fix GCC13 print formatting '%lu' warning (#7408)

CORE-19724

sdk/lib/cmlib/cmcheck.c: Print the HCELL_INDEX indices in hexadecimal.

------------------

sdk/lib/cmlib/cmcheck.c:321:60: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'ULONG' {aka 'unsigned int'} [-Wformat=]

and at lines 341, 357, 374, 554, 579, 733, 760, 801, 984, 1003, 1458,
1476, 1521, 1551, 1670

sdk/lib/cmlib/cmcheck.c:1251:65: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'HCELL_INDEX' {aka 'unsigned int'} [-Wformat=]

and at lines 1282, 1303, 1551

sdk/lib/cmlib/cmcheck.c:1326:79: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'LONG' {aka 'int'} [-Wformat=]

sdk/lib/cmlib/cmcheck.c:1684:76: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'CM_CHECK_REGISTRY_STATUS' {aka 'unsigned int'} [-Wformat=]

and at line 1711

------------------

sdk/lib/cmlib/cmheal.c:223:108: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'ULONG' {aka 'unsigned int'} [-Wformat=]

and at lines 240, 319, 335

sdk/lib/cmlib/cmheal.c:480:79: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'int' [-Wformat=]

------------------

sdk/lib/cmlib/hiveinit.c:976:62: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'ULONG' {aka 'unsigned int'} [-Wformat=]

and at lines 988, 1492
This commit is contained in:
Hermès Bélusca-Maïto 2024-09-29 16:24:25 +02:00
parent a0f8b40d5a
commit ee5338ff13
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
4 changed files with 41 additions and 37 deletions

View file

@ -26,7 +26,7 @@ HvpGetCellHeader(
{
PVOID Block;
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - Hive %p, CellIndex %08lx\n",
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - Hive 0x%p, CellIndex 0x%x\n",
__FUNCTION__, RegistryHive, CellIndex);
ASSERT(CellIndex != HCELL_NIL);
@ -116,7 +116,7 @@ HvMarkCellDirty(
ASSERT(RegistryHive->ReadOnly == FALSE);
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - Hive %p, CellIndex %08lx, HoldingLock %u\n",
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - Hive 0x%p, CellIndex 0x%x, HoldingLock %u\n",
__FUNCTION__, RegistryHive, CellIndex, HoldingLock);
if (HvGetCellType(CellIndex) != Stable)
@ -367,7 +367,7 @@ HvAllocateCell(
ASSERT(RegistryHive->ReadOnly == FALSE);
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - Hive %p, Size %x, %s, Vicinity %08lx\n",
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - Hive 0x%p, Size 0x%x, %s, Vicinity 0x%x\n",
__FUNCTION__, RegistryHive, Size, (Storage == 0) ? "Stable" : "Volatile", Vicinity);
/* Round to 16 bytes multiple. */
@ -411,7 +411,7 @@ HvAllocateCell(
FreeCell->Size = -FreeCell->Size;
RtlZeroMemory(FreeCell + 1, Size - sizeof(HCELL));
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - CellIndex %08lx\n",
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - CellIndex 0x%x\n",
__FUNCTION__, FreeCellOffset);
return FreeCellOffset;
@ -431,7 +431,7 @@ HvReallocateCell(
ASSERT(CellIndex != HCELL_NIL);
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - Hive %p, CellIndex %08lx, Size %x\n",
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - Hive 0x%p, CellIndex 0x%x, Size 0x%x\n",
__FUNCTION__, RegistryHive, CellIndex, Size);
Storage = HvGetCellType(CellIndex);
@ -477,7 +477,7 @@ HvFreeCell(
ASSERT(RegistryHive->ReadOnly == FALSE);
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - Hive %p, CellIndex %08lx\n",
CMLTRACE(CMLIB_HCELL_DEBUG, "%s - Hive 0x%p, CellIndex 0x%x\n",
__FUNCTION__, RegistryHive, CellIndex);
Free = HvpGetCellHeader(RegistryHive, CellIndex);