From: "J. Mayer" <l_indien@magic.fr>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [BUG] signed 16 bits word load for bigendian targets.
Date: Sun, 22 Feb 2004 01:56:19 +0100 [thread overview]
Message-ID: <1077411378.15655.11.camel@rapid> (raw)
In-Reply-To: <1077409581.23168.8.camel@rapid>
If the LSB is negative, the result is false.
Here's the patch:
Index: cpu-all.h
===================================================================
RCS file: /cvsroot/qemu/qemu/cpu-all.h,v
retrieving revision 1.20
diff -u -d -w -B -b -d -p -r1.20 cpu-all.h
--- cpu-all.h 16 Feb 2004 21:57:02 -0000 1.20
+++ cpu-all.h 22 Feb 2004 00:53:28 -0000
@@ -202,7 +202,7 @@ static inline int lduw_raw(void *ptr)
static inline int ldsw_raw(void *ptr)
{
int8_t *b = (int8_t *) ptr;
- return (b[0]<<8|b[1]);
+ return (b[0]<<8 | (uint8_t)b[1]);
}
--
J. Mayer <l_indien@magic.fr>
Never organized
next prev parent reply other threads:[~2004-02-22 0:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-21 23:07 [Qemu-devel] Fail to compile Anne et Bertrand
2004-02-22 0:26 ` J. Mayer
2004-02-22 0:56 ` J. Mayer [this message]
2004-02-23 22:37 ` [Qemu-devel] " Anne et Bertrand
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=1077411378.15655.11.camel@rapid \
--to=l_indien@magic.fr \
--cc=qemu-devel@nongnu.org \
/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).