summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2020-10-21 22:14:21 -0400
committerGravatar Lioncash2020-10-21 22:14:23 -0400
commitea20b5c970cb261df93743803a227fafd5403d02 (patch)
treeb0f78e977fef8b78169a5c8df2105cd573ad21fa /src
parentMerge pull request #4811 from lioncash/warn-video (diff)
downloadyuzu-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.h4
-rw-r--r--src/core/hle/service/ldr/ldr.cpp4
-rw-r--r--src/core/hle/service/ns/pl_u.cpp12
-rw-r--r--src/core/network/network.cpp2
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
24constexpr ResultCode ERROR_INSUFFICIENT_ADDRESS_SPACE{ErrorModule::RO, 2}; 24constexpr ResultCode ERROR_INSUFFICIENT_ADDRESS_SPACE{ErrorModule::RO, 2};
25 25
26constexpr ResultCode ERROR_INVALID_MEMORY_STATE{ErrorModule::Loader, 51}; 26[[maybe_unused]] constexpr ResultCode ERROR_INVALID_MEMORY_STATE{ErrorModule::Loader, 51};
27constexpr ResultCode ERROR_INVALID_NRO{ErrorModule::Loader, 52}; 27constexpr ResultCode ERROR_INVALID_NRO{ErrorModule::Loader, 52};
28constexpr ResultCode ERROR_INVALID_NRR{ErrorModule::Loader, 53}; 28constexpr ResultCode ERROR_INVALID_NRR{ErrorModule::Loader, 53};
29constexpr ResultCode ERROR_MISSING_NRR_HASH{ErrorModule::Loader, 54}; 29constexpr ResultCode ERROR_MISSING_NRR_HASH{ErrorModule::Loader, 54};
@@ -33,7 +33,7 @@ constexpr ResultCode ERROR_ALREADY_LOADED{ErrorModule::Loader, 57};
33constexpr ResultCode ERROR_INVALID_ALIGNMENT{ErrorModule::Loader, 81}; 33constexpr ResultCode ERROR_INVALID_ALIGNMENT{ErrorModule::Loader, 81};
34constexpr ResultCode ERROR_INVALID_SIZE{ErrorModule::Loader, 82}; 34constexpr ResultCode ERROR_INVALID_SIZE{ErrorModule::Loader, 82};
35constexpr ResultCode ERROR_INVALID_NRO_ADDRESS{ErrorModule::Loader, 84}; 35constexpr ResultCode ERROR_INVALID_NRO_ADDRESS{ErrorModule::Loader, 84};
36constexpr ResultCode ERROR_INVALID_NRR_ADDRESS{ErrorModule::Loader, 85}; 36[[maybe_unused]] constexpr ResultCode ERROR_INVALID_NRR_ADDRESS{ErrorModule::Loader, 85};
37constexpr ResultCode ERROR_NOT_INITIALIZED{ErrorModule::Loader, 87}; 37constexpr ResultCode ERROR_NOT_INITIALIZED{ErrorModule::Loader, 87};
38 38
39constexpr std::size_t MAXIMUM_LOADED_RO{0x40}; 39constexpr 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
53constexpr 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
65constexpr VAddr SHARED_FONT_MEM_VADDR{0x00000009d3016000ULL}; 55[[maybe_unused]] constexpr VAddr SHARED_FONT_MEM_VADDR{0x00000009d3016000ULL};
66constexpr u32 EXPECTED_RESULT{0x7f9a0218}; // What we expect the decrypted bfttf first 4 bytes to be 56constexpr u32 EXPECTED_RESULT{0x7f9a0218}; // What we expect the decrypted bfttf first 4 bytes to be
67constexpr u32 EXPECTED_MAGIC{0x36f81a1e}; // What we expect the encrypted bfttf first 4 bytes to be 57constexpr u32 EXPECTED_MAGIC{0x36f81a1e}; // What we expect the encrypted bfttf first 4 bytes to be
68constexpr u64 SHARED_FONT_MEM_SIZE{0x1100000}; 58constexpr 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
150int WSAPoll(WSAPOLLFD* fds, ULONG nfds, int timeout) { 150int 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
154int closesocket(SOCKET fd) { 154int closesocket(SOCKET fd) {