mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
I hate line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117132 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
92205842ca
commit
2e6048f869
@ -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…
Reference in New Issue
Block a user