Merge pull request #8536 from leoetlino/warnings

Fix several warnings
This commit is contained in:
Connor McLaughlin 2020-01-04 21:24:27 +10:00 committed by GitHub
commit 04e9279f3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 12 additions and 12 deletions

View File

@ -35,7 +35,7 @@ using ReadLock = std::shared_lock<std::shared_mutex>;
using WriteLock = std::unique_lock<std::shared_mutex>; using WriteLock = std::unique_lock<std::shared_mutex>;
#endif #endif
void AddLayerInternal(std::shared_ptr<Layer> layer) static void AddLayerInternal(std::shared_ptr<Layer> layer)
{ {
{ {
WriteLock lock(s_layers_rw_lock); WriteLock lock(s_layers_rw_lock);

View File

@ -425,6 +425,8 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
case DiscIO::Region::NTSC_K: case DiscIO::Region::NTSC_K:
Config::SetCurrent(Config::SYSCONF_COUNTRY, 0x88); // South Korea Config::SetCurrent(Config::SYSCONF_COUNTRY, 0x88); // South Korea
break; break;
case DiscIO::Region::Unknown:
break;
} }
} }
} }

View File

@ -303,7 +303,7 @@ private:
struct SmallBlockAccessors : Accessors struct SmallBlockAccessors : Accessors
{ {
SmallBlockAccessors(u8** alloc_base, u32 size) : alloc_base(alloc_base), size(size) {} SmallBlockAccessors(u8** alloc_base_, u32 size_) : alloc_base{alloc_base_}, size{size_} {}
bool IsValidAddress(u32 address) const override bool IsValidAddress(u32 address) const override
{ {

View File

@ -321,7 +321,7 @@ bool GCMemcard::Save()
return mcdFile.Close(); return mcdFile.Close();
} }
std::pair<u16, u16> CalculateMemcardChecksums(const u8* data, size_t size) static std::pair<u16, u16> CalculateMemcardChecksums(const u8* data, size_t size)
{ {
assert(size % 2 == 0); assert(size % 2 == 0);
u16 csum = 0; u16 csum = 0;

View File

@ -211,7 +211,7 @@ void WiimoteDevice::Activate(bool ready)
void WiimoteDevice::EventConnectionAccepted() void WiimoteDevice::EventConnectionAccepted()
{ {
DEBUG_LOG(IOS_WIIMOTE, "ConnectionState %x -> CONN_LINKING", m_connection_state); DEBUG_LOG(IOS_WIIMOTE, "ConnectionState %x -> CONN_LINKING", int(m_connection_state));
m_connection_state = ConnectionState::Linking; m_connection_state = ConnectionState::Linking;
} }

View File

@ -176,9 +176,9 @@ constexpr std::array<u8, 256> s_key_codes_azerty{};
#endif #endif
} // Anonymous namespace } // Anonymous namespace
USB_KBD::MessageData::MessageData(MessageType type, u8 modifiers, PressedKeyData pressed_keys) USB_KBD::MessageData::MessageData(MessageType type, u8 modifiers_, PressedKeyData pressed_keys_)
: msg_type{Common::swap32(static_cast<u32>(type))}, modifiers{modifiers}, pressed_keys{ : msg_type{Common::swap32(static_cast<u32>(type))}, modifiers{modifiers_}, pressed_keys{
pressed_keys} pressed_keys_}
{ {
} }

View File

@ -53,7 +53,7 @@ public:
{ {
T temp; T temp;
if (!Read(offset, sizeof(T), reinterpret_cast<u8*>(&temp))) if (!Read(offset, sizeof(T), reinterpret_cast<u8*>(&temp)))
return {}; return std::nullopt;
return Common::FromBigEndian(temp); return Common::FromBigEndian(temp);
} }

View File

@ -451,7 +451,7 @@ void DirectoryBlobReader::SetWiiRegionData(const std::string& game_partition_roo
ERROR_LOG(DISCIO, "Couldn't read age ratings from %s", region_bin_path.c_str()); ERROR_LOG(DISCIO, "Couldn't read age ratings from %s", region_bin_path.c_str());
constexpr u64 WII_REGION_DATA_ADDRESS = 0x4E000; constexpr u64 WII_REGION_DATA_ADDRESS = 0x4E000;
constexpr u64 WII_REGION_DATA_SIZE = 0x20; [[maybe_unused]] constexpr u64 WII_REGION_DATA_SIZE = 0x20;
m_nonpartition_contents.Add(WII_REGION_DATA_ADDRESS, m_wii_region_data); m_nonpartition_contents.Add(WII_REGION_DATA_ADDRESS, m_wii_region_data);
} }

View File

@ -50,7 +50,7 @@ public:
{ {
T temp; T temp;
if (!Read(offset, sizeof(T), reinterpret_cast<u8*>(&temp), partition)) if (!Read(offset, sizeof(T), reinterpret_cast<u8*>(&temp), partition))
return {}; return std::nullopt;
return Common::FromBigEndian(temp); return Common::FromBigEndian(temp);
} }
std::optional<u64> ReadSwappedAndShifted(u64 offset, const Partition& partition) const std::optional<u64> ReadSwappedAndShifted(u64 offset, const Partition& partition) const

View File

@ -88,11 +88,9 @@ void RedumpVerifier::Start(const Volume& volume)
return {}; return {};
} }
DownloadStatus status;
{ {
std::lock_guard lk(download_state->mutex); std::lock_guard lk(download_state->mutex);
download_state->status = DownloadDatfile(system, download_state->status); download_state->status = DownloadDatfile(system, download_state->status);
status = download_state->status;
} }
switch (download_state->status) switch (download_state->status)