Merge pull request #7738 from spycrab/core_warnings

Core: Fix some warnings
This commit is contained in:
Tilka 2019-02-02 14:13:21 +00:00 committed by GitHub
commit 28c0b5338e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 11 deletions

View File

@ -137,7 +137,7 @@ void DolphinAnalytics::ReportGameStart()
} }
// Keep in sync with enum class GameQuirk definition. // Keep in sync with enum class GameQuirk definition.
const char* GAME_QUIRKS_NAMES[] = { static const char* GAME_QUIRKS_NAMES[] = {
"icache-matters", // ICACHE_MATTERS "icache-matters", // ICACHE_MATTERS
}; };
static_assert(sizeof(GAME_QUIRKS_NAMES) / sizeof(GAME_QUIRKS_NAMES[0]) == static_assert(sizeof(GAME_QUIRKS_NAMES) / sizeof(GAME_QUIRKS_NAMES[0]) ==

View File

@ -12,9 +12,10 @@
// English // English
// This is just a template. Most/all fields are updated with sane(r) values at runtime. // This is just a template. Most/all fields are updated with sane(r) values at runtime.
// clang-format off
const Sram sram_dump = {Common::BigEndianValue<u32>{0}, const Sram sram_dump = {Common::BigEndianValue<u32>{0},
{Common::BigEndianValue<u16>{0x2c}, Common::BigEndianValue<u16>{0xffd0}, 0, {Common::BigEndianValue<u16>{0x2c}, Common::BigEndianValue<u16>{0xffd0}, 0,
0, 0, 0, 0, 0, 0x20 | SramFlags::kOobeDone | SramFlags::kStereo}, 0, 0, 0, 0, 0, {0x20 | SramFlags::kOobeDone | SramFlags::kStereo}},
{{ {{
{'D', 'O', 'L', 'P', 'H', 'I', 'N', 'S', 'L', 'O', 'T', 'A'}, {'D', 'O', 'L', 'P', 'H', 'I', 'N', 'S', 'L', 'O', 'T', 'A'},
{'D', 'O', 'L', 'P', 'H', 'I', 'N', 'S', 'L', 'O', 'T', 'B'}, {'D', 'O', 'L', 'P', 'H', 'I', 'N', 'S', 'L', 'O', 'T', 'B'},
@ -26,6 +27,7 @@ const Sram sram_dump = {Common::BigEndianValue<u32>{0},
{0x6E, 0x6D}, {0x6E, 0x6D},
0, 0,
{}}}; {}}};
// clang-format on
#if 0 #if 0
// german // german

View File

@ -46,6 +46,7 @@ IPC_HLE_PERIOD: For the Wii Remote this is the call schedule:
#include "Core/HW/SystemTimers.h" #include "Core/HW/SystemTimers.h"
#include <cfloat> #include <cfloat>
#include <cinttypes>
#include <cmath> #include <cmath>
#include <cstdlib> #include <cstdlib>
@ -192,7 +193,7 @@ void ThrottleCallback(u64 last_time, s64 cyclesLate)
const s64 max_fallback = config.iTimingVariance * 1000; const s64 max_fallback = config.iTimingVariance * 1000;
if (abs(diff) > max_fallback) if (abs(diff) > max_fallback)
{ {
DEBUG_LOG(COMMON, "system too %s, %ld ms skipped", diff < 0 ? "slow" : "fast", DEBUG_LOG(COMMON, "system too %s, %" PRIi64 " ms skipped", diff < 0 ? "slow" : "fast",
abs(diff) - max_fallback); abs(diff) - max_fallback);
last_time = time - max_fallback; last_time = time - max_fallback;
} }

View File

@ -2184,12 +2184,13 @@ void SetupWiimotes()
ASSERT(IsNetPlayRunning()); ASSERT(IsNetPlayRunning());
const NetSettings& netplay_settings = netplay_client->GetNetSettings(); const NetSettings& netplay_settings = netplay_client->GetNetSettings();
const PadMappingArray& wiimote_map = netplay_client->GetWiimoteMapping(); const PadMappingArray& wiimote_map = netplay_client->GetWiimoteMapping();
for (int i = 0; i < netplay_settings.m_WiimoteExtension.size(); i++) for (size_t i = 0; i < netplay_settings.m_WiimoteExtension.size(); i++)
{ {
if (wiimote_map[i] > 0) if (wiimote_map[i] > 0)
{ {
static_cast<ControllerEmu::Extension*>( static_cast<ControllerEmu::Extension*>(
static_cast<WiimoteEmu::Wiimote*>(Wiimote::GetConfig()->GetController(i)) static_cast<WiimoteEmu::Wiimote*>(
Wiimote::GetConfig()->GetController(static_cast<int>(i)))
->GetWiimoteGroup(WiimoteEmu::WiimoteGroup::Extension)) ->GetWiimoteGroup(WiimoteEmu::WiimoteGroup::Extension))
->switch_extension = netplay_settings.m_WiimoteExtension[i]; ->switch_extension = netplay_settings.m_WiimoteExtension[i];
} }

View File

@ -1215,13 +1215,13 @@ bool NetPlayServer::StartGame()
spac << m_settings.m_SyncCodes; spac << m_settings.m_SyncCodes;
spac << m_settings.m_SyncAllWiiSaves; spac << m_settings.m_SyncAllWiiSaves;
for (int i = 0; i < m_settings.m_WiimoteExtension.size(); i++) for (size_t i = 0; i < m_settings.m_WiimoteExtension.size(); i++)
{ {
const int extension = const int extension = static_cast<ControllerEmu::Extension*>(
static_cast<ControllerEmu::Extension*>( static_cast<WiimoteEmu::Wiimote*>(
static_cast<WiimoteEmu::Wiimote*>(Wiimote::GetConfig()->GetController(i)) Wiimote::GetConfig()->GetController(static_cast<int>(i)))
->GetWiimoteGroup(WiimoteEmu::WiimoteGroup::Extension)) ->GetWiimoteGroup(WiimoteEmu::WiimoteGroup::Extension))
->switch_extension; ->switch_extension;
spac << extension; spac << extension;
} }