Skip to content

Commit

Permalink
xbzrle: fix compilation on ppc32
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
agraf committed Aug 15, 2012
1 parent f28359d commit a5b7172
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion savevm.c
Expand Up @@ -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)) {
Expand Down

0 comments on commit a5b7172

Please sign in to comment.