4496ab
Use proper integer formatting
4496ab
4496ab
From: Al Stone <ahs3@redhat.com>
4496ab
4496ab
4496ab
---
4496ab
 source/compiler/aslcompile.c            |    2 +-
4496ab
 source/compiler/aslerror.c              |    4 ++--
4496ab
 source/compiler/aslopt.c                |    2 +-
4496ab
 source/compiler/aslpredef.c             |    2 +-
4496ab
 source/compiler/aslprepkg.c             |    2 +-
4496ab
 source/components/debugger/dbexec.c     |    2 +-
4496ab
 source/components/dispatcher/dsmthdat.c |    4 ++--
4496ab
 source/components/dispatcher/dsutils.c  |    2 +-
4496ab
 source/components/dispatcher/dswscope.c |    4 ++--
4496ab
 source/components/events/evgpe.c        |    4 ++--
4496ab
 source/components/executer/exdump.c     |    2 +-
4496ab
 source/components/executer/exfldio.c    |    4 ++--
4496ab
 source/components/executer/exnames.c    |    4 ++--
4496ab
 source/components/hardware/hwregs.c     |    2 +-
4496ab
 source/components/tables/tbfadt.c       |    6 +++---
4496ab
 source/components/tables/tbxfroot.c     |    6 +++---
4496ab
 source/components/utilities/utownerid.c |    2 +-
4496ab
 source/tools/acpiexec/aemain.c          |    2 +-
4496ab
 18 files changed, 28 insertions(+), 28 deletions(-)
4496ab
4496ab
Index: acpica-unix2-20180531/source/compiler/aslcompile.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/compiler/aslcompile.c
4496ab
+++ acpica-unix2-20180531/source/compiler/aslcompile.c
4496ab
@@ -750,7 +750,7 @@ CmCleanupAndExit (
4496ab
 
4496ab
     if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
4496ab
     {
4496ab
-        printf ("\nMaximum error count (%u) exceeded\n",
4496ab
+        printf ("\nMaximum error count (%d) exceeded\n",
4496ab
             ASL_MAX_ERROR_COUNT);
4496ab
     }
4496ab
 
4496ab
Index: acpica-unix2-20180531/source/compiler/aslerror.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/compiler/aslerror.c
4496ab
+++ acpica-unix2-20180531/source/compiler/aslerror.c
4496ab
@@ -880,7 +880,7 @@ AslLogNewError (
4496ab
     Gbl_ExceptionCount[Level]++;
4496ab
     if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
4496ab
     {
4496ab
-        printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT);
4496ab
+        printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT);
4496ab
 
4496ab
         Gbl_SourceLine = 0;
4496ab
         Gbl_NextError = Gbl_ErrorLog;
4496ab
@@ -1036,7 +1036,7 @@ AslDisableException (
4496ab
 
4496ab
     if (Gbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES)
4496ab
     {
4496ab
-        printf ("Too many messages have been disabled (max %u)\n",
4496ab
+        printf ("Too many messages have been disabled (max %d)\n",
4496ab
             ASL_MAX_DISABLED_MESSAGES);
4496ab
         return (AE_LIMIT);
4496ab
     }
4496ab
Index: acpica-unix2-20180531/source/compiler/aslopt.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/compiler/aslopt.c
4496ab
+++ acpica-unix2-20180531/source/compiler/aslopt.c
4496ab
@@ -584,7 +584,7 @@ OptOptimizeNamePath (
4496ab
     }
4496ab
 
4496ab
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
4496ab
-        "PATH OPTIMIZE: Line %5d ParentOp [%12.12s] ThisOp [%12.12s] ",
4496ab
+        "PATH OPTIMIZE: Line %5u ParentOp [%12.12s] ThisOp [%12.12s] ",
4496ab
         Op->Asl.LogicalLineNumber,
4496ab
         AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode),
4496ab
         AcpiPsGetOpcodeName (Op->Common.AmlOpcode)));
4496ab
Index: acpica-unix2-20180531/source/compiler/aslpredef.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/compiler/aslpredef.c
4496ab
+++ acpica-unix2-20180531/source/compiler/aslpredef.c
4496ab
@@ -114,7 +114,7 @@ ApCheckForPredefinedMethod (
4496ab
 
4496ab
         if (MethodInfo->NumArguments != 0)
4496ab
         {
4496ab
-            sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0);
4496ab
+            sprintf (MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0);
4496ab
 
4496ab
             AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
4496ab
                 MsgBuffer);
4496ab
Index: acpica-unix2-20180531/source/compiler/aslprepkg.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/compiler/aslprepkg.c
4496ab
+++ acpica-unix2-20180531/source/compiler/aslprepkg.c
4496ab
@@ -309,7 +309,7 @@ ApCheckPackage (
4496ab
 
4496ab
         if (Count & 1)
4496ab
         {
4496ab
-            sprintf (MsgBuffer, "%4.4s: Package length, %d, must be even.",
4496ab
+            sprintf (MsgBuffer, "%4.4s: Package length, %u, must be even.",
4496ab
                 Predefined->Info.Name, Count);
4496ab
 
4496ab
             AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH,
4496ab
Index: acpica-unix2-20180531/source/components/debugger/dbexec.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/debugger/dbexec.c
4496ab
+++ acpica-unix2-20180531/source/components/debugger/dbexec.c
4496ab
@@ -230,7 +230,7 @@ AcpiDbExecuteMethod (
4496ab
             ACPI_ERROR ((AE_INFO,
4496ab
                 "Possible overflow of internal debugger "
4496ab
                 "buffer (size 0x%X needed 0x%X)",
4496ab
-                ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
4496ab
+                (UINT32) ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
4496ab
         }
4496ab
     }
4496ab
 
4496ab
Index: acpica-unix2-20180531/source/components/dispatcher/dsmthdat.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/dispatcher/dsmthdat.c
4496ab
+++ acpica-unix2-20180531/source/components/dispatcher/dsmthdat.c
4496ab
@@ -291,7 +291,7 @@ AcpiDsMethodDataGetNode (
4496ab
         if (Index > ACPI_METHOD_MAX_LOCAL)
4496ab
         {
4496ab
             ACPI_ERROR ((AE_INFO,
4496ab
-                "Local index %u is invalid (max %u)",
4496ab
+                "Local index %u is invalid (max %d)",
4496ab
                 Index, ACPI_METHOD_MAX_LOCAL));
4496ab
             return_ACPI_STATUS (AE_AML_INVALID_INDEX);
4496ab
         }
4496ab
@@ -306,7 +306,7 @@ AcpiDsMethodDataGetNode (
4496ab
         if (Index > ACPI_METHOD_MAX_ARG)
4496ab
         {
4496ab
             ACPI_ERROR ((AE_INFO,
4496ab
-                "Arg index %u is invalid (max %u)",
4496ab
+                "Arg index %u is invalid (max %d)",
4496ab
                 Index, ACPI_METHOD_MAX_ARG));
4496ab
             return_ACPI_STATUS (AE_AML_INVALID_INDEX);
4496ab
         }
4496ab
Index: acpica-unix2-20180531/source/components/dispatcher/dsutils.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/dispatcher/dsutils.c
4496ab
+++ acpica-unix2-20180531/source/components/dispatcher/dsutils.c
4496ab
@@ -788,7 +788,7 @@ AcpiDsCreateOperands (
4496ab
     }
4496ab
 
4496ab
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
4496ab
-        "NumOperands %d, ArgCount %d, Index %d\n",
4496ab
+        "NumOperands %d, ArgCount %u, Index %u\n",
4496ab
         WalkState->NumOperands, ArgCount, Index));
4496ab
 
4496ab
     /* Create the interpreter arguments, in reverse order */
4496ab
Index: acpica-unix2-20180531/source/components/dispatcher/dswscope.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/dispatcher/dswscope.c
4496ab
+++ acpica-unix2-20180531/source/components/dispatcher/dswscope.c
4496ab
@@ -149,7 +149,7 @@ AcpiDsScopeStackPush (
4496ab
     WalkState->ScopeDepth++;
4496ab
 
4496ab
     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
4496ab
-        "[%.2d] Pushed scope ", (UINT32) WalkState->ScopeDepth));
4496ab
+        "[%.2d] Pushed scope ", WalkState->ScopeDepth));
4496ab
 
4496ab
     OldScopeInfo = WalkState->ScopeInfo;
4496ab
     if (OldScopeInfo)
4496ab
@@ -211,7 +211,7 @@ AcpiDsScopeStackPop (
4496ab
     WalkState->ScopeDepth--;
4496ab
 
4496ab
     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
4496ab
-        "[%.2d] Popped scope [%4.4s] (%s), New scope -> ",
4496ab
+        "[%.2u] Popped scope [%4.4s] (%s), New scope -> ",
4496ab
         (UINT32) WalkState->ScopeDepth,
4496ab
         AcpiUtGetNodeName (ScopeInfo->Scope.Node),
4496ab
         AcpiUtGetTypeName (ScopeInfo->Common.Value)));
4496ab
Index: acpica-unix2-20180531/source/components/events/evgpe.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/events/evgpe.c
4496ab
+++ acpica-unix2-20180531/source/components/events/evgpe.c
4496ab
@@ -481,7 +481,7 @@ AcpiEvGpeDetect (
4496ab
                     "Ignore disabled registers for GPE %02X-%02X: "
4496ab
                     "RunEnable=%02X, WakeEnable=%02X\n",
4496ab
                     GpeRegisterInfo->BaseGpeNumber,
4496ab
-                    GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
4496ab
+                    (unsigned int) (GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1)),
4496ab
                     GpeRegisterInfo->EnableForRun,
4496ab
                     GpeRegisterInfo->EnableForWake));
4496ab
                 continue;
4496ab
Index: acpica-unix2-20180531/source/components/executer/exdump.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/executer/exdump.c
4496ab
+++ acpica-unix2-20180531/source/components/executer/exdump.c
4496ab
@@ -678,7 +678,7 @@ AcpiExDumpOperand (
4496ab
     if (Depth > 0)
4496ab
     {
4496ab
         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p Refs=%u ",
4496ab
-            Depth, " ", Depth, ObjDesc, ObjDesc->Common.ReferenceCount));
4496ab
+            (int) Depth, " ", Depth, ObjDesc, ObjDesc->Common.ReferenceCount));
4496ab
     }
4496ab
     else
4496ab
     {
4496ab
Index: acpica-unix2-20180531/source/components/executer/exfldio.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/executer/exfldio.c
4496ab
+++ acpica-unix2-20180531/source/components/executer/exfldio.c
4496ab
@@ -681,8 +681,8 @@ AcpiExWriteWithUpdateRule (
4496ab
 
4496ab
             ACPI_ERROR ((AE_INFO,
4496ab
                 "Unknown UpdateRule value: 0x%X",
4496ab
-                (ObjDesc->CommonField.FieldFlags &
4496ab
-                    AML_FIELD_UPDATE_RULE_MASK)));
4496ab
+                (unsigned int) (ObjDesc->CommonField.FieldFlags &
4496ab
+                                   AML_FIELD_UPDATE_RULE_MASK)));
4496ab
             return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
4496ab
         }
4496ab
     }
4496ab
Index: acpica-unix2-20180531/source/components/executer/exnames.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/executer/exnames.c
4496ab
+++ acpica-unix2-20180531/source/components/executer/exnames.c
4496ab
@@ -237,7 +237,7 @@ AcpiExNameSegment (
4496ab
          */
4496ab
         ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
4496ab
             "Leading character is not alpha: %02Xh (not a name)\n",
4496ab
-            CharBuf[0]));
4496ab
+            (unsigned int) CharBuf[0]));
4496ab
         Status = AE_CTRL_PENDING;
4496ab
     }
4496ab
     else
4496ab
@@ -249,7 +249,7 @@ AcpiExNameSegment (
4496ab
         Status = AE_AML_BAD_NAME;
4496ab
         ACPI_ERROR ((AE_INFO,
4496ab
             "Bad character 0x%02x in name, at %p",
4496ab
-            *AmlAddress, AmlAddress));
4496ab
+            (unsigned int) (*AmlAddress), AmlAddress));
4496ab
     }
4496ab
 
4496ab
     *InAmlAddress = ACPI_CAST_PTR (UINT8, AmlAddress);
4496ab
Index: acpica-unix2-20180531/source/components/hardware/hwregs.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/hardware/hwregs.c
4496ab
+++ acpica-unix2-20180531/source/components/hardware/hwregs.c
4496ab
@@ -460,7 +460,7 @@ AcpiHwClearAcpiStatus (
4496ab
 
4496ab
 
4496ab
     ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %8.8X%8.8X\n",
4496ab
-        ACPI_BITMASK_ALL_FIXED_STATUS,
4496ab
+        (UINT32) ACPI_BITMASK_ALL_FIXED_STATUS,
4496ab
         ACPI_FORMAT_UINT64 (AcpiGbl_XPm1aStatus.Address)));
4496ab
 
4496ab
     LockFlags = AcpiOsAcquireLock (AcpiGbl_HardwareLock);
4496ab
Index: acpica-unix2-20180531/source/components/tables/tbfadt.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/tables/tbfadt.c
4496ab
+++ acpica-unix2-20180531/source/components/tables/tbfadt.c
4496ab
@@ -233,7 +233,7 @@ AcpiTbInitGenericAddress (
4496ab
         if (!(Flags & ACPI_FADT_GPE_REGISTER))
4496ab
         {
4496ab
             ACPI_ERROR ((AE_INFO,
4496ab
-                "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
4496ab
+                "%s - 32-bit FADT register is too long (%u bytes, %d bits) "
4496ab
                 "to convert to GAS struct - 255 bits max, truncating",
4496ab
                 RegisterName, ByteWidth, (ByteWidth * 8)));
4496ab
         }
4496ab
@@ -304,7 +304,7 @@ AcpiTbSelectAddress (
4496ab
 
4496ab
         ACPI_BIOS_WARNING ((AE_INFO,
4496ab
             "32/64X %s address mismatch in FADT: "
4496ab
-            "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
4496ab
+            "0x%8.8X/0x%8.8X%8.8X, using %d-bit address",
4496ab
             RegisterName, Address32, ACPI_FORMAT_UINT64 (Address64),
4496ab
             AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
4496ab
 
4496ab
@@ -628,7 +628,7 @@ AcpiTbConvertFadt (
4496ab
 
4496ab
                     ACPI_BIOS_WARNING ((AE_INFO,
4496ab
                         "32/64X address mismatch in FADT/%s: "
4496ab
-                        "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
4496ab
+                        "0x%8.8X/0x%8.8X%8.8X, using %d-bit address",
4496ab
                         Name, Address32,
4496ab
                         ACPI_FORMAT_UINT64 (Address64->Address),
4496ab
                         AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
4496ab
Index: acpica-unix2-20180531/source/components/tables/tbxfroot.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/tables/tbxfroot.c
4496ab
+++ acpica-unix2-20180531/source/components/tables/tbxfroot.c
4496ab
@@ -177,7 +177,7 @@ AcpiFindRootPointer (
4496ab
     {
4496ab
         ACPI_ERROR ((AE_INFO,
4496ab
             "Could not map memory at 0x%8.8X for length %u",
4496ab
-            ACPI_EBDA_PTR_LOCATION, ACPI_EBDA_PTR_LENGTH));
4496ab
+            (UINT32) ACPI_EBDA_PTR_LOCATION, (UINT32) ACPI_EBDA_PTR_LENGTH));
4496ab
 
4496ab
         return_ACPI_STATUS (AE_NO_MEMORY);
4496ab
     }
4496ab
@@ -204,7 +204,7 @@ AcpiFindRootPointer (
4496ab
         {
4496ab
             ACPI_ERROR ((AE_INFO,
4496ab
                 "Could not map memory at 0x%8.8X for length %u",
4496ab
-                PhysicalAddress, ACPI_EBDA_WINDOW_SIZE));
4496ab
+                PhysicalAddress, (UINT32) ACPI_EBDA_WINDOW_SIZE));
4496ab
 
4496ab
             return_ACPI_STATUS (AE_NO_MEMORY);
4496ab
         }
4496ab
@@ -236,7 +236,7 @@ AcpiFindRootPointer (
4496ab
     {
4496ab
         ACPI_ERROR ((AE_INFO,
4496ab
             "Could not map memory at 0x%8.8X for length %u",
4496ab
-            ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE));
4496ab
+            (UINT32) ACPI_HI_RSDP_WINDOW_BASE, (UINT32) ACPI_HI_RSDP_WINDOW_SIZE));
4496ab
 
4496ab
         return_ACPI_STATUS (AE_NO_MEMORY);
4496ab
     }
4496ab
Index: acpica-unix2-20180531/source/components/utilities/utownerid.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/components/utilities/utownerid.c
4496ab
+++ acpica-unix2-20180531/source/components/utilities/utownerid.c
4496ab
@@ -237,7 +237,7 @@ AcpiUtReleaseOwnerId (
4496ab
     else
4496ab
     {
4496ab
         ACPI_ERROR ((AE_INFO,
4496ab
-            "Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1));
4496ab
+            "Release of non-allocated OwnerId: 0x%2.2X", (UINT32) OwnerId + 1));
4496ab
     }
4496ab
 
4496ab
     (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
4496ab
Index: acpica-unix2-20180531/source/tools/acpiexec/aemain.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180531.orig/source/tools/acpiexec/aemain.c
4496ab
+++ acpica-unix2-20180531/source/tools/acpiexec/aemain.c
4496ab
@@ -209,7 +209,7 @@ AeDoOptions (
4496ab
 
4496ab
         if (strlen (AcpiGbl_Optarg) > (AE_BUFFER_SIZE -1))
4496ab
         {
4496ab
-            printf ("**** The length of command line (%u) exceeded maximum (%u)\n",
4496ab
+            printf ("**** The length of command line (%u) exceeded maximum (%d)\n",
4496ab
                 (UINT32) strlen (AcpiGbl_Optarg), (AE_BUFFER_SIZE -1));
4496ab
             return (-1);
4496ab
         }