Use proper integer formatting From: Al Stone --- source/compiler/aslcompile.c | 2 +- source/compiler/aslerror.c | 4 ++-- source/compiler/aslopt.c | 2 +- source/compiler/aslpredef.c | 2 +- source/compiler/aslprepkg.c | 2 +- source/components/debugger/dbexec.c | 2 +- source/components/dispatcher/dsmthdat.c | 4 ++-- source/components/dispatcher/dsutils.c | 2 +- source/components/dispatcher/dswscope.c | 4 ++-- source/components/events/evgpe.c | 4 ++-- source/components/executer/exdump.c | 2 +- source/components/executer/exfldio.c | 4 ++-- source/components/executer/exnames.c | 4 ++-- source/components/hardware/hwregs.c | 2 +- source/components/tables/tbfadt.c | 6 +++--- source/components/tables/tbxfroot.c | 6 +++--- source/components/utilities/utownerid.c | 2 +- source/tools/acpiexec/aemain.c | 2 +- 18 files changed, 28 insertions(+), 28 deletions(-) diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c index a564f86..9dbabfb 100644 --- a/source/compiler/aslcompile.c +++ b/source/compiler/aslcompile.c @@ -702,7 +702,7 @@ CmCleanupAndExit ( if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { - printf ("\nMaximum error count (%u) exceeded\n", + printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT); } diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c index 2c0516a..bf230ff 100644 --- a/source/compiler/aslerror.c +++ b/source/compiler/aslerror.c @@ -687,7 +687,7 @@ AslCommonError ( Gbl_ExceptionCount[Level]++; if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { - printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT); + printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT); Gbl_SourceLine = 0; Gbl_NextError = Gbl_ErrorLog; @@ -733,7 +733,7 @@ AslDisableException ( if (Gbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES) { - printf ("Too many messages have been disabled (max %u)\n", + printf ("Too many messages have been disabled (max %d)\n", ASL_MAX_DISABLED_MESSAGES); return (AE_LIMIT); } diff --git a/source/compiler/aslopt.c b/source/compiler/aslopt.c index 05af0be..95b0c10 100644 --- a/source/compiler/aslopt.c +++ b/source/compiler/aslopt.c @@ -576,7 +576,7 @@ OptOptimizeNamePath ( } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, - "PATH OPTIMIZE: Line %5d ParentOp [%12.12s] ThisOp [%12.12s] ", + "PATH OPTIMIZE: Line %5u ParentOp [%12.12s] ThisOp [%12.12s] ", Op->Asl.LogicalLineNumber, AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode), AcpiPsGetOpcodeName (Op->Common.AmlOpcode))); diff --git a/source/compiler/aslpredef.c b/source/compiler/aslpredef.c index 7dd10b5..16df04a 100644 --- a/source/compiler/aslpredef.c +++ b/source/compiler/aslpredef.c @@ -114,7 +114,7 @@ ApCheckForPredefinedMethod ( if (MethodInfo->NumArguments != 0) { - sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0); + sprintf (MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0); AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, MsgBuffer); diff --git a/source/compiler/aslprepkg.c b/source/compiler/aslprepkg.c index ff80b57..e70b401 100644 --- a/source/compiler/aslprepkg.c +++ b/source/compiler/aslprepkg.c @@ -299,7 +299,7 @@ ApCheckPackage ( if (Count & 1) { - sprintf (MsgBuffer, "%4.4s: Package length, %d, must be even.", + sprintf (MsgBuffer, "%4.4s: Package length, %u, must be even.", Predefined->Info.Name, Count); AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c index b2836eb..d9fa628 100644 --- a/source/components/debugger/dbexec.c +++ b/source/components/debugger/dbexec.c @@ -214,7 +214,7 @@ AcpiDbExecuteMethod ( ACPI_ERROR ((AE_INFO, "Possible overflow of internal debugger " "buffer (size 0x%X needed 0x%X)", - ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length)); + (UINT32) ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length)); } } diff --git a/source/components/dispatcher/dsmthdat.c b/source/components/dispatcher/dsmthdat.c index 2040a33..5af6184 100644 --- a/source/components/dispatcher/dsmthdat.c +++ b/source/components/dispatcher/dsmthdat.c @@ -291,7 +291,7 @@ AcpiDsMethodDataGetNode ( if (Index > ACPI_METHOD_MAX_LOCAL) { ACPI_ERROR ((AE_INFO, - "Local index %u is invalid (max %u)", + "Local index %u is invalid (max %d)", Index, ACPI_METHOD_MAX_LOCAL)); return_ACPI_STATUS (AE_AML_INVALID_INDEX); } @@ -306,7 +306,7 @@ AcpiDsMethodDataGetNode ( if (Index > ACPI_METHOD_MAX_ARG) { ACPI_ERROR ((AE_INFO, - "Arg index %u is invalid (max %u)", + "Arg index %u is invalid (max %d)", Index, ACPI_METHOD_MAX_ARG)); return_ACPI_STATUS (AE_AML_INVALID_INDEX); } diff --git a/source/components/dispatcher/dsutils.c b/source/components/dispatcher/dsutils.c index a32b3d4..586204e 100644 --- a/source/components/dispatcher/dsutils.c +++ b/source/components/dispatcher/dsutils.c @@ -791,7 +791,7 @@ AcpiDsCreateOperands ( } ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "NumOperands %d, ArgCount %d, Index %d\n", + "NumOperands %d, ArgCount %u, Index %u\n", WalkState->NumOperands, ArgCount, Index)); /* Create the interpreter arguments, in reverse order */ diff --git a/source/components/dispatcher/dswscope.c b/source/components/dispatcher/dswscope.c index f67f2c4..4227ddb 100644 --- a/source/components/dispatcher/dswscope.c +++ b/source/components/dispatcher/dswscope.c @@ -149,7 +149,7 @@ AcpiDsScopeStackPush ( WalkState->ScopeDepth++; ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "[%.2d] Pushed scope ", (UINT32) WalkState->ScopeDepth)); + "[%.2d] Pushed scope ", WalkState->ScopeDepth)); OldScopeInfo = WalkState->ScopeInfo; if (OldScopeInfo) @@ -212,7 +212,7 @@ AcpiDsScopeStackPop ( WalkState->ScopeDepth--; ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "[%.2d] Popped scope [%4.4s] (%s), New scope -> ", + "[%.2u] Popped scope [%4.4s] (%s), New scope -> ", (UINT32) WalkState->ScopeDepth, AcpiUtGetNodeName (ScopeInfo->Scope.Node), AcpiUtGetTypeName (ScopeInfo->Common.Value))); diff --git a/source/components/events/evgpe.c b/source/components/events/evgpe.c index 04a1f1e..b9c6566 100644 --- a/source/components/events/evgpe.c +++ b/source/components/events/evgpe.c @@ -430,7 +430,7 @@ AcpiEvGpeDetect ( "Ignore disabled registers for GPE %02X-%02X: " "RunEnable=%02X, WakeEnable=%02X\n", GpeRegisterInfo->BaseGpeNumber, - GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1), + (unsigned int) (GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1)), GpeRegisterInfo->EnableForRun, GpeRegisterInfo->EnableForWake)); continue; @@ -456,7 +456,7 @@ AcpiEvGpeDetect ( "Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, " "RunEnable=%02X, WakeEnable=%02X\n", GpeRegisterInfo->BaseGpeNumber, - GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1), + (unsigned int) (GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1)), StatusReg, EnableReg, GpeRegisterInfo->EnableForRun, GpeRegisterInfo->EnableForWake)); diff --git a/source/components/executer/exdump.c b/source/components/executer/exdump.c index a09d779..e46eb3b 100644 --- a/source/components/executer/exdump.c +++ b/source/components/executer/exdump.c @@ -671,7 +671,7 @@ AcpiExDumpOperand ( if (Depth > 0) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p ", - Depth, " ", Depth, ObjDesc)); + (int) Depth, " ", Depth, ObjDesc)); } else { diff --git a/source/components/executer/exfldio.c b/source/components/executer/exfldio.c index c5d9399..53c7cea 100644 --- a/source/components/executer/exfldio.c +++ b/source/components/executer/exfldio.c @@ -681,8 +681,8 @@ AcpiExWriteWithUpdateRule ( ACPI_ERROR ((AE_INFO, "Unknown UpdateRule value: 0x%X", - (ObjDesc->CommonField.FieldFlags & - AML_FIELD_UPDATE_RULE_MASK))); + (unsigned int) (ObjDesc->CommonField.FieldFlags & + AML_FIELD_UPDATE_RULE_MASK))); return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } } diff --git a/source/components/executer/exnames.c b/source/components/executer/exnames.c index f679de6..8874f4b 100644 --- a/source/components/executer/exnames.c +++ b/source/components/executer/exnames.c @@ -240,7 +240,7 @@ AcpiExNameSegment ( */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Leading character is not alpha: %02Xh (not a name)\n", - CharBuf[0])); + (unsigned int) CharBuf[0])); Status = AE_CTRL_PENDING; } else @@ -252,7 +252,7 @@ AcpiExNameSegment ( Status = AE_AML_BAD_NAME; ACPI_ERROR ((AE_INFO, "Bad character 0x%02x in name, at %p", - *AmlAddress, AmlAddress)); + (unsigned int) (*AmlAddress), AmlAddress)); } *InAmlAddress = ACPI_CAST_PTR (UINT8, AmlAddress); diff --git a/source/components/hardware/hwregs.c b/source/components/hardware/hwregs.c index d7ef3ca..1d3de44 100644 --- a/source/components/hardware/hwregs.c +++ b/source/components/hardware/hwregs.c @@ -300,7 +300,7 @@ AcpiHwClearAcpiStatus ( ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %8.8X%8.8X\n", - ACPI_BITMASK_ALL_FIXED_STATUS, + (UINT32) ACPI_BITMASK_ALL_FIXED_STATUS, ACPI_FORMAT_UINT64 (AcpiGbl_XPm1aStatus.Address))); LockFlags = AcpiOsAcquireLock (AcpiGbl_HardwareLock); diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c index bfb80e5..0e6e793 100644 --- a/source/components/tables/tbfadt.c +++ b/source/components/tables/tbfadt.c @@ -233,7 +233,7 @@ AcpiTbInitGenericAddress ( if (!(Flags & ACPI_FADT_GPE_REGISTER)) { ACPI_ERROR ((AE_INFO, - "%s - 32-bit FADT register is too long (%u bytes, %u bits) " + "%s - 32-bit FADT register is too long (%u bytes, %d bits) " "to convert to GAS struct - 255 bits max, truncating", RegisterName, ByteWidth, (ByteWidth * 8))); } @@ -304,7 +304,7 @@ AcpiTbSelectAddress ( ACPI_BIOS_WARNING ((AE_INFO, "32/64X %s address mismatch in FADT: " - "0x%8.8X/0x%8.8X%8.8X, using %u-bit address", + "0x%8.8X/0x%8.8X%8.8X, using %d-bit address", RegisterName, Address32, ACPI_FORMAT_UINT64 (Address64), AcpiGbl_Use32BitFadtAddresses ? 32 : 64)); @@ -617,7 +617,7 @@ AcpiTbConvertFadt ( ACPI_BIOS_WARNING ((AE_INFO, "32/64X address mismatch in FADT/%s: " - "0x%8.8X/0x%8.8X%8.8X, using %u-bit address", + "0x%8.8X/0x%8.8X%8.8X, using %d-bit address", Name, Address32, ACPI_FORMAT_UINT64 (Address64->Address), AcpiGbl_Use32BitFadtAddresses ? 32 : 64)); diff --git a/source/components/tables/tbxfroot.c b/source/components/tables/tbxfroot.c index 455f133..0a287bc 100644 --- a/source/components/tables/tbxfroot.c +++ b/source/components/tables/tbxfroot.c @@ -177,7 +177,7 @@ AcpiFindRootPointer ( { ACPI_ERROR ((AE_INFO, "Could not map memory at 0x%8.8X for length %u", - ACPI_EBDA_PTR_LOCATION, ACPI_EBDA_PTR_LENGTH)); + (UINT32) ACPI_EBDA_PTR_LOCATION, (UINT32) ACPI_EBDA_PTR_LENGTH)); return_ACPI_STATUS (AE_NO_MEMORY); } @@ -204,7 +204,7 @@ AcpiFindRootPointer ( { ACPI_ERROR ((AE_INFO, "Could not map memory at 0x%8.8X for length %u", - PhysicalAddress, ACPI_EBDA_WINDOW_SIZE)); + PhysicalAddress, (UINT32) ACPI_EBDA_WINDOW_SIZE)); return_ACPI_STATUS (AE_NO_MEMORY); } @@ -236,7 +236,7 @@ AcpiFindRootPointer ( { ACPI_ERROR ((AE_INFO, "Could not map memory at 0x%8.8X for length %u", - ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE)); + (UINT32) ACPI_HI_RSDP_WINDOW_BASE, (UINT32) ACPI_HI_RSDP_WINDOW_SIZE)); return_ACPI_STATUS (AE_NO_MEMORY); } diff --git a/source/components/utilities/utownerid.c b/source/components/utilities/utownerid.c index dc3922a..ed0aa63 100644 --- a/source/components/utilities/utownerid.c +++ b/source/components/utilities/utownerid.c @@ -231,7 +231,7 @@ AcpiUtReleaseOwnerId ( else { ACPI_ERROR ((AE_INFO, - "Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1)); + "Release of non-allocated OwnerId: 0x%2.2X", (UINT32) OwnerId + 1)); } (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index a5f168c..f680b41 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -205,7 +205,7 @@ AeDoOptions ( if (strlen (AcpiGbl_Optarg) > (AE_BUFFER_SIZE -1)) { - printf ("**** The length of command line (%u) exceeded maximum (%u)\n", + printf ("**** The length of command line (%u) exceeded maximum (%d)\n", (UINT32) strlen (AcpiGbl_Optarg), (AE_BUFFER_SIZE -1)); return (-1); }