From: Evgeny Voevodin <e.voevodin@samsung.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, aliguori@us.ibm.com,
Evgeny Voevodin <e.voevodin@samsung.com>,
quintela@redhat.com, owasserm@redhat.com,
kyungmin.park@samsung.com
Subject: [Qemu-devel] [PATCH] savevm.c: Fix compilation error on 32bit host.
Date: Wed, 15 Aug 2012 13:10:18 +0400 [thread overview]
Message-ID: <1345021819-892-1-git-send-email-e.voevodin@samsung.com> (raw)
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 <e.voevodin@samsung.com>
---
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
next reply other threads:[~2012-08-15 9:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-15 9:10 Evgeny Voevodin [this message]
2012-08-15 9:30 ` [Qemu-devel] [PATCH] savevm.c: Fix compilation error on 32bit host Peter Maydell
2012-08-15 9:34 ` Evgeny Voevodin
2012-08-15 11:07 ` Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1345021819-892-1-git-send-email-e.voevodin@samsung.com \
--to=e.voevodin@samsung.com \
--cc=aliguori@us.ibm.com \
--cc=kyungmin.park@samsung.com \
--cc=owasserm@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).