diff options
| author | 2023-02-11 13:28:03 -0500 | |
|---|---|---|
| committer | 2023-02-14 12:33:11 -0500 | |
| commit | 45e13b03f372230dbf780f3fa87dd88f388af605 (patch) | |
| tree | 555593e7e5016b6ba2a777d7417ada244abce458 /src/core/hle/service | |
| parent | Merge pull request #9795 from Kelebek1/biquad_fix (diff) | |
| download | yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.gz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.xz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.zip | |
add static lifetime to constexpr values to force compile time evaluation where possible
Signed-off-by: arades79 <scravers@protonmail.com>
Diffstat (limited to 'src/core/hle/service')
20 files changed, 44 insertions, 44 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 6d1084fd1..5b87bb18c 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp | |||
| @@ -871,7 +871,7 @@ void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestCont | |||
| 871 | // TODO(ogniK): Check if application ID is zero on acc initialize. As we don't have a reliable | 871 | // TODO(ogniK): Check if application ID is zero on acc initialize. As we don't have a reliable |
| 872 | // way of confirming things like the TID, we're going to assume a non zero value for the time | 872 | // way of confirming things like the TID, we're going to assume a non zero value for the time |
| 873 | // being. | 873 | // being. |
| 874 | constexpr u64 tid{1}; | 874 | constexpr static u64 tid{1}; |
| 875 | StoreSaveDataThumbnail(ctx, uuid, tid); | 875 | StoreSaveDataThumbnail(ctx, uuid, tid); |
| 876 | } | 876 | } |
| 877 | 877 | ||
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index ebcf6e164..01f03effe 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -1086,7 +1086,7 @@ private: | |||
| 1086 | 1086 | ||
| 1087 | // We require a non-zero handle to be valid. Using 0xdeadbeef allows us to trace if this is | 1087 | // We require a non-zero handle to be valid. Using 0xdeadbeef allows us to trace if this is |
| 1088 | // actually used anywhere | 1088 | // actually used anywhere |
| 1089 | constexpr u64 handle = 0xdeadbeef; | 1089 | constexpr static u64 handle = 0xdeadbeef; |
| 1090 | 1090 | ||
| 1091 | IPC::ResponseBuilder rb{ctx, 4}; | 1091 | IPC::ResponseBuilder rb{ctx, 4}; |
| 1092 | rb.Push(ResultSuccess); | 1092 | rb.Push(ResultSuccess); |
| @@ -1570,7 +1570,7 @@ void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) { | |||
| 1570 | const auto& version = res.first->GetVersionString(); | 1570 | const auto& version = res.first->GetVersionString(); |
| 1571 | std::copy(version.begin(), version.end(), version_string.begin()); | 1571 | std::copy(version.begin(), version.end(), version_string.begin()); |
| 1572 | } else { | 1572 | } else { |
| 1573 | constexpr char default_version[]{"1.0.0"}; | 1573 | constexpr static char default_version[]{"1.0.0"}; |
| 1574 | std::memcpy(version_string.data(), default_version, sizeof(default_version)); | 1574 | std::memcpy(version_string.data(), default_version, sizeof(default_version)); |
| 1575 | } | 1575 | } |
| 1576 | 1576 | ||
| @@ -1638,7 +1638,7 @@ void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) { | |||
| 1638 | void IApplicationFunctions::IsGamePlayRecordingSupported(Kernel::HLERequestContext& ctx) { | 1638 | void IApplicationFunctions::IsGamePlayRecordingSupported(Kernel::HLERequestContext& ctx) { |
| 1639 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 1639 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 1640 | 1640 | ||
| 1641 | constexpr bool gameplay_recording_supported = false; | 1641 | constexpr static bool gameplay_recording_supported = false; |
| 1642 | 1642 | ||
| 1643 | IPC::ResponseBuilder rb{ctx, 3}; | 1643 | IPC::ResponseBuilder rb{ctx, 3}; |
| 1644 | rb.Push(ResultSuccess); | 1644 | rb.Push(ResultSuccess); |
diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.cpp b/src/core/hle/service/am/applets/applet_software_keyboard.cpp index c18236045..962371a99 100644 --- a/src/core/hle/service/am/applets/applet_software_keyboard.cpp +++ b/src/core/hle/service/am/applets/applet_software_keyboard.cpp | |||
| @@ -1180,7 +1180,7 @@ void SoftwareKeyboard::ReplyChangedStringV2() { | |||
| 1180 | .cursor_position{current_cursor_position}, | 1180 | .cursor_position{current_cursor_position}, |
| 1181 | }; | 1181 | }; |
| 1182 | 1182 | ||
| 1183 | constexpr u8 flag = 0; | 1183 | constexpr static u8 flag = 0; |
| 1184 | 1184 | ||
| 1185 | std::memcpy(reply.data() + REPLY_BASE_SIZE, current_text.data(), | 1185 | std::memcpy(reply.data() + REPLY_BASE_SIZE, current_text.data(), |
| 1186 | current_text.size() * sizeof(char16_t)); | 1186 | current_text.size() * sizeof(char16_t)); |
| @@ -1204,7 +1204,7 @@ void SoftwareKeyboard::ReplyMovedCursorV2() { | |||
| 1204 | .cursor_position{current_cursor_position}, | 1204 | .cursor_position{current_cursor_position}, |
| 1205 | }; | 1205 | }; |
| 1206 | 1206 | ||
| 1207 | constexpr u8 flag = 0; | 1207 | constexpr static u8 flag = 0; |
| 1208 | 1208 | ||
| 1209 | std::memcpy(reply.data() + REPLY_BASE_SIZE, current_text.data(), | 1209 | std::memcpy(reply.data() + REPLY_BASE_SIZE, current_text.data(), |
| 1210 | current_text.size() * sizeof(char16_t)); | 1210 | current_text.size() * sizeof(char16_t)); |
| @@ -1232,7 +1232,7 @@ void SoftwareKeyboard::ReplyChangedStringUtf8V2() { | |||
| 1232 | .cursor_position{current_cursor_position}, | 1232 | .cursor_position{current_cursor_position}, |
| 1233 | }; | 1233 | }; |
| 1234 | 1234 | ||
| 1235 | constexpr u8 flag = 0; | 1235 | constexpr static u8 flag = 0; |
| 1236 | 1236 | ||
| 1237 | std::memcpy(reply.data() + REPLY_BASE_SIZE, utf8_current_text.data(), utf8_current_text.size()); | 1237 | std::memcpy(reply.data() + REPLY_BASE_SIZE, utf8_current_text.data(), utf8_current_text.size()); |
| 1238 | std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF8_SIZE, &changed_string_arg, | 1238 | std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF8_SIZE, &changed_string_arg, |
| @@ -1257,7 +1257,7 @@ void SoftwareKeyboard::ReplyMovedCursorUtf8V2() { | |||
| 1257 | .cursor_position{current_cursor_position}, | 1257 | .cursor_position{current_cursor_position}, |
| 1258 | }; | 1258 | }; |
| 1259 | 1259 | ||
| 1260 | constexpr u8 flag = 0; | 1260 | constexpr static u8 flag = 0; |
| 1261 | 1261 | ||
| 1262 | std::memcpy(reply.data() + REPLY_BASE_SIZE, utf8_current_text.data(), utf8_current_text.size()); | 1262 | std::memcpy(reply.data() + REPLY_BASE_SIZE, utf8_current_text.data(), utf8_current_text.size()); |
| 1263 | std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF8_SIZE, &moved_cursor_arg, | 1263 | std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF8_SIZE, &moved_cursor_arg, |
diff --git a/src/core/hle/service/apm/apm_controller.cpp b/src/core/hle/service/apm/apm_controller.cpp index d6de84066..7236f586d 100644 --- a/src/core/hle/service/apm/apm_controller.cpp +++ b/src/core/hle/service/apm/apm_controller.cpp | |||
| @@ -56,7 +56,7 @@ void Controller::SetPerformanceConfiguration(PerformanceMode mode, | |||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | void Controller::SetFromCpuBoostMode(CpuBoostMode mode) { | 58 | void Controller::SetFromCpuBoostMode(CpuBoostMode mode) { |
| 59 | constexpr std::array<PerformanceConfiguration, 3> BOOST_MODE_TO_CONFIG_MAP{{ | 59 | constexpr static std::array<PerformanceConfiguration, 3> BOOST_MODE_TO_CONFIG_MAP{{ |
| 60 | PerformanceConfiguration::Config7, | 60 | PerformanceConfiguration::Config7, |
| 61 | PerformanceConfiguration::Config13, | 61 | PerformanceConfiguration::Config13, |
| 62 | PerformanceConfiguration::Config15, | 62 | PerformanceConfiguration::Config15, |
diff --git a/src/core/hle/service/audio/audctl.cpp b/src/core/hle/service/audio/audctl.cpp index 5abf22ba4..654d2c493 100644 --- a/src/core/hle/service/audio/audctl.cpp +++ b/src/core/hle/service/audio/audctl.cpp | |||
| @@ -77,7 +77,7 @@ void AudCtl::GetTargetVolumeMin(Kernel::HLERequestContext& ctx) { | |||
| 77 | 77 | ||
| 78 | // This service function is currently hardcoded on the | 78 | // This service function is currently hardcoded on the |
| 79 | // actual console to this value (as of 8.0.0). | 79 | // actual console to this value (as of 8.0.0). |
| 80 | constexpr s32 target_min_volume = 0; | 80 | constexpr static s32 target_min_volume = 0; |
| 81 | 81 | ||
| 82 | IPC::ResponseBuilder rb{ctx, 3}; | 82 | IPC::ResponseBuilder rb{ctx, 3}; |
| 83 | rb.Push(ResultSuccess); | 83 | rb.Push(ResultSuccess); |
| @@ -89,7 +89,7 @@ void AudCtl::GetTargetVolumeMax(Kernel::HLERequestContext& ctx) { | |||
| 89 | 89 | ||
| 90 | // This service function is currently hardcoded on the | 90 | // This service function is currently hardcoded on the |
| 91 | // actual console to this value (as of 8.0.0). | 91 | // actual console to this value (as of 8.0.0). |
| 92 | constexpr s32 target_max_volume = 15; | 92 | constexpr static s32 target_max_volume = 15; |
| 93 | 93 | ||
| 94 | IPC::ResponseBuilder rb{ctx, 3}; | 94 | IPC::ResponseBuilder rb{ctx, 3}; |
| 95 | rb.Push(ResultSuccess); | 95 | rb.Push(ResultSuccess); |
diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp index e01f87356..fe975157c 100644 --- a/src/core/hle/service/audio/hwopus.cpp +++ b/src/core/hle/service/audio/hwopus.cpp | |||
| @@ -209,7 +209,7 @@ private: | |||
| 209 | 209 | ||
| 210 | std::size_t WorkerBufferSize(u32 channel_count) { | 210 | std::size_t WorkerBufferSize(u32 channel_count) { |
| 211 | ASSERT_MSG(channel_count == 1 || channel_count == 2, "Invalid channel count"); | 211 | ASSERT_MSG(channel_count == 1 || channel_count == 2, "Invalid channel count"); |
| 212 | constexpr int num_streams = 1; | 212 | constexpr static int num_streams = 1; |
| 213 | const int num_stereo_streams = channel_count == 2 ? 1 : 0; | 213 | const int num_stereo_streams = channel_count == 2 ? 1 : 0; |
| 214 | return opus_multistream_decoder_get_size(num_streams, num_stereo_streams); | 214 | return opus_multistream_decoder_get_size(num_streams, num_stereo_streams); |
| 215 | } | 215 | } |
diff --git a/src/core/hle/service/caps/caps_u.cpp b/src/core/hle/service/caps/caps_u.cpp index 5fbba8673..1c2694645 100644 --- a/src/core/hle/service/caps/caps_u.cpp +++ b/src/core/hle/service/caps/caps_u.cpp | |||
| @@ -77,8 +77,8 @@ void CAPS_U::GetAlbumContentsFileListForApplication(Kernel::HLERequestContext& c | |||
| 77 | 77 | ||
| 78 | // TODO: Update this when we implement the album. | 78 | // TODO: Update this when we implement the album. |
| 79 | // Currently we do not have a method of accessing album entries, set this to 0 for now. | 79 | // Currently we do not have a method of accessing album entries, set this to 0 for now. |
| 80 | constexpr u32 total_entries_1{}; | 80 | constexpr static u32 total_entries_1{}; |
| 81 | constexpr u32 total_entries_2{}; | 81 | constexpr static u32 total_entries_2{}; |
| 82 | 82 | ||
| 83 | LOG_WARNING( | 83 | LOG_WARNING( |
| 84 | Service_Capture, | 84 | Service_Capture, |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 447d624e1..f95ad9253 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -942,7 +942,7 @@ void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( | |||
| 942 | 942 | ||
| 943 | const auto parameters = rp.PopRaw<Parameters>(); | 943 | const auto parameters = rp.PopRaw<Parameters>(); |
| 944 | // Stub this to None for now, backend needs an impl to read/write the SaveDataExtraData | 944 | // Stub this to None for now, backend needs an impl to read/write the SaveDataExtraData |
| 945 | constexpr auto flags = static_cast<u32>(FileSys::SaveDataFlags::None); | 945 | constexpr static auto flags = static_cast<u32>(FileSys::SaveDataFlags::None); |
| 946 | 946 | ||
| 947 | LOG_WARNING(Service_FS, | 947 | LOG_WARNING(Service_FS, |
| 948 | "(STUBBED) called, flags={}, space_id={}, attribute.title_id={:016X}\n" | 948 | "(STUBBED) called, flags={}, space_id={}, attribute.title_id={:016X}\n" |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index ba6f04d8d..f4485141c 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -439,7 +439,7 @@ void Controller_NPad::RequestPadStateUpdate(Core::HID::NpadIdType npad_id) { | |||
| 439 | using btn = Core::HID::NpadButton; | 439 | using btn = Core::HID::NpadButton; |
| 440 | pad_entry.npad_buttons.raw = btn::None; | 440 | pad_entry.npad_buttons.raw = btn::None; |
| 441 | if (controller_type != Core::HID::NpadStyleIndex::JoyconLeft) { | 441 | if (controller_type != Core::HID::NpadStyleIndex::JoyconLeft) { |
| 442 | constexpr btn right_button_mask = btn::A | btn::B | btn::X | btn::Y | btn::StickR | btn::R | | 442 | constexpr static btn right_button_mask = btn::A | btn::B | btn::X | btn::Y | btn::StickR | btn::R | |
| 443 | btn::ZR | btn::Plus | btn::StickRLeft | btn::StickRUp | | 443 | btn::ZR | btn::Plus | btn::StickRLeft | btn::StickRUp | |
| 444 | btn::StickRRight | btn::StickRDown; | 444 | btn::StickRRight | btn::StickRDown; |
| 445 | pad_entry.npad_buttons.raw = button_state.raw & right_button_mask; | 445 | pad_entry.npad_buttons.raw = button_state.raw & right_button_mask; |
| @@ -447,7 +447,7 @@ void Controller_NPad::RequestPadStateUpdate(Core::HID::NpadIdType npad_id) { | |||
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | if (controller_type != Core::HID::NpadStyleIndex::JoyconRight) { | 449 | if (controller_type != Core::HID::NpadStyleIndex::JoyconRight) { |
| 450 | constexpr btn left_button_mask = | 450 | constexpr static btn left_button_mask = |
| 451 | btn::Left | btn::Up | btn::Right | btn::Down | btn::StickL | btn::L | btn::ZL | | 451 | btn::Left | btn::Up | btn::Right | btn::Down | btn::StickL | btn::L | btn::ZL | |
| 452 | btn::Minus | btn::StickLLeft | btn::StickLUp | btn::StickLRight | btn::StickLDown; | 452 | btn::Minus | btn::StickLLeft | btn::StickLUp | btn::StickLRight | btn::StickLDown; |
| 453 | pad_entry.npad_buttons.raw |= button_state.raw & left_button_mask; | 453 | pad_entry.npad_buttons.raw |= button_state.raw & left_button_mask; |
| @@ -759,7 +759,7 @@ Core::HID::NpadStyleTag Controller_NPad::GetSupportedStyleSet() const { | |||
| 759 | } | 759 | } |
| 760 | 760 | ||
| 761 | Result Controller_NPad::SetSupportedNpadIdTypes(std::span<const u8> data) { | 761 | Result Controller_NPad::SetSupportedNpadIdTypes(std::span<const u8> data) { |
| 762 | constexpr std::size_t max_number_npad_ids = 0xa; | 762 | constexpr static std::size_t max_number_npad_ids = 0xa; |
| 763 | const auto length = data.size(); | 763 | const auto length = data.size(); |
| 764 | ASSERT(length > 0 && (length % sizeof(u32)) == 0); | 764 | ASSERT(length > 0 && (length % sizeof(u32)) == 0); |
| 765 | const std::size_t elements = length / sizeof(u32); | 765 | const std::size_t elements = length / sizeof(u32); |
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp index 3a2fe938f..a1b187b63 100644 --- a/src/core/hle/service/mii/mii_manager.cpp +++ b/src/core/hle/service/mii/mii_manager.cpp | |||
| @@ -670,7 +670,7 @@ ResultVal<std::vector<MiiInfoElement>> MiiManager::GetDefault(SourceFlag source_ | |||
| 670 | } | 670 | } |
| 671 | 671 | ||
| 672 | Result MiiManager::GetIndex([[maybe_unused]] const CharInfo& info, u32& index) { | 672 | Result MiiManager::GetIndex([[maybe_unused]] const CharInfo& info, u32& index) { |
| 673 | constexpr u32 INVALID_INDEX{0xFFFFFFFF}; | 673 | constexpr static u32 INVALID_INDEX{0xFFFFFFFF}; |
| 674 | 674 | ||
| 675 | index = INVALID_INDEX; | 675 | index = INVALID_INDEX; |
| 676 | 676 | ||
diff --git a/src/core/hle/service/nfp/amiibo_crypto.cpp b/src/core/hle/service/nfp/amiibo_crypto.cpp index ffb2f959c..0d9c3d0f6 100644 --- a/src/core/hle/service/nfp/amiibo_crypto.cpp +++ b/src/core/hle/service/nfp/amiibo_crypto.cpp | |||
| @@ -35,7 +35,7 @@ bool IsAmiiboValid(const EncryptedNTAG215File& ntag_file) { | |||
| 35 | LOG_DEBUG(Service_NFP, "tag_CFG1=0x{0:x}", ntag_file.CFG1); | 35 | LOG_DEBUG(Service_NFP, "tag_CFG1=0x{0:x}", ntag_file.CFG1); |
| 36 | 36 | ||
| 37 | // Validate UUID | 37 | // Validate UUID |
| 38 | constexpr u8 CT = 0x88; // As defined in `ISO / IEC 14443 - 3` | 38 | constexpr static u8 CT = 0x88; // As defined in `ISO / IEC 14443 - 3` |
| 39 | if ((CT ^ ntag_file.uuid.uid[0] ^ ntag_file.uuid.uid[1] ^ ntag_file.uuid.uid[2]) != | 39 | if ((CT ^ ntag_file.uuid.uid[0] ^ ntag_file.uuid.uid[1] ^ ntag_file.uuid.uid[2]) != |
| 40 | ntag_file.uuid.uid[3]) { | 40 | ntag_file.uuid.uid[3]) { |
| 41 | return false; | 41 | return false; |
| @@ -247,7 +247,7 @@ void Cipher(const DerivedKeys& keys, const NTAG215File& in_data, NTAG215File& ou | |||
| 247 | mbedtls_aes_setkey_enc(&aes, keys.aes_key.data(), aes_key_size); | 247 | mbedtls_aes_setkey_enc(&aes, keys.aes_key.data(), aes_key_size); |
| 248 | memcpy(nonce_counter.data(), keys.aes_iv.data(), sizeof(keys.aes_iv)); | 248 | memcpy(nonce_counter.data(), keys.aes_iv.data(), sizeof(keys.aes_iv)); |
| 249 | 249 | ||
| 250 | constexpr std::size_t encrypted_data_size = HMAC_TAG_START - SETTINGS_START; | 250 | constexpr static std::size_t encrypted_data_size = HMAC_TAG_START - SETTINGS_START; |
| 251 | mbedtls_aes_crypt_ctr(&aes, encrypted_data_size, &nc_off, nonce_counter.data(), | 251 | mbedtls_aes_crypt_ctr(&aes, encrypted_data_size, &nc_off, nonce_counter.data(), |
| 252 | stream_block.data(), | 252 | stream_block.data(), |
| 253 | reinterpret_cast<const unsigned char*>(&in_data.settings), | 253 | reinterpret_cast<const unsigned char*>(&in_data.settings), |
| @@ -317,13 +317,13 @@ bool DecodeAmiibo(const EncryptedNTAG215File& encrypted_tag_data, NTAG215File& t | |||
| 317 | Cipher(data_keys, encoded_data, tag_data); | 317 | Cipher(data_keys, encoded_data, tag_data); |
| 318 | 318 | ||
| 319 | // Regenerate tag HMAC. Note: order matters, data HMAC depends on tag HMAC! | 319 | // Regenerate tag HMAC. Note: order matters, data HMAC depends on tag HMAC! |
| 320 | constexpr std::size_t input_length = DYNAMIC_LOCK_START - UUID_START; | 320 | constexpr static std::size_t input_length = DYNAMIC_LOCK_START - UUID_START; |
| 321 | mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), tag_keys.hmac_key.data(), | 321 | mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), tag_keys.hmac_key.data(), |
| 322 | sizeof(HmacKey), reinterpret_cast<const unsigned char*>(&tag_data.uid), | 322 | sizeof(HmacKey), reinterpret_cast<const unsigned char*>(&tag_data.uid), |
| 323 | input_length, reinterpret_cast<unsigned char*>(&tag_data.hmac_tag)); | 323 | input_length, reinterpret_cast<unsigned char*>(&tag_data.hmac_tag)); |
| 324 | 324 | ||
| 325 | // Regenerate data HMAC | 325 | // Regenerate data HMAC |
| 326 | constexpr std::size_t input_length2 = DYNAMIC_LOCK_START - WRITE_COUNTER_START; | 326 | constexpr static std::size_t input_length2 = DYNAMIC_LOCK_START - WRITE_COUNTER_START; |
| 327 | mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), data_keys.hmac_key.data(), | 327 | mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), data_keys.hmac_key.data(), |
| 328 | sizeof(HmacKey), | 328 | sizeof(HmacKey), |
| 329 | reinterpret_cast<const unsigned char*>(&tag_data.write_counter), input_length2, | 329 | reinterpret_cast<const unsigned char*>(&tag_data.write_counter), input_length2, |
| @@ -357,8 +357,8 @@ bool EncodeAmiibo(const NTAG215File& tag_data, EncryptedNTAG215File& encrypted_t | |||
| 357 | NTAG215File encoded_tag_data{}; | 357 | NTAG215File encoded_tag_data{}; |
| 358 | 358 | ||
| 359 | // Generate tag HMAC | 359 | // Generate tag HMAC |
| 360 | constexpr std::size_t input_length = DYNAMIC_LOCK_START - UUID_START; | 360 | constexpr static std::size_t input_length = DYNAMIC_LOCK_START - UUID_START; |
| 361 | constexpr std::size_t input_length2 = HMAC_TAG_START - WRITE_COUNTER_START; | 361 | constexpr static std::size_t input_length2 = HMAC_TAG_START - WRITE_COUNTER_START; |
| 362 | mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), tag_keys.hmac_key.data(), | 362 | mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), tag_keys.hmac_key.data(), |
| 363 | sizeof(HmacKey), reinterpret_cast<const unsigned char*>(&tag_data.uid), | 363 | sizeof(HmacKey), reinterpret_cast<const unsigned char*>(&tag_data.uid), |
| 364 | input_length, reinterpret_cast<unsigned char*>(&encoded_tag_data.hmac_tag)); | 364 | input_length, reinterpret_cast<unsigned char*>(&encoded_tag_data.hmac_tag)); |
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 5d32adf64..df4f60d59 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp | |||
| @@ -512,7 +512,7 @@ void IGeneralService::GetInternetConnectionStatus(Kernel::HLERequestContext& ctx | |||
| 512 | }; | 512 | }; |
| 513 | static_assert(sizeof(Output) == 0x3, "Output has incorrect size."); | 513 | static_assert(sizeof(Output) == 0x3, "Output has incorrect size."); |
| 514 | 514 | ||
| 515 | constexpr Output out{}; | 515 | constexpr static Output out{}; |
| 516 | 516 | ||
| 517 | IPC::ResponseBuilder rb{ctx, 3}; | 517 | IPC::ResponseBuilder rb{ctx, 3}; |
| 518 | rb.Push(ResultSuccess); | 518 | rb.Push(ResultSuccess); |
diff --git a/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp b/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp index aba51d280..1f0e05df6 100644 --- a/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp +++ b/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp | |||
| @@ -9,8 +9,8 @@ | |||
| 9 | namespace Service::Nvidia::NvCore { | 9 | namespace Service::Nvidia::NvCore { |
| 10 | 10 | ||
| 11 | SyncpointManager::SyncpointManager(Tegra::Host1x::Host1x& host1x_) : host1x{host1x_} { | 11 | SyncpointManager::SyncpointManager(Tegra::Host1x::Host1x& host1x_) : host1x{host1x_} { |
| 12 | constexpr u32 VBlank0SyncpointId{26}; | 12 | constexpr static u32 VBlank0SyncpointId{26}; |
| 13 | constexpr u32 VBlank1SyncpointId{27}; | 13 | constexpr static u32 VBlank1SyncpointId{27}; |
| 14 | 14 | ||
| 15 | // Reserve both vblank syncpoints as client managed as they use Continuous Mode | 15 | // Reserve both vblank syncpoints as client managed as they use Continuous Mode |
| 16 | // Refer to section 14.3.5.3 of the TRM for more information on Continuous Mode | 16 | // Refer to section 14.3.5.3 of the TRM for more information on Continuous Mode |
diff --git a/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp b/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp index 0767e548d..3f41aa0d9 100644 --- a/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp +++ b/src/core/hle/service/nvflinger/buffer_queue_consumer.cpp | |||
| @@ -45,7 +45,7 @@ Status BufferQueueConsumer::AcquireBuffer(BufferItem* out_buffer, | |||
| 45 | 45 | ||
| 46 | // If expected_present is specified, we may not want to return a buffer yet. | 46 | // If expected_present is specified, we may not want to return a buffer yet. |
| 47 | if (expected_present.count() != 0) { | 47 | if (expected_present.count() != 0) { |
| 48 | constexpr auto MAX_REASONABLE_NSEC = 1000000000LL; // 1 second | 48 | constexpr static auto MAX_REASONABLE_NSEC = 1000000000LL; // 1 second |
| 49 | 49 | ||
| 50 | // The expected_present argument indicates when the buffer is expected to be presented | 50 | // The expected_present argument indicates when the buffer is expected to be presented |
| 51 | // on-screen. | 51 | // on-screen. |
diff --git a/src/core/hle/service/olsc/olsc.cpp b/src/core/hle/service/olsc/olsc.cpp index 530e1be3b..fbae10e7d 100644 --- a/src/core/hle/service/olsc/olsc.cpp +++ b/src/core/hle/service/olsc/olsc.cpp | |||
| @@ -55,7 +55,7 @@ private: | |||
| 55 | LOG_WARNING(Service_OLSC, "(STUBBED) called"); | 55 | LOG_WARNING(Service_OLSC, "(STUBBED) called"); |
| 56 | 56 | ||
| 57 | // backup_setting is set to 0 since real value is unknown | 57 | // backup_setting is set to 0 since real value is unknown |
| 58 | constexpr u64 backup_setting = 0; | 58 | constexpr static u64 backup_setting = 0; |
| 59 | 59 | ||
| 60 | IPC::ResponseBuilder rb{ctx, 4}; | 60 | IPC::ResponseBuilder rb{ctx, 4}; |
| 61 | rb.Push(ResultSuccess); | 61 | rb.Push(ResultSuccess); |
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index 01040b32a..155d6a00b 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp | |||
| @@ -116,7 +116,7 @@ private: | |||
| 116 | void GetTransmissionStatus(Kernel::HLERequestContext& ctx) { | 116 | void GetTransmissionStatus(Kernel::HLERequestContext& ctx) { |
| 117 | LOG_WARNING(Service_PREPO, "(STUBBED) called"); | 117 | LOG_WARNING(Service_PREPO, "(STUBBED) called"); |
| 118 | 118 | ||
| 119 | constexpr s32 status = 0; | 119 | constexpr static s32 status = 0; |
| 120 | 120 | ||
| 121 | IPC::ResponseBuilder rb{ctx, 3}; | 121 | IPC::ResponseBuilder rb{ctx, 3}; |
| 122 | rb.Push(ResultSuccess); | 122 | rb.Push(ResultSuccess); |
| @@ -126,7 +126,7 @@ private: | |||
| 126 | void GetSystemSessionId(Kernel::HLERequestContext& ctx) { | 126 | void GetSystemSessionId(Kernel::HLERequestContext& ctx) { |
| 127 | LOG_WARNING(Service_PREPO, "(STUBBED) called"); | 127 | LOG_WARNING(Service_PREPO, "(STUBBED) called"); |
| 128 | 128 | ||
| 129 | constexpr u64 system_session_id = 0; | 129 | constexpr static u64 system_session_id = 0; |
| 130 | IPC::ResponseBuilder rb{ctx, 4}; | 130 | IPC::ResponseBuilder rb{ctx, 4}; |
| 131 | rb.Push(ResultSuccess); | 131 | rb.Push(ResultSuccess); |
| 132 | rb.Push(system_session_id); | 132 | rb.Push(system_session_id); |
diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp index e96eda7f3..831a51a67 100644 --- a/src/core/hle/service/sockets/sfdnsres.cpp +++ b/src/core/hle/service/sockets/sfdnsres.cpp | |||
| @@ -92,7 +92,7 @@ static std::vector<u8> SerializeAddrInfo(const addrinfo* addrinfo, s32 result_co | |||
| 92 | static_assert(sizeof(SerializedResponseHeader) == 0x18, | 92 | static_assert(sizeof(SerializedResponseHeader) == 0x18, |
| 93 | "Response header size must be 0x18 bytes"); | 93 | "Response header size must be 0x18 bytes"); |
| 94 | 94 | ||
| 95 | constexpr auto header_size = sizeof(SerializedResponseHeader); | 95 | constexpr static auto header_size = sizeof(SerializedResponseHeader); |
| 96 | const auto addr_size = | 96 | const auto addr_size = |
| 97 | current->ai_addr && current->ai_addrlen > 0 ? current->ai_addrlen : 4; | 97 | current->ai_addr && current->ai_addrlen > 0 ? current->ai_addrlen : 4; |
| 98 | const auto canonname_size = current->ai_canonname ? strlen(current->ai_canonname) + 1 : 1; | 98 | const auto canonname_size = current->ai_canonname ? strlen(current->ai_canonname) + 1 : 1; |
| @@ -103,7 +103,7 @@ static std::vector<u8> SerializeAddrInfo(const addrinfo* addrinfo, s32 result_co | |||
| 103 | // Header in network byte order | 103 | // Header in network byte order |
| 104 | SerializedResponseHeader header{}; | 104 | SerializedResponseHeader header{}; |
| 105 | 105 | ||
| 106 | constexpr auto HEADER_MAGIC = 0xBEEFCAFE; | 106 | constexpr static auto HEADER_MAGIC = 0xBEEFCAFE; |
| 107 | header.magic = htonl(HEADER_MAGIC); | 107 | header.magic = htonl(HEADER_MAGIC); |
| 108 | header.family = htonl(current->ai_family); | 108 | header.family = htonl(current->ai_family); |
| 109 | header.flags = htonl(current->ai_flags); | 109 | header.flags = htonl(current->ai_flags); |
diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index dcf47083f..ceb491224 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp | |||
| @@ -103,7 +103,7 @@ private: | |||
| 103 | const auto certificate_format = rp.PopEnum<CertificateFormat>(); | 103 | const auto certificate_format = rp.PopEnum<CertificateFormat>(); |
| 104 | [[maybe_unused]] const auto pkcs_12_certificates = ctx.ReadBuffer(0); | 104 | [[maybe_unused]] const auto pkcs_12_certificates = ctx.ReadBuffer(0); |
| 105 | 105 | ||
| 106 | constexpr u64 server_id = 0; | 106 | constexpr static u64 server_id = 0; |
| 107 | 107 | ||
| 108 | LOG_WARNING(Service_SSL, "(STUBBED) called, certificate_format={}", certificate_format); | 108 | LOG_WARNING(Service_SSL, "(STUBBED) called, certificate_format={}", certificate_format); |
| 109 | 109 | ||
| @@ -122,7 +122,7 @@ private: | |||
| 122 | return std::span<const u8>{}; | 122 | return std::span<const u8>{}; |
| 123 | }(); | 123 | }(); |
| 124 | 124 | ||
| 125 | constexpr u64 client_id = 0; | 125 | constexpr static u64 client_id = 0; |
| 126 | 126 | ||
| 127 | LOG_WARNING(Service_SSL, "(STUBBED) called"); | 127 | LOG_WARNING(Service_SSL, "(STUBBED) called"); |
| 128 | 128 | ||
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index f9ada7c93..7b94b33f7 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp | |||
| @@ -286,7 +286,7 @@ static constexpr int TransitionTime(int year, Rule rule, int offset) { | |||
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | static bool ParsePosixName(const char* name, TimeZoneRule& rule) { | 288 | static bool ParsePosixName(const char* name, TimeZoneRule& rule) { |
| 289 | constexpr char default_rule[]{",M4.1.0,M10.5.0"}; | 289 | constexpr static char default_rule[]{",M4.1.0,M10.5.0"}; |
| 290 | const char* std_name{name}; | 290 | const char* std_name{name}; |
| 291 | int std_len{}; | 291 | int std_len{}; |
| 292 | int offset{}; | 292 | int offset{}; |
| @@ -512,8 +512,8 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi | |||
| 512 | return {}; | 512 | return {}; |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | constexpr s32 time_zone_max_leaps{50}; | 515 | constexpr static s32 time_zone_max_leaps{50}; |
| 516 | constexpr s32 time_zone_max_chars{50}; | 516 | constexpr static s32 time_zone_max_chars{50}; |
| 517 | if (!(0 <= header.leap_count && header.leap_count < time_zone_max_leaps && | 517 | if (!(0 <= header.leap_count && header.leap_count < time_zone_max_leaps && |
| 518 | 0 < header.type_count && header.type_count < s32(time_zone_rule.ttis.size()) && | 518 | 0 < header.type_count && header.type_count < s32(time_zone_rule.ttis.size()) && |
| 519 | 0 <= header.time_count && header.time_count < s32(time_zone_rule.ats.size()) && | 519 | 0 <= header.time_count && header.time_count < s32(time_zone_rule.ats.size()) && |
| @@ -610,7 +610,7 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi | |||
| 610 | if (bytes_read < 0) { | 610 | if (bytes_read < 0) { |
| 611 | return {}; | 611 | return {}; |
| 612 | } | 612 | } |
| 613 | constexpr s32 time_zone_name_max{255}; | 613 | constexpr static s32 time_zone_name_max{255}; |
| 614 | if (bytes_read > (time_zone_name_max + 1)) { | 614 | if (bytes_read > (time_zone_name_max + 1)) { |
| 615 | return {}; | 615 | return {}; |
| 616 | } | 616 | } |
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 2fb631183..66c8fd38a 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -725,8 +725,8 @@ private: | |||
| 725 | 725 | ||
| 726 | // TODO: Figure out what these are | 726 | // TODO: Figure out what these are |
| 727 | 727 | ||
| 728 | constexpr s64 unknown_result_1 = 0; | 728 | constexpr static s64 unknown_result_1 = 0; |
| 729 | constexpr s64 unknown_result_2 = 0; | 729 | constexpr static s64 unknown_result_2 = 0; |
| 730 | 730 | ||
| 731 | IPC::ResponseBuilder rb{ctx, 6}; | 731 | IPC::ResponseBuilder rb{ctx, 6}; |
| 732 | rb.Push(unknown_result_1); | 732 | rb.Push(unknown_result_1); |
| @@ -740,8 +740,8 @@ private: | |||
| 740 | const auto height = rp.Pop<u64>(); | 740 | const auto height = rp.Pop<u64>(); |
| 741 | LOG_DEBUG(Service_VI, "called width={}, height={}", width, height); | 741 | LOG_DEBUG(Service_VI, "called width={}, height={}", width, height); |
| 742 | 742 | ||
| 743 | constexpr u64 base_size = 0x20000; | 743 | constexpr static u64 base_size = 0x20000; |
| 744 | constexpr u64 alignment = 0x1000; | 744 | constexpr static u64 alignment = 0x1000; |
| 745 | const auto texture_size = width * height * 4; | 745 | const auto texture_size = width * height * 4; |
| 746 | const auto out_size = (texture_size + base_size - 1) / base_size * base_size; | 746 | const auto out_size = (texture_size + base_size - 1) / base_size * base_size; |
| 747 | 747 | ||