From patchwork Wed Aug 15 09:10:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Voevodin X-Patchwork-Id: 177581 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 552912C009D for ; Wed, 15 Aug 2012 19:10:42 +1000 (EST) Received: from localhost ([::1]:37860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1Zce-0006G9-7o for incoming@patchwork.ozlabs.org; Wed, 15 Aug 2012 05:10:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1ZcX-0006FR-QO for qemu-devel@nongnu.org; Wed, 15 Aug 2012 05:10:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1ZcW-00072Z-Ka for qemu-devel@nongnu.org; Wed, 15 Aug 2012 05:10:33 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:63413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1ZcW-00072D-FF for qemu-devel@nongnu.org; Wed, 15 Aug 2012 05:10:32 -0400 Received: from eusync2.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M8S004UCHI6IW90@mailout2.w1.samsung.com> for qemu-devel@nongnu.org; Wed, 15 Aug 2012 10:10:54 +0100 (BST) Received: from evvoevodinPC.rnd.samsung.ru ([106.109.8.170]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0M8S001X9HHBU800@eusync2.samsung.com> for qemu-devel@nongnu.org; Wed, 15 Aug 2012 10:10:28 +0100 (BST) From: Evgeny Voevodin To: qemu-devel@nongnu.org Date: Wed, 15 Aug 2012 13:10:18 +0400 Message-id: <1345021819-892-1-git-send-email-e.voevodin@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-TM-AS-MML: No X-detected-operating-system: by eggs.gnu.org: Solaris 10 (1203?) X-Received-From: 210.118.77.12 Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, Evgeny Voevodin , quintela@redhat.com, owasserm@redhat.com, kyungmin.park@samsung.com Subject: [Qemu-devel] [PATCH] savevm.c: Fix compilation error on 32bit host. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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)) {