summaryrefslogtreecommitdiff
path: root/src/common/swap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/swap.h')
-rw-r--r--src/common/swap.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/swap.h b/src/common/swap.h
index 7665942a2..8c68c1f26 100644
--- a/src/common/swap.h
+++ b/src/common/swap.h
@@ -504,35 +504,35 @@ bool operator==(const S& p, const swap_struct_t<T, F> v) {
504template <typename T> 504template <typename T>
505struct swap_64_t { 505struct swap_64_t {
506 static T swap(T x) { 506 static T swap(T x) {
507 return static_cast<T>(Common::swap64(x)); 507 return static_cast<T>(Common::swap64(static_cast<u64>(x)));
508 } 508 }
509}; 509};
510 510
511template <typename T> 511template <typename T>
512struct swap_32_t { 512struct swap_32_t {
513 static T swap(T x) { 513 static T swap(T x) {
514 return static_cast<T>(Common::swap32(x)); 514 return static_cast<T>(Common::swap32(static_cast<u32>(x)));
515 } 515 }
516}; 516};
517 517
518template <typename T> 518template <typename T>
519struct swap_16_t { 519struct swap_16_t {
520 static T swap(T x) { 520 static T swap(T x) {
521 return static_cast<T>(Common::swap16(x)); 521 return static_cast<T>(Common::swap16(static_cast<u16>(x)));
522 } 522 }
523}; 523};
524 524
525template <typename T> 525template <typename T>
526struct swap_float_t { 526struct swap_float_t {
527 static T swap(T x) { 527 static T swap(T x) {
528 return static_cast<T>(Common::swapf(x)); 528 return static_cast<T>(Common::swapf(static_cast<float>(x)));
529 } 529 }
530}; 530};
531 531
532template <typename T> 532template <typename T>
533struct swap_double_t { 533struct swap_double_t {
534 static T swap(T x) { 534 static T swap(T x) {
535 return static_cast<T>(Common::swapd(x)); 535 return static_cast<T>(Common::swapd(static_cast<double>(x)));
536 } 536 }
537}; 537};
538 538