]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tests: fix 64-bit int literals for 32-bit hosts
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 5 Nov 2013 16:42:48 +0000 (17:42 +0100)
committerAnthony Liguori <aliguori@amazon.com>
Wed, 6 Nov 2013 03:59:43 +0000 (19:59 -0800)
On 32-bit hosts:

  CC    tests/test-opts-visitor.o
tests/test-opts-visitor.c: In function 'test_value':
tests/test-opts-visitor.c:128: warning: integer constant is too large for 'long' type
  CC    tests/test-bitops.o
tests/test-bitops.c:34: warning: integer constant is too large for 'long' type
tests/test-bitops.c:35: warning: integer constant is too large for 'long' type
tests/test-bitops.c:35: warning: integer constant is too large for 'long' type
  CC    tests/endianness-test.o
tests/endianness-test.c:47: warning: integer constant is too large for 'long' type

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1383669768-23926-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
tests/endianness-test.c
tests/test-bitops.c
tests/test-opts-visitor.c

index feb32a85032f310a8dffaf0531e8757e7cd7861e..8719c0999cc33c08b71673099d957730c18cb2ff 100644 (file)
@@ -44,7 +44,8 @@ static const TestCase test_cases[] = {
     { "ppc", "prep", 0x80000000, .bswap = true },
     { "ppc", "bamboo", 0xe8000000, .bswap = true, .superio = "i82378" },
     { "ppc64", "mac99", 0xf2000000, .bswap = true, .superio = "i82378" },
-    { "ppc64", "pseries", 0x10080000000, .bswap = true, .superio = "i82378" },
+    { "ppc64", "pseries", 0x10080000000ULL,
+      .bswap = true, .superio = "i82378" },
     { "sh4", "r2d", 0xfe240000, .superio = "i82378" },
     { "sh4eb", "r2d", 0xfe240000, .bswap = true, .superio = "i82378" },
     { "sparc64", "sun4u", 0x1fe02000000LL, .bswap = true },
index 4e713e4e00c881148fdf4e3b0265742776e48f5d..8238eb5f6bbfeed9361ddb9fbe39020773e62dfa 100644 (file)
@@ -31,8 +31,8 @@ static const S32Test test_s32_data[] = {
 };
 
 static const S64Test test_s64_data[] = {
-    { 0x8459826734967223, 60, 4, -8 },
-    { 0x8459826734967223, 0, 64, 0x8459826734967223 },
+    { 0x8459826734967223ULL, 60, 4, -8 },
+    { 0x8459826734967223ULL, 0, 64, 0x8459826734967223LL },
 };
 
 static void test_sextract32(void)
index 9f902b597e2143f24e155d722e787821b8b2063a..ebeee5d5893362194be5c9e70997ec26fd429495 100644 (file)
@@ -125,7 +125,7 @@ test_value(OptsVisitorFixture *f, gconstpointer test_data)
         g_assert((magic & bitval) == 0);
         magic |= bitval;
     }
-    g_assert(magic == 0xBADC0FFEE0DDF00D);
+    g_assert(magic == 0xBADC0FFEE0DDF00DULL);
 
     magic = 0;
     for (u16 = f->userdef->u16; u16 != NULL; u16 = u16->next) {