From 3feafa78bdbe04e35119a6df6d2a7f043707c542 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Thu, 24 Jul 2014 13:28:16 +0000 Subject: [PATCH] Fix endian test for big-endian hosts 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/include/lldb/Host/Endian.h b/lldb/include/lldb/Host/Endian.h index 610f3ce..1ae3c40 100644 --- 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]; } -- 2.7.4