diff options
| author | 2020-10-15 14:49:45 -0400 | |
|---|---|---|
| committer | 2020-10-17 19:50:39 -0400 | |
| commit | be1954e04cb5a0c3a526f78ed5490a5e65310280 (patch) | |
| tree | 267db7ae4be88dbbc288fa605e35d4a2a13839f6 /src/common/swap.h | |
| parent | Merge pull request #4787 from lioncash/conversion (diff) | |
| download | yuzu-be1954e04cb5a0c3a526f78ed5490a5e65310280.tar.gz yuzu-be1954e04cb5a0c3a526f78ed5490a5e65310280.tar.xz yuzu-be1954e04cb5a0c3a526f78ed5490a5e65310280.zip | |
core: Fix clang build
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.
Fixes #4795
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 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) { | |||
| 504 | template <typename T> | 504 | template <typename T> |
| 505 | struct swap_64_t { | 505 | struct 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 | ||
| 511 | template <typename T> | 511 | template <typename T> |
| 512 | struct swap_32_t { | 512 | struct 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 | ||
| 518 | template <typename T> | 518 | template <typename T> |
| 519 | struct swap_16_t { | 519 | struct 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 | ||
| 525 | template <typename T> | 525 | template <typename T> |
| 526 | struct swap_float_t { | 526 | struct 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 | ||
| 532 | template <typename T> | 532 | template <typename T> |
| 533 | struct swap_double_t { | 533 | struct 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 | ||