misc: fix issues pointed out by msvc (#7316)

* do not move constant variables

* applet_manager: avoid possible use after move

* use constant references where pointed out by msvc

* extra_hid: initialize response

* ValidateSaveState: passing slot separately is not necessary

* common: mark HashCombine as nodiscard

* cityhash: remove use of using namespace std

* Prefix all size_t with std::

done automatically by executing regex replace `([^:0-9a-zA-Z_])size_t([^0-9a-zA-Z_])` -> `$1std::size_t$2`
based on 7d8f115

* shared_memory.cpp: fix log error format

* fix compiling with pch off
This commit is contained in:
Vitor K
2024-01-07 17:37:42 -03:00
committed by GitHub
parent 6069fac76d
commit c8c2beaeff
73 changed files with 181 additions and 167 deletions

View File

@ -48,8 +48,8 @@ static std::string GetSaveStatePath(u64 program_id, u64 movie_id, u32 slot) {
}
static bool ValidateSaveState(const CSTHeader& header, SaveStateInfo& info, u64 program_id,
u64 movie_id, u32 slot) {
const auto path = GetSaveStatePath(program_id, movie_id, slot);
u64 movie_id) {
const auto path = GetSaveStatePath(program_id, movie_id, info.slot);
if (header.filetype != header_magic_bytes) {
LOG_WARNING(Core, "Invalid save state file {}", path);
return false;
@ -112,7 +112,7 @@ std::vector<SaveStateInfo> ListSaveStates(u64 program_id, u64 movie_id) {
LOG_ERROR(Core, "Could not read from file {}", path);
continue;
}
if (!ValidateSaveState(header, info, program_id, movie_id, slot)) {
if (!ValidateSaveState(header, info, program_id, movie_id)) {
continue;
}
@ -185,7 +185,8 @@ void System::LoadState(u32 slot) {
// validate header
SaveStateInfo info;
if (!ValidateSaveState(header, info, title_id, movie_id, slot)) {
info.slot = slot;
if (!ValidateSaveState(header, info, title_id, movie_id)) {
throw std::runtime_error("Invalid savestate");
}