summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/swap.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/common/swap.h b/src/common/swap.h
index 23f327201..295c65993 100644
--- a/src/common/swap.h
+++ b/src/common/swap.h
@@ -185,39 +185,39 @@ public:
185 185
186 template <typename S> 186 template <typename S>
187 swapped_t& operator=(const S& source) { 187 swapped_t& operator=(const S& source) {
188 value = swap((T)source); 188 value = swap(static_cast<T>(source));
189 return *this; 189 return *this;
190 } 190 }
191 191
192 operator s8() const { 192 operator s8() const {
193 return (s8)swap(); 193 return static_cast<s8>(swap());
194 } 194 }
195 operator u8() const { 195 operator u8() const {
196 return (u8)swap(); 196 return static_cast<u8>(swap());
197 } 197 }
198 operator s16() const { 198 operator s16() const {
199 return (s16)swap(); 199 return static_cast<s16>(swap());
200 } 200 }
201 operator u16() const { 201 operator u16() const {
202 return (u16)swap(); 202 return static_cast<u16>(swap());
203 } 203 }
204 operator s32() const { 204 operator s32() const {
205 return (s32)swap(); 205 return static_cast<s32>(swap());
206 } 206 }
207 operator u32() const { 207 operator u32() const {
208 return (u32)swap(); 208 return static_cast<u32>(swap());
209 } 209 }
210 operator s64() const { 210 operator s64() const {
211 return (s64)swap(); 211 return static_cast<s64>(swap());
212 } 212 }
213 operator u64() const { 213 operator u64() const {
214 return (u64)swap(); 214 return static_cast<u64>(swap());
215 } 215 }
216 operator float() const { 216 operator float() const {
217 return (float)swap(); 217 return static_cast<float>(swap());
218 } 218 }
219 operator double() const { 219 operator double() const {
220 return (double)swap(); 220 return static_cast<double>(swap());
221 } 221 }
222 222
223 // +v 223 // +v
@@ -253,7 +253,7 @@ public:
253 } 253 }
254 template <typename S> 254 template <typename S>
255 swapped_t operator+(const S& i) const { 255 swapped_t operator+(const S& i) const {
256 return swap() + (T)i; 256 return swap() + static_cast<T>(i);
257 } 257 }
258 // v - 5 258 // v - 5
259 swapped_t operator-(const swapped_t& i) const { 259 swapped_t operator-(const swapped_t& i) const {
@@ -261,7 +261,7 @@ public:
261 } 261 }
262 template <typename S> 262 template <typename S>
263 swapped_t operator-(const S& i) const { 263 swapped_t operator-(const S& i) const {
264 return swap() - (T)i; 264 return swap() - static_cast<T>(i);
265 } 265 }
266 266
267 // v += 5 267 // v += 5
@@ -271,7 +271,7 @@ public:
271 } 271 }
272 template <typename S> 272 template <typename S>
273 swapped_t& operator+=(const S& i) { 273 swapped_t& operator+=(const S& i) {
274 value = swap(swap() + (T)i); 274 value = swap(swap() + static_cast<T>(i));
275 return *this; 275 return *this;
276 } 276 }
277 // v -= 5 277 // v -= 5
@@ -281,7 +281,7 @@ public:
281 } 281 }
282 template <typename S> 282 template <typename S>
283 swapped_t& operator-=(const S& i) { 283 swapped_t& operator-=(const S& i) {
284 value = swap(swap() - (T)i); 284 value = swap(swap() - static_cast<T>(i));
285 return *this; 285 return *this;
286 } 286 }
287 287
@@ -541,7 +541,7 @@ S operator&(const S& i, const swap_struct_t<T, F> v) {
541 541
542template <typename S, typename T, typename F> 542template <typename S, typename T, typename F>
543S operator&(const swap_struct_t<T, F> v, const S& i) { 543S operator&(const swap_struct_t<T, F> v, const S& i) {
544 return (S)(v.swap() & i); 544 return static_cast<S>(v.swap() & i);
545} 545}
546 546
547// Comparaison 547// Comparaison