diff options
| author | 2021-01-05 19:04:15 -0800 | |
|---|---|---|
| committer | 2021-01-05 19:04:15 -0800 | |
| commit | dc02b03c4abd9878abce75e26bec153382835c6b (patch) | |
| tree | df50002a188b9a65bf2cbd999a394273d0465666 /src | |
| parent | Merge pull request #5289 from ReinUsesLisp/vulkan-device (diff) | |
| parent | core: Enforce C4715 (not all control paths return a value) (diff) | |
| download | yuzu-dc02b03c4abd9878abce75e26bec153382835c6b.tar.gz yuzu-dc02b03c4abd9878abce75e26bec153382835c6b.tar.xz yuzu-dc02b03c4abd9878abce75e26bec153382835c6b.zip | |
Merge pull request #5293 from ReinUsesLisp/return-values
core: Enforce C4715 (not all control paths return a value)
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/crypto/key_manager.cpp | 11 | ||||
| -rw-r--r-- | src/core/file_sys/nca_patch.cpp | 2 | ||||
| -rw-r--r-- | src/core/file_sys/registered_cache.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/kernel/memory/address_space_info.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/sockets/sockets_translate.cpp | 1 |
6 files changed, 13 insertions, 8 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 01f3e9419..893df433a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -635,6 +635,8 @@ if (MSVC) | |||
| 635 | /we4267 | 635 | /we4267 |
| 636 | # 'context' : truncation from 'type1' to 'type2' | 636 | # 'context' : truncation from 'type1' to 'type2' |
| 637 | /we4305 | 637 | /we4305 |
| 638 | # 'function' : not all control paths return a value | ||
| 639 | /we4715 | ||
| 638 | ) | 640 | ) |
| 639 | else() | 641 | else() |
| 640 | target_compile_options(core PRIVATE | 642 | target_compile_options(core PRIVATE |
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index da15f764a..cebe2ce37 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp | |||
| @@ -143,6 +143,7 @@ u64 GetSignatureTypeDataSize(SignatureType type) { | |||
| 143 | return 0x3C; | 143 | return 0x3C; |
| 144 | } | 144 | } |
| 145 | UNREACHABLE(); | 145 | UNREACHABLE(); |
| 146 | return 0; | ||
| 146 | } | 147 | } |
| 147 | 148 | ||
| 148 | u64 GetSignatureTypePaddingSize(SignatureType type) { | 149 | u64 GetSignatureTypePaddingSize(SignatureType type) { |
| @@ -157,6 +158,7 @@ u64 GetSignatureTypePaddingSize(SignatureType type) { | |||
| 157 | return 0x40; | 158 | return 0x40; |
| 158 | } | 159 | } |
| 159 | UNREACHABLE(); | 160 | UNREACHABLE(); |
| 161 | return 0; | ||
| 160 | } | 162 | } |
| 161 | 163 | ||
| 162 | SignatureType Ticket::GetSignatureType() const { | 164 | SignatureType Ticket::GetSignatureType() const { |
| @@ -169,8 +171,7 @@ SignatureType Ticket::GetSignatureType() const { | |||
| 169 | if (const auto* ticket = std::get_if<ECDSATicket>(&data)) { | 171 | if (const auto* ticket = std::get_if<ECDSATicket>(&data)) { |
| 170 | return ticket->sig_type; | 172 | return ticket->sig_type; |
| 171 | } | 173 | } |
| 172 | 174 | throw std::bad_variant_access{}; | |
| 173 | UNREACHABLE(); | ||
| 174 | } | 175 | } |
| 175 | 176 | ||
| 176 | TicketData& Ticket::GetData() { | 177 | TicketData& Ticket::GetData() { |
| @@ -183,8 +184,7 @@ TicketData& Ticket::GetData() { | |||
| 183 | if (auto* ticket = std::get_if<ECDSATicket>(&data)) { | 184 | if (auto* ticket = std::get_if<ECDSATicket>(&data)) { |
| 184 | return ticket->data; | 185 | return ticket->data; |
| 185 | } | 186 | } |
| 186 | 187 | throw std::bad_variant_access{}; | |
| 187 | UNREACHABLE(); | ||
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | const TicketData& Ticket::GetData() const { | 190 | const TicketData& Ticket::GetData() const { |
| @@ -197,8 +197,7 @@ const TicketData& Ticket::GetData() const { | |||
| 197 | if (const auto* ticket = std::get_if<ECDSATicket>(&data)) { | 197 | if (const auto* ticket = std::get_if<ECDSATicket>(&data)) { |
| 198 | return ticket->data; | 198 | return ticket->data; |
| 199 | } | 199 | } |
| 200 | 200 | throw std::bad_variant_access{}; | |
| 201 | UNREACHABLE(); | ||
| 202 | } | 201 | } |
| 203 | 202 | ||
| 204 | u64 Ticket::GetSize() const { | 203 | u64 Ticket::GetSize() const { |
diff --git a/src/core/file_sys/nca_patch.cpp b/src/core/file_sys/nca_patch.cpp index adcf0732f..a65ec6798 100644 --- a/src/core/file_sys/nca_patch.cpp +++ b/src/core/file_sys/nca_patch.cpp | |||
| @@ -51,8 +51,8 @@ std::pair<std::size_t, std::size_t> SearchBucketEntry(u64 offset, const BlockTyp | |||
| 51 | low = mid + 1; | 51 | low = mid + 1; |
| 52 | } | 52 | } |
| 53 | } | 53 | } |
| 54 | |||
| 55 | UNREACHABLE_MSG("Offset could not be found in BKTR block."); | 54 | UNREACHABLE_MSG("Offset could not be found in BKTR block."); |
| 55 | return {0, 0}; | ||
| 56 | } | 56 | } |
| 57 | } // Anonymous namespace | 57 | } // Anonymous namespace |
| 58 | 58 | ||
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index da01002d5..431302f55 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp | |||
| @@ -105,7 +105,8 @@ ContentRecordType GetCRTypeFromNCAType(NCAContentType type) { | |||
| 105 | // TODO(DarkLordZach): Peek at NCA contents to differentiate Manual and Legal. | 105 | // TODO(DarkLordZach): Peek at NCA contents to differentiate Manual and Legal. |
| 106 | return ContentRecordType::HtmlDocument; | 106 | return ContentRecordType::HtmlDocument; |
| 107 | default: | 107 | default: |
| 108 | UNREACHABLE_MSG("Invalid NCAContentType={:02X}", static_cast<u8>(type)); | 108 | UNREACHABLE_MSG("Invalid NCAContentType={:02X}", type); |
| 109 | return ContentRecordType{}; | ||
| 109 | } | 110 | } |
| 110 | } | 111 | } |
| 111 | 112 | ||
diff --git a/src/core/hle/kernel/memory/address_space_info.cpp b/src/core/hle/kernel/memory/address_space_info.cpp index e4288cab4..6cf43ba24 100644 --- a/src/core/hle/kernel/memory/address_space_info.cpp +++ b/src/core/hle/kernel/memory/address_space_info.cpp | |||
| @@ -96,6 +96,7 @@ u64 AddressSpaceInfo::GetAddressSpaceStart(std::size_t width, Type type) { | |||
| 96 | return AddressSpaceInfos[AddressSpaceIndices39Bit[index]].address; | 96 | return AddressSpaceInfos[AddressSpaceIndices39Bit[index]].address; |
| 97 | } | 97 | } |
| 98 | UNREACHABLE(); | 98 | UNREACHABLE(); |
| 99 | return 0; | ||
| 99 | } | 100 | } |
| 100 | 101 | ||
| 101 | std::size_t AddressSpaceInfo::GetAddressSpaceSize(std::size_t width, Type type) { | 102 | std::size_t AddressSpaceInfo::GetAddressSpaceSize(std::size_t width, Type type) { |
| @@ -112,6 +113,7 @@ std::size_t AddressSpaceInfo::GetAddressSpaceSize(std::size_t width, Type type) | |||
| 112 | return AddressSpaceInfos[AddressSpaceIndices39Bit[index]].size; | 113 | return AddressSpaceInfos[AddressSpaceIndices39Bit[index]].size; |
| 113 | } | 114 | } |
| 114 | UNREACHABLE(); | 115 | UNREACHABLE(); |
| 116 | return 0; | ||
| 115 | } | 117 | } |
| 116 | 118 | ||
| 117 | } // namespace Kernel::Memory | 119 | } // namespace Kernel::Memory |
diff --git a/src/core/hle/service/sockets/sockets_translate.cpp b/src/core/hle/service/sockets/sockets_translate.cpp index c822d21b8..ca61d72ca 100644 --- a/src/core/hle/service/sockets/sockets_translate.cpp +++ b/src/core/hle/service/sockets/sockets_translate.cpp | |||
| @@ -64,6 +64,7 @@ Network::Type Translate(Type type) { | |||
| 64 | return Network::Type::DGRAM; | 64 | return Network::Type::DGRAM; |
| 65 | default: | 65 | default: |
| 66 | UNIMPLEMENTED_MSG("Unimplemented type={}", type); | 66 | UNIMPLEMENTED_MSG("Unimplemented type={}", type); |
| 67 | return Network::Type{}; | ||
| 67 | } | 68 | } |
| 68 | } | 69 | } |
| 69 | 70 | ||