projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9efa1a
)
Fix endian test for big-endian hosts
author
Ed Maste
<emaste@freebsd.org>
Thu, 24 Jul 2014 13:28:16 +0000
(13:28 +0000)
committer
Ed Maste
<emaste@freebsd.org>
Thu, 24 Jul 2014 13:28:16 +0000
(13:28 +0000)
The uint16_t cast truncated the magic value to 0x00000304, making the
first byte 0 (eByteOrderInvalid) on big endian hosts.
Reported by Justin Hibbits.
llvm-svn: 213861
lldb/include/lldb/Host/Endian.h
patch
|
blob
|
history
diff --git
a/lldb/include/lldb/Host/Endian.h
b/lldb/include/lldb/Host/Endian.h
index
610f3ce
..
1ae3c40
100644
(file)
--- a/
lldb/include/lldb/Host/Endian.h
+++ b/
lldb/include/lldb/Host/Endian.h
@@
-20,7
+20,7
@@
namespace endian {
{
uint32_t num;
uint8_t bytes[sizeof(uint32_t)];
- } const endianTest = {
(uint16_t)
0x01020304 };
+ } const endianTest = { 0x01020304 };
inline ByteOrder InlHostByteOrder() { return (ByteOrder)endianTest.bytes[0]; }