summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorGravatar Lioncash2016-05-08 23:11:59 -0400
committerGravatar Lioncash2016-05-08 23:12:04 -0400
commitaef463010282d2daac4ce4aead1f20a8fa588ae3 (patch)
treebaa3c6d8d256350843a4d616186f878a1d2b39f7 /src/common
parentMerge pull request #1766 from Subv/log_cpu (diff)
downloadyuzu-aef463010282d2daac4ce4aead1f20a8fa588ae3.tar.gz
yuzu-aef463010282d2daac4ce4aead1f20a8fa588ae3.tar.xz
yuzu-aef463010282d2daac4ce4aead1f20a8fa588ae3.zip
swap: Remove unused methods
Also gets rid of pointer data variants as this prevents the use of the regular swapping routines as unary predicates in std lib functions. They also cast to stricter alignment types, which is undefined behavior.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/swap.h28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/common/swap.h b/src/common/swap.h
index a7c37bc44..f51751d29 100644
--- a/src/common/swap.h
+++ b/src/common/swap.h
@@ -58,9 +58,6 @@
58 58
59namespace Common { 59namespace Common {
60 60
61inline u8 swap8(u8 _data) {return _data;}
62inline u32 swap24(const u8* _data) {return (_data[0] << 16) | (_data[1] << 8) | _data[2];}
63
64#ifdef _MSC_VER 61#ifdef _MSC_VER
65inline u16 swap16(u16 _data) {return _byteswap_ushort(_data);} 62inline u16 swap16(u16 _data) {return _byteswap_ushort(_data);}
66inline u32 swap32(u32 _data) {return _byteswap_ulong (_data);} 63inline u32 swap32(u32 _data) {return _byteswap_ulong (_data);}
@@ -115,31 +112,6 @@ inline double swapd(double f) {
115 return dat2.f; 112 return dat2.f;
116} 113}
117 114
118inline u16 swap16(const u8* _pData) {return swap16(*(const u16*)_pData);}
119inline u32 swap32(const u8* _pData) {return swap32(*(const u32*)_pData);}
120inline u64 swap64(const u8* _pData) {return swap64(*(const u64*)_pData);}
121
122template <int count>
123void swap(u8*);
124
125template <>
126inline void swap<1>(u8* data) { }
127
128template <>
129inline void swap<2>(u8* data) {
130 *reinterpret_cast<u16*>(data) = swap16(data);
131}
132
133template <>
134inline void swap<4>(u8* data) {
135 *reinterpret_cast<u32*>(data) = swap32(data);
136}
137
138template <>
139inline void swap<8>(u8* data) {
140 *reinterpret_cast<u64*>(data) = swap64(data);
141}
142
143} // Namespace Common 115} // Namespace Common
144 116
145 117