summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Endian.h
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-10-22 19:14:39 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-10-22 19:14:39 +0000
commit2e6048f8690105f7174e24ceba8e7c9f67009411 (patch)
treebcdb6fb07dbc9dfc51e3ee384e99373fd0b9f10f /include/llvm/Support/Endian.h
parent92205842ca21952929eef1571a9b5b6c758540e0 (diff)
downloadllvm-2e6048f8690105f7174e24ceba8e7c9f67009411.tar.gz
llvm-2e6048f8690105f7174e24ceba8e7c9f67009411.tar.bz2
llvm-2e6048f8690105f7174e24ceba8e7c9f67009411.tar.xz
I hate line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Endian.h')
-rw-r--r--include/llvm/Support/Endian.h72
1 files changed, 36 insertions, 36 deletions
diff --git a/include/llvm/Support/Endian.h b/include/llvm/Support/Endian.h
index 1058beff7b..dc88a129e1 100644
--- a/include/llvm/Support/Endian.h
+++ b/include/llvm/Support/Endian.h
@@ -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 {