mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-19 18:24:05 +00:00
I hate line endings.
llvm-svn: 117132
This commit is contained in:
parent
2bbdc62e17
commit
81bb7d4ad7
@ -48,43 +48,43 @@ struct alignment_access_helper<value_type, unaligned>
|
||||
|
||||
} // end namespace detail
|
||||
|
||||
namespace endian {
|
||||
template<typename value_type, alignment align>
|
||||
static value_type read_le(const void *memory) {
|
||||
value_type t =
|
||||
reinterpret_cast<const detail::alignment_access_helper
|
||||
<value_type, align> *>(memory)->val;
|
||||
if (sys::isBigEndianHost())
|
||||
return sys::SwapByteOrder(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
template<typename value_type, alignment align>
|
||||
static void write_le(void *memory, value_type value) {
|
||||
if (sys::isBigEndianHost())
|
||||
value = sys::SwapByteOrder(value);
|
||||
reinterpret_cast<detail::alignment_access_helper<value_type, align> *>
|
||||
(memory)->val = value;
|
||||
}
|
||||
|
||||
template<typename value_type, alignment align>
|
||||
static value_type read_be(const void *memory) {
|
||||
value_type t =
|
||||
reinterpret_cast<const detail::alignment_access_helper
|
||||
<value_type, align> *>(memory)->val;
|
||||
if (sys::isLittleEndianHost())
|
||||
return sys::SwapByteOrder(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
template<typename value_type, alignment align>
|
||||
static void write_be(void *memory, value_type value) {
|
||||
if (sys::isLittleEndianHost())
|
||||
value = sys::SwapByteOrder(value);
|
||||
reinterpret_cast<detail::alignment_access_helper<value_type, align> *>
|
||||
(memory)->val = value;
|
||||
namespace endian {
|
||||
template<typename value_type, alignment align>
|
||||
static value_type read_le(const void *memory) {
|
||||
value_type t =
|
||||
reinterpret_cast<const detail::alignment_access_helper
|
||||
<value_type, align> *>(memory)->val;
|
||||
if (sys::isBigEndianHost())
|
||||
return sys::SwapByteOrder(t);
|
||||
return t;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename value_type, alignment align>
|
||||
static void write_le(void *memory, value_type value) {
|
||||
if (sys::isBigEndianHost())
|
||||
value = sys::SwapByteOrder(value);
|
||||
reinterpret_cast<detail::alignment_access_helper<value_type, align> *>
|
||||
(memory)->val = value;
|
||||
}
|
||||
|
||||
template<typename value_type, alignment align>
|
||||
static value_type read_be(const void *memory) {
|
||||
value_type t =
|
||||
reinterpret_cast<const detail::alignment_access_helper
|
||||
<value_type, align> *>(memory)->val;
|
||||
if (sys::isLittleEndianHost())
|
||||
return sys::SwapByteOrder(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
template<typename value_type, alignment align>
|
||||
static void write_be(void *memory, value_type value) {
|
||||
if (sys::isLittleEndianHost())
|
||||
value = sys::SwapByteOrder(value);
|
||||
reinterpret_cast<detail::alignment_access_helper<value_type, align> *>
|
||||
(memory)->val = value;
|
||||
}
|
||||
}
|
||||
|
||||
namespace detail {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user