diff options
Diffstat (limited to 'src/common/swap.h')
| -rw-r--r-- | src/common/swap.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/swap.h b/src/common/swap.h index beedd6c7e..1749bd7a4 100644 --- a/src/common/swap.h +++ b/src/common/swap.h | |||
| @@ -510,35 +510,35 @@ bool operator==(const S &p, const swap_struct_t<T, F> v) { | |||
| 510 | template <typename T> | 510 | template <typename T> |
| 511 | struct swap_64_t { | 511 | struct swap_64_t { |
| 512 | static T swap(T x) { | 512 | static T swap(T x) { |
| 513 | return (T)Common::swap64(*(u64 *)&x); | 513 | return static_cast<T>(Common::swap64(x)); |
| 514 | } | 514 | } |
| 515 | }; | 515 | }; |
| 516 | 516 | ||
| 517 | template <typename T> | 517 | template <typename T> |
| 518 | struct swap_32_t { | 518 | struct swap_32_t { |
| 519 | static T swap(T x) { | 519 | static T swap(T x) { |
| 520 | return (T)Common::swap32(*(u32 *)&x); | 520 | return static_cast<T>(Common::swap32(x)); |
| 521 | } | 521 | } |
| 522 | }; | 522 | }; |
| 523 | 523 | ||
| 524 | template <typename T> | 524 | template <typename T> |
| 525 | struct swap_16_t { | 525 | struct swap_16_t { |
| 526 | static T swap(T x) { | 526 | static T swap(T x) { |
| 527 | return (T)Common::swap16(*(u16 *)&x); | 527 | return static_cast<T>(Common::swap16(x)); |
| 528 | } | 528 | } |
| 529 | }; | 529 | }; |
| 530 | 530 | ||
| 531 | template <typename T> | 531 | template <typename T> |
| 532 | struct swap_float_t { | 532 | struct swap_float_t { |
| 533 | static T swap(T x) { | 533 | static T swap(T x) { |
| 534 | return (T)Common::swapf(*(float *)&x); | 534 | return static_cast<T>(Common::swapf(x)); |
| 535 | } | 535 | } |
| 536 | }; | 536 | }; |
| 537 | 537 | ||
| 538 | template <typename T> | 538 | template <typename T> |
| 539 | struct swap_double_t { | 539 | struct swap_double_t { |
| 540 | static T swap(T x) { | 540 | static T swap(T x) { |
| 541 | return (T)Common::swapd(*(double *)&x); | 541 | return static_cast<T>(Common::swapd(x)); |
| 542 | } | 542 | } |
| 543 | }; | 543 | }; |
| 544 | 544 | ||