Al Stone 938de5
Index: src/tests/aapits/atexec.c
Al Stone 938de5
===================================================================
Al Stone 938de5
--- src.orig/tests/aapits/atexec.c
Al Stone 938de5
+++ src/tests/aapits/atexec.c
Al Stone 938de5
@@ -639,6 +639,7 @@ AtBuildLocalFADT2 (
Al Stone afae4e
 }
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone afae4e
+#if ACPI_MACHINE_WIDTH == 32
Al Stone afae4e
 /*******************************************************************************
Al Stone afae4e
  *
Al Stone afae4e
  * FUNCTION:    AtBuildLocalRSDT
Al Stone 938de5
@@ -757,6 +758,7 @@ AtBuildLocalRSDT (
Al Stone afae4e
         LocalRSDT->Header.Checksum = (UINT8)~LocalRSDT->Header.Checksum;
Al Stone afae4e
     }
Al Stone afae4e
 }
Al Stone afae4e
+#endif
Al Stone afae4e
 
Al Stone afae4e
 
Al Stone afae4e
 /*******************************************************************************
Al Stone 938de5
@@ -1424,7 +1426,7 @@ AeRegionHandler (
Al Stone afae4e
         ACPI_WARNING ((AE_INFO,
Al Stone afae4e
             "Request on [%4.4s] is beyond region limit Req-%X+%X, Base=%X, Len-%X\n",
Al Stone afae4e
             (RegionObject->Region.Node)->Name.Ascii, (UINT32) Address,
Al Stone afae4e
-            ByteWidth, (UINT32) BufferAddress, Length));
Al Stone afae4e
+            ByteWidth, (UINT32) BufferAddress, (UINT32) Length));
Al Stone afae4e
 
Al Stone afae4e
         return (AE_AML_REGION_LIMIT);
Al Stone afae4e
     }
Al Stone 938de5
@@ -1799,7 +1801,9 @@ AtCheckInteger(
Al Stone afae4e
             Path, Obj.Integer.Value, Value);
Al Stone afae4e
 #else
Al Stone afae4e
         printf ("API Error: Value of %s is 0x%llx instead of expected 0x%llx\n",
Al Stone afae4e
-            Path, Obj.Integer.Value, Value);
Al Stone afae4e
+            Path,
Al Stone afae4e
+	    (long long unsigned int) Obj.Integer.Value,
Al Stone afae4e
+	    (long long unsigned int) Value);
Al Stone afae4e
 #endif
Al Stone afae4e
         Status = AE_ERROR;
Al Stone afae4e
     }
Al Stone 938de5
@@ -1878,7 +1882,7 @@ AtCheckString(
Al Stone afae4e
     {
Al Stone afae4e
         TestErrors++;
Al Stone afae4e
         printf ("Test Error: cannot allocate buffer of %d bytes\n",
Al Stone afae4e
-            Results.Length);
Al Stone afae4e
+                (int) Results.Length);
Al Stone afae4e
         return (AE_NO_MEMORY);
Al Stone afae4e
     }
Al Stone afae4e
     Results.Pointer = Object;
Al Stone 938de5
@@ -1959,7 +1963,8 @@ AtCheckBuffer(
Al Stone afae4e
     {
Al Stone afae4e
         printf ("AtCheckBuffer: unexpected length %d of Buffer vs"
Al Stone afae4e
             " calculated %d bytes\n",
Al Stone afae4e
-            Results.Length, ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof (ACPI_OBJECT) + Length));
Al Stone afae4e
+            (int)Results.Length,
Al Stone afae4e
+	    (int)(ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof (ACPI_OBJECT) + Length)));
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
     /* Initialize the return buffer structure */
Al Stone 938de5
@@ -1968,7 +1973,7 @@ AtCheckBuffer(
Al Stone afae4e
     {
Al Stone afae4e
         TestErrors++;
Al Stone afae4e
         printf ("Test Error: cannot allocate buffer of %d bytes\n",
Al Stone afae4e
-            Results.Length);
Al Stone afae4e
+            (int) Results.Length);
Al Stone afae4e
         return (AE_NO_MEMORY);
Al Stone afae4e
     }
Al Stone afae4e
     Results.Pointer = Object;
Al Stone 938de5
Index: src/tests/aapits/atinit.c
Al Stone 938de5
===================================================================
Al Stone 938de5
--- src.orig/tests/aapits/atinit.c
Al Stone 938de5
+++ src/tests/aapits/atinit.c
Al Stone 938de5
@@ -3024,7 +3024,7 @@ AtInitTest0041(void)
Al Stone afae4e
             AapiErrors++;
Al Stone afae4e
             printf ("API Error: AcpiGetSystemInfo() returned"
Al Stone afae4e
                 " Length %d, expected %d\n",
Al Stone afae4e
-                OutBuffer.Length, sizeof (Info));
Al Stone afae4e
+                (int) OutBuffer.Length, (int) sizeof (Info));
Al Stone afae4e
             return (AE_ERROR);
Al Stone afae4e
         }
Al Stone afae4e
 
Al Stone 938de5
@@ -3046,7 +3046,7 @@ AtInitTest0041(void)
Al Stone afae4e
             AapiErrors++;
Al Stone afae4e
             printf ("API Error: AcpiGetSystemInfo() returned"
Al Stone afae4e
                 " Length %d, expected %d\n",
Al Stone afae4e
-                OutBuffer.Length, sizeof (Info));
Al Stone afae4e
+                (int) OutBuffer.Length, (int) sizeof (Info));
Al Stone afae4e
             return (AE_ERROR);
Al Stone afae4e
         }
Al Stone afae4e
 
Al Stone 938de5
@@ -3066,7 +3066,7 @@ AtInitTest0041(void)
Al Stone afae4e
             AapiErrors++;
Al Stone afae4e
             printf ("API Error: AcpiGetSystemInfo() returned"
Al Stone afae4e
                 " Length %d, expected %d\n",
Al Stone afae4e
-                OutBuffer.Length, sizeof (Info));
Al Stone afae4e
+                (int) OutBuffer.Length, (int) sizeof (Info));
Al Stone afae4e
             return (AE_ERROR);
Al Stone afae4e
         }
Al Stone afae4e
         else if (OutBuffer.Pointer != &Info)
Al Stone 938de5
@@ -3149,7 +3149,7 @@ AtInitTest0042(void)
Al Stone afae4e
             AapiErrors++;
Al Stone afae4e
             printf ("API Error: AcpiGetSystemInfo() returned"
Al Stone afae4e
                 " Length %d, expected %d\n",
Al Stone afae4e
-                OutBuffer.Length, sizeof (Info));
Al Stone afae4e
+                (int) OutBuffer.Length, (int) sizeof (Info));
Al Stone afae4e
             return (AE_ERROR);
Al Stone afae4e
         }
Al Stone afae4e
         else if (OutBuffer.Pointer != &Info)
Al Stone 938de5
@@ -3214,7 +3214,7 @@ AtInitTest0043(void)
Al Stone afae4e
             AapiErrors++;
Al Stone afae4e
             printf ("API Error: AcpiGetSystemInfo() returned"
Al Stone afae4e
                 " Length %d, expected %d\n",
Al Stone afae4e
-                OutBuffer.Length, sizeof (ACPI_SYSTEM_INFO));
Al Stone afae4e
+                (int) OutBuffer.Length, (int) sizeof (ACPI_SYSTEM_INFO));
Al Stone afae4e
             return (AE_ERROR);
Al Stone afae4e
         }
Al Stone afae4e
         else
Al Stone 938de5
Index: src/tests/aapits/atmain.c
Al Stone 938de5
===================================================================
Al Stone 938de5
--- src.orig/tests/aapits/atmain.c
Al Stone 938de5
+++ src/tests/aapits/atmain.c
Al Stone 938de5
@@ -345,7 +345,7 @@ ExecuteTest (
Al Stone afae4e
     {
Al Stone afae4e
         printf ("ACPICA API TS err: test num %ld of test case %ld"
Al Stone afae4e
             " is not implemented\n",
Al Stone afae4e
-            test_num, test_case);
Al Stone afae4e
+            (long int) test_num, (long int) test_case);
Al Stone afae4e
         return (AtRetNotImpl);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone 938de5
@@ -460,7 +460,7 @@ main(
Al Stone afae4e
     if (test_case < 1 || test_case > AT_TEST_CASE_NUM)
Al Stone afae4e
     {
Al Stone afae4e
         printf ("ACPICA API TS err: test case %ld is out of range 1 - %d\n",
Al Stone afae4e
-            test_case, AT_TEST_CASE_NUM);
Al Stone afae4e
+            (long int) test_case, (int) AT_TEST_CASE_NUM);
Al Stone afae4e
         return (AtRetBadParam);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone 938de5
@@ -468,7 +468,7 @@ main(
Al Stone afae4e
     if (test_num < 0 || test_num > AtTestCase[test_case].TestsNum)
Al Stone afae4e
     {
Al Stone afae4e
         printf ("ACPICA API TS err: test num %ld is out of range 0 - %d\n",
Al Stone afae4e
-            test_num, AtTestCase[test_case].TestsNum);
Al Stone afae4e
+            (long int) test_num, AtTestCase[test_case].TestsNum);
Al Stone afae4e
         return (AtRetBadParam);
Al Stone afae4e
     }
Al Stone 938de5
 
Al Stone 938de5
Index: src/tests/aapits/atnamespace.c
Al Stone 938de5
===================================================================
Al Stone 938de5
--- src.orig/tests/aapits/atnamespace.c
Al Stone 938de5
+++ src/tests/aapits/atnamespace.c
Al Stone 938de5
@@ -2535,7 +2535,8 @@ AtGetObjectInfoTypeCommon(
Al Stone afae4e
 #else
Al Stone afae4e
                 printf ("API Error: Address of %s (0x%llX) != (0x%llX)\n",
Al Stone afae4e
                     PathNames[2 * i + 1],
Al Stone afae4e
-                    Info->Address, ExpectedInfo[i].Address);
Al Stone afae4e
+                    (long long unsigned int) Info->Address,
Al Stone afae4e
+		    (long long unsigned int) ExpectedInfo[i].Address);
Al Stone afae4e
 #endif
Al Stone afae4e
 #else
Al Stone afae4e
                 printf ("API Error: Address of %s (0x%X) != (0x%X)\n",
Al Stone 938de5
@@ -2908,7 +2909,8 @@ AtGetNextObjectTypeCommon(
Al Stone afae4e
         TestErrors++;
Al Stone afae4e
         printf ("AtGetNextObjectTypeCommon: different numbers of entities"
Al Stone afae4e
             "in TypesNames (%d) and LevelTypes0000 (%d)\n",
Al Stone afae4e
-            TypesCount, sizeof (LevelTypes0000) / sizeof (ACPI_OBJECT_TYPE));
Al Stone afae4e
+            TypesCount,
Al Stone afae4e
+	    (int) (sizeof (LevelTypes0000) / sizeof (ACPI_OBJECT_TYPE)));
Al Stone afae4e
         return (AE_ERROR);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone 938de5
@@ -4192,7 +4194,9 @@ AtCheckHandlePathMapping(
Al Stone afae4e
             Pathname, Obj.Integer.Value, Value);
Al Stone afae4e
 #else
Al Stone afae4e
         printf ("API Error: Value of %s is 0x%llx instead of expected 0x%llx\n",
Al Stone afae4e
-            Pathname, Obj.Integer.Value, Value);
Al Stone afae4e
+            Pathname,
Al Stone afae4e
+	    (long long unsigned int) Obj.Integer.Value,
Al Stone afae4e
+	    (long long unsigned int) Value);
Al Stone afae4e
 #endif
Al Stone afae4e
         Status = AE_ERROR;
Al Stone afae4e
     }
Al Stone 938de5
@@ -5199,7 +5203,7 @@ AtGetNameExceptionTest(
Al Stone afae4e
             {
Al Stone afae4e
                 AapiErrors++;
Al Stone afae4e
                 printf ("API Error: AcpiOsAllocate(%d) returned NULL\n",
Al Stone afae4e
-                    OutName.Length);
Al Stone afae4e
+                    (int) OutName.Length);
Al Stone afae4e
                 return (AE_ERROR);
Al Stone afae4e
             }
Al Stone afae4e
         }
Al Stone 938de5
Index: src/tests/aapits/atosxfctrl.c
Al Stone 938de5
===================================================================
Al Stone 938de5
--- src.orig/tests/aapits/atosxfctrl.c
Al Stone 938de5
+++ src/tests/aapits/atosxfctrl.c
Al Stone 938de5
@@ -737,13 +737,15 @@ ACPI_OSXF_EMUL_REG
Al Stone afae4e
 #if ACPI_MACHINE_WIDTH == 64
Al Stone afae4e
 #ifdef    _MSC_VER
Al Stone afae4e
         printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%I64x\n",
Al Stone afae4e
+            Width, Address);
Al Stone afae4e
 #else
Al Stone afae4e
         printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%llx\n",
Al Stone afae4e
+            Width, (long long unsigned int) Address);
Al Stone afae4e
 #endif
Al Stone afae4e
 #else
Al Stone afae4e
         printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%x\n",
Al Stone afae4e
-#endif
Al Stone afae4e
             Width, Address);
Al Stone afae4e
+#endif
Al Stone afae4e
         return (NULL);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone 938de5
@@ -764,15 +766,19 @@ ACPI_OSXF_EMUL_REG
Al Stone afae4e
 #ifdef    _MSC_VER
Al Stone afae4e
                 printf("OsxfCtrlFingReg: intersection Regs (0x%I64x: 0x%x)"
Al Stone afae4e
                     " and (0x%I64x: 0x%x)\n",
Al Stone afae4e
+                    Reg->Address, Reg->Width, Address, Width);
Al Stone afae4e
 #else
Al Stone afae4e
                 printf("OsxfCtrlFingReg: intersection Regs (0x%llx: 0x%x)"
Al Stone afae4e
                     " and (0x%llx: 0x%x)\n",
Al Stone afae4e
+                    (long long unsigned int) Reg->Address,
Al Stone afae4e
+		    Reg->Width,
Al Stone afae4e
+		    (long long unsigned int) Address, Width);
Al Stone afae4e
 #endif
Al Stone afae4e
 #else
Al Stone afae4e
                 printf("OsxfCtrlFingReg: intersection Regs (0x%x: 0x%x)"
Al Stone afae4e
                     " and (0x%x: 0x%x)\n",
Al Stone afae4e
-#endif
Al Stone afae4e
                     Reg->Address, Reg->Width, Address, Width);
Al Stone afae4e
+#endif
Al Stone afae4e
                 return (NULL);
Al Stone afae4e
             }
Al Stone afae4e
         }
Al Stone 938de5
@@ -786,13 +792,15 @@ ACPI_OSXF_EMUL_REG
Al Stone afae4e
 #if ACPI_MACHINE_WIDTH == 64
Al Stone afae4e
 #ifdef    _MSC_VER
Al Stone afae4e
             printf("OsxfCtrlFingReg: no memory for Reg (0x%I64x: 0x%x)\n",
Al Stone afae4e
+                Reg->Address, Reg->Width);
Al Stone afae4e
 #else
Al Stone afae4e
             printf("OsxfCtrlFingReg: no memory for Reg (0x%llx: 0x%x)\n",
Al Stone afae4e
+                (long long unsigned int) Reg->Address, Reg->Width);
Al Stone afae4e
 #endif
Al Stone afae4e
 #else
Al Stone afae4e
             printf("OsxfCtrlFingReg: no memory for Reg (0x%x: 0x%x)\n",
Al Stone afae4e
-#endif
Al Stone afae4e
                 Reg->Address, Reg->Width);
Al Stone afae4e
+#endif
Al Stone afae4e
             return (NULL);
Al Stone afae4e
         }
Al Stone afae4e
         Reg->Type = Type;
Al Stone 938de5
@@ -932,14 +940,19 @@ OsxfCtrlRegService(UINT32 ServiceFlag)
Al Stone afae4e
 #if ACPI_MACHINE_WIDTH == 64
Al Stone afae4e
 #ifdef    _MSC_VER
Al Stone afae4e
             printf("%.2u (%s Address 0x%I64x: Width %.2u) r/w counts: %u/%u\n",
Al Stone afae4e
+                i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO",
Al Stone afae4e
+                Reg->Address, Reg->Width, Reg->ReadCount, Reg->WriteCount);
Al Stone afae4e
 #else
Al Stone afae4e
             printf("%.2u (%s Address 0x%llx: Width %.2u) r/w counts: %u/%u\n",
Al Stone afae4e
+                i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO",
Al Stone afae4e
+                (long long unsigned int) Reg->Address,
Al Stone afae4e
+		Reg->Width, Reg->ReadCount, Reg->WriteCount);
Al Stone afae4e
 #endif
Al Stone afae4e
 #else
Al Stone afae4e
             printf("%.2u (%s Address 0x%.4x: Width %.2u) r/w counts: %u/%u\n",
Al Stone afae4e
-#endif
Al Stone afae4e
                 i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO",
Al Stone afae4e
                 Reg->Address, Reg->Width, Reg->ReadCount, Reg->WriteCount);
Al Stone afae4e
+#endif
Al Stone afae4e
             Reg = Reg->Next;
Al Stone afae4e
             i++;
Al Stone afae4e
         }
Al Stone 938de5
Index: src/tests/aapits/atresource.c
Al Stone 938de5
===================================================================
Al Stone 938de5
--- src.orig/tests/aapits/atresource.c
Al Stone 938de5
+++ src/tests/aapits/atresource.c
Al Stone 938de5
@@ -174,7 +174,7 @@ AtRsrcTest0000(void)
Al Stone afae4e
         AapiErrors++;
Al Stone afae4e
         printf ("API Error: AcpiGetCurrentResources(%s) returned Length %d,"
Al Stone afae4e
             " expected %d\n",
Al Stone afae4e
-            Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN);
Al Stone afae4e
+            Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN);
Al Stone afae4e
         return (AE_ERROR);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone 938de5
@@ -490,7 +490,7 @@ AtRsrcTest0005(void)
Al Stone afae4e
         AapiErrors++;
Al Stone afae4e
         printf ("API Error: AcpiGetCurrentResources(%s) returned Length %d,"
Al Stone afae4e
             " expected %d\n",
Al Stone afae4e
-            Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN);
Al Stone afae4e
+            Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN);
Al Stone afae4e
         return (AE_ERROR);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone 938de5
@@ -689,7 +689,7 @@ AtRsrcTest0007(void)
Al Stone afae4e
         AapiErrors++;
Al Stone afae4e
         printf ("Api Error: Resource->Length (%d) != %d\n",
Al Stone afae4e
             CurrentResource->Length,
Al Stone afae4e
-            ACPI_ROUND_UP_TO_NATIVE_WORD (ACPI_RS_SIZE (ACPI_RESOURCE_IRQ)));
Al Stone afae4e
+            (int) (ACPI_ROUND_UP_TO_NATIVE_WORD (ACPI_RS_SIZE (ACPI_RESOURCE_IRQ))));
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone afae4e
     if (CurrentResource->Data.Irq.Triggering != 0) /* Level-Triggered */
Al Stone 938de5
@@ -981,7 +981,7 @@ AtRsrcTest0012(void)
Al Stone afae4e
         AapiErrors++;
Al Stone afae4e
         printf ("API Error: AcpiGetPossibleResources(%s) returned Length %d,"
Al Stone afae4e
             " expected %d\n",
Al Stone afae4e
-            Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN);
Al Stone afae4e
+            Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN);
Al Stone afae4e
         return (AE_ERROR);
Al Stone afae4e
     }
Al Stone afae4e
 
Al Stone 938de5
@@ -1923,7 +1923,7 @@ AtRsrcTest0026(void)
Al Stone afae4e
         AapiErrors++;
Al Stone afae4e
         printf ("API Error: AcpiGetIrqRoutingTable(%s) returned Length %d,"
Al Stone afae4e
             " expected %d\n",
Al Stone afae4e
-            Pathname, OutBuffer.Length, 0xA48);
Al Stone afae4e
+            Pathname, (int) OutBuffer.Length, 0xA48);
Al Stone afae4e
         return (AE_ERROR);
Al Stone afae4e
     }
Al Stone afae4e