diff options
| author | 2020-10-21 22:14:21 -0400 | |
|---|---|---|
| committer | 2020-10-21 22:14:23 -0400 | |
| commit | ea20b5c970cb261df93743803a227fafd5403d02 (patch) | |
| tree | b0f78e977fef8b78169a5c8df2105cd573ad21fa /src | |
| parent | Merge pull request #4811 from lioncash/warn-video (diff) | |
| download | yuzu-ea20b5c970cb261df93743803a227fafd5403d02.tar.gz yuzu-ea20b5c970cb261df93743803a227fafd5403d02.tar.xz yuzu-ea20b5c970cb261df93743803a227fafd5403d02.zip | |
core: Fix clang build pt.3
Should finally resolve building with clang.
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/math_util.h | 4 | ||||
| -rw-r--r-- | src/core/hle/service/ldr/ldr.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/ns/pl_u.cpp | 12 | ||||
| -rw-r--r-- | src/core/network/network.cpp | 2 |
4 files changed, 6 insertions, 16 deletions
diff --git a/src/common/math_util.h b/src/common/math_util.h index 7cec80d57..4c38d8040 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h | |||
| @@ -27,7 +27,7 @@ struct Rectangle { | |||
| 27 | if constexpr (std::is_floating_point_v<T>) { | 27 | if constexpr (std::is_floating_point_v<T>) { |
| 28 | return std::abs(right - left); | 28 | return std::abs(right - left); |
| 29 | } else { | 29 | } else { |
| 30 | return std::abs(static_cast<std::make_signed_t<T>>(right - left)); | 30 | return static_cast<T>(std::abs(static_cast<std::make_signed_t<T>>(right - left))); |
| 31 | } | 31 | } |
| 32 | } | 32 | } |
| 33 | 33 | ||
| @@ -35,7 +35,7 @@ struct Rectangle { | |||
| 35 | if constexpr (std::is_floating_point_v<T>) { | 35 | if constexpr (std::is_floating_point_v<T>) { |
| 36 | return std::abs(bottom - top); | 36 | return std::abs(bottom - top); |
| 37 | } else { | 37 | } else { |
| 38 | return std::abs(static_cast<std::make_signed_t<T>>(bottom - top)); | 38 | return static_cast<T>(std::abs(static_cast<std::make_signed_t<T>>(bottom - top))); |
| 39 | } | 39 | } |
| 40 | } | 40 | } |
| 41 | 41 | ||
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index d8cd10e31..9ad5bbf0d 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp | |||
| @@ -23,7 +23,7 @@ namespace Service::LDR { | |||
| 23 | 23 | ||
| 24 | constexpr ResultCode ERROR_INSUFFICIENT_ADDRESS_SPACE{ErrorModule::RO, 2}; | 24 | constexpr ResultCode ERROR_INSUFFICIENT_ADDRESS_SPACE{ErrorModule::RO, 2}; |
| 25 | 25 | ||
| 26 | constexpr ResultCode ERROR_INVALID_MEMORY_STATE{ErrorModule::Loader, 51}; | 26 | [[maybe_unused]] constexpr ResultCode ERROR_INVALID_MEMORY_STATE{ErrorModule::Loader, 51}; |
| 27 | constexpr ResultCode ERROR_INVALID_NRO{ErrorModule::Loader, 52}; | 27 | constexpr ResultCode ERROR_INVALID_NRO{ErrorModule::Loader, 52}; |
| 28 | constexpr ResultCode ERROR_INVALID_NRR{ErrorModule::Loader, 53}; | 28 | constexpr ResultCode ERROR_INVALID_NRR{ErrorModule::Loader, 53}; |
| 29 | constexpr ResultCode ERROR_MISSING_NRR_HASH{ErrorModule::Loader, 54}; | 29 | constexpr ResultCode ERROR_MISSING_NRR_HASH{ErrorModule::Loader, 54}; |
| @@ -33,7 +33,7 @@ constexpr ResultCode ERROR_ALREADY_LOADED{ErrorModule::Loader, 57}; | |||
| 33 | constexpr ResultCode ERROR_INVALID_ALIGNMENT{ErrorModule::Loader, 81}; | 33 | constexpr ResultCode ERROR_INVALID_ALIGNMENT{ErrorModule::Loader, 81}; |
| 34 | constexpr ResultCode ERROR_INVALID_SIZE{ErrorModule::Loader, 82}; | 34 | constexpr ResultCode ERROR_INVALID_SIZE{ErrorModule::Loader, 82}; |
| 35 | constexpr ResultCode ERROR_INVALID_NRO_ADDRESS{ErrorModule::Loader, 84}; | 35 | constexpr ResultCode ERROR_INVALID_NRO_ADDRESS{ErrorModule::Loader, 84}; |
| 36 | constexpr ResultCode ERROR_INVALID_NRR_ADDRESS{ErrorModule::Loader, 85}; | 36 | [[maybe_unused]] constexpr ResultCode ERROR_INVALID_NRR_ADDRESS{ErrorModule::Loader, 85}; |
| 37 | constexpr ResultCode ERROR_NOT_INITIALIZED{ErrorModule::Loader, 87}; | 37 | constexpr ResultCode ERROR_NOT_INITIALIZED{ErrorModule::Loader, 87}; |
| 38 | 38 | ||
| 39 | constexpr std::size_t MAXIMUM_LOADED_RO{0x40}; | 39 | constexpr std::size_t MAXIMUM_LOADED_RO{0x40}; |
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index 40838a225..5ccec2637 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp | |||
| @@ -50,19 +50,9 @@ constexpr std::array<std::pair<FontArchives, const char*>, 7> SHARED_FONTS{ | |||
| 50 | std::make_pair(FontArchives::Extension, "nintendo_ext2_003.bfttf"), | 50 | std::make_pair(FontArchives::Extension, "nintendo_ext2_003.bfttf"), |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | constexpr std::array<const char*, 7> SHARED_FONTS_TTF{ | ||
| 54 | "FontStandard.ttf", | ||
| 55 | "FontChineseSimplified.ttf", | ||
| 56 | "FontExtendedChineseSimplified.ttf", | ||
| 57 | "FontChineseTraditional.ttf", | ||
| 58 | "FontKorean.ttf", | ||
| 59 | "FontNintendoExtended.ttf", | ||
| 60 | "FontNintendoExtended2.ttf", | ||
| 61 | }; | ||
| 62 | |||
| 63 | // The below data is specific to shared font data dumped from Switch on f/w 2.2 | 53 | // The below data is specific to shared font data dumped from Switch on f/w 2.2 |
| 64 | // Virtual address and offsets/sizes likely will vary by dump | 54 | // Virtual address and offsets/sizes likely will vary by dump |
| 65 | constexpr VAddr SHARED_FONT_MEM_VADDR{0x00000009d3016000ULL}; | 55 | [[maybe_unused]] constexpr VAddr SHARED_FONT_MEM_VADDR{0x00000009d3016000ULL}; |
| 66 | constexpr u32 EXPECTED_RESULT{0x7f9a0218}; // What we expect the decrypted bfttf first 4 bytes to be | 56 | constexpr u32 EXPECTED_RESULT{0x7f9a0218}; // What we expect the decrypted bfttf first 4 bytes to be |
| 67 | constexpr u32 EXPECTED_MAGIC{0x36f81a1e}; // What we expect the encrypted bfttf first 4 bytes to be | 57 | constexpr u32 EXPECTED_MAGIC{0x36f81a1e}; // What we expect the encrypted bfttf first 4 bytes to be |
| 68 | constexpr u64 SHARED_FONT_MEM_SIZE{0x1100000}; | 58 | constexpr u64 SHARED_FONT_MEM_SIZE{0x1100000}; |
diff --git a/src/core/network/network.cpp b/src/core/network/network.cpp index 4b3bb4366..5ef2e8511 100644 --- a/src/core/network/network.cpp +++ b/src/core/network/network.cpp | |||
| @@ -148,7 +148,7 @@ sockaddr TranslateFromSockAddrIn(SockAddrIn input) { | |||
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | int WSAPoll(WSAPOLLFD* fds, ULONG nfds, int timeout) { | 150 | int WSAPoll(WSAPOLLFD* fds, ULONG nfds, int timeout) { |
| 151 | return poll(fds, nfds, timeout); | 151 | return poll(fds, static_cast<nfds_t>(nfds), timeout); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | int closesocket(SOCKET fd) { | 154 | int closesocket(SOCKET fd) { |