qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] savevm.c: Fix compilation error on 32bit host.


From: Evgeny Voevodin
Subject: [Qemu-devel] [PATCH] savevm.c: Fix compilation error on 32bit host.
Date: Wed, 15 Aug 2012 13:10:18 +0400

Casting of 0x0101010101010101ULL to long will truncate it to 32
bits on 32bit hosts, and won't truncate on 64bit hosts.

Signed-off-by: Evgeny Voevodin <address@hidden>
---
 savevm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/savevm.c b/savevm.c
index 0ea10c9..9ab4d83 100644
--- a/savevm.c
+++ b/savevm.c
@@ -2473,7 +2473,7 @@ int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t 
*new_buf, int slen,
         /* word at a time for speed, use of 32-bit long okay */
         if (!res) {
             /* truncation to 32-bit long okay */
-            long mask = 0x0101010101010101ULL;
+            long mask = (long)0x0101010101010101ULL;
             while (i < slen) {
                 xor = *(long *)(old_buf + i) ^ *(long *)(new_buf + i);
                 if ((xor - mask) & ~xor & (mask << 7)) {
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]