* [Qemu-devel] [PATCH] tests: fix 64-bit int literals for 32-bit hosts
@ 2013-11-05 16:42 Stefan Hajnoczi
2013-11-05 16:50 ` Eric Blake
2013-11-05 17:07 ` Laszlo Ersek
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2013-11-05 16:42 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, Stefan Hajnoczi
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>
---
tests/endianness-test.c | 3 ++-
tests/test-bitops.c | 4 ++--
tests/test-opts-visitor.c | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/endianness-test.c b/tests/endianness-test.c
index feb32a8..8719c09 100644
--- a/tests/endianness-test.c
+++ b/tests/endianness-test.c
@@ -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 },
diff --git a/tests/test-bitops.c b/tests/test-bitops.c
index 4e713e4..8238eb5 100644
--- a/tests/test-bitops.c
+++ b/tests/test-bitops.c
@@ -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)
diff --git a/tests/test-opts-visitor.c b/tests/test-opts-visitor.c
index 9f902b5..ebeee5d 100644
--- a/tests/test-opts-visitor.c
+++ b/tests/test-opts-visitor.c
@@ -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) {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] tests: fix 64-bit int literals for 32-bit hosts
2013-11-05 16:42 [Qemu-devel] [PATCH] tests: fix 64-bit int literals for 32-bit hosts Stefan Hajnoczi
@ 2013-11-05 16:50 ` Eric Blake
2013-11-05 17:07 ` Laszlo Ersek
1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2013-11-05 16:50 UTC (permalink / raw)
To: Stefan Hajnoczi, qemu-devel; +Cc: alex.bennee
[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]
On 11/05/2013 09:42 AM, Stefan Hajnoczi wrote:
> 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>
> ---
> tests/endianness-test.c | 3 ++-
> tests/test-bitops.c | 4 ++--
> tests/test-opts-visitor.c | 2 +-
> 3 files changed, 5 insertions(+), 4 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] tests: fix 64-bit int literals for 32-bit hosts
2013-11-05 16:42 [Qemu-devel] [PATCH] tests: fix 64-bit int literals for 32-bit hosts Stefan Hajnoczi
2013-11-05 16:50 ` Eric Blake
@ 2013-11-05 17:07 ` Laszlo Ersek
1 sibling, 0 replies; 3+ messages in thread
From: Laszlo Ersek @ 2013-11-05 17:07 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: alex.bennee, qemu-devel
On 11/05/13 17:42, Stefan Hajnoczi wrote:
> 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>
> ---
> tests/endianness-test.c | 3 ++-
> tests/test-bitops.c | 4 ++--
> tests/test-opts-visitor.c | 2 +-
> 3 files changed, 5 insertions(+), 4 deletions(-)
Blame it on still using gnu89 instead of c99 (or gnu99 if must be).
Laszlo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-05 17:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-05 16:42 [Qemu-devel] [PATCH] tests: fix 64-bit int literals for 32-bit hosts Stefan Hajnoczi
2013-11-05 16:50 ` Eric Blake
2013-11-05 17:07 ` Laszlo Ersek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).