qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] xbzrle: fix compilation on ppc32
@ 2012-08-14 10:55 Alexander Graf
  2012-08-14 12:37 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Graf @ 2012-08-14 10:55 UTC (permalink / raw)
  To: qemu-devel qemu-devel; +Cc: Orit Wasserman

When compiling the xbzrle code on my ppc32 user space, I hit the following
gcc compiler warning (treated as an error):

  cc1: warnings being treated as errors
  savevm.c: In function ‘xbzrle_encode_buffer’:
  savevm.c:2476: error: overflow in implicit constant conversion

Fix this by making the cast explicit, rather than implicit.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 savevm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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.6.0.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-14 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-14 10:55 [Qemu-devel] [PATCH] xbzrle: fix compilation on ppc32 Alexander Graf
2012-08-14 12:37 ` Eric Blake

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).