From 0691971d82b657afa3543cd18eb6375ca68b0f35 Mon Sep 17 00:00:00 2001 From: spycrab Date: Fri, 25 Jan 2019 17:33:17 +0100 Subject: [PATCH] Core: Fix some warnings --- Source/Core/Core/Analytics.cpp | 2 +- Source/Core/Core/HW/Sram.cpp | 4 +++- Source/Core/Core/HW/SystemTimers.cpp | 3 ++- Source/Core/Core/NetPlayClient.cpp | 5 +++-- Source/Core/Core/NetPlayServer.cpp | 12 ++++++------ 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Source/Core/Core/Analytics.cpp b/Source/Core/Core/Analytics.cpp index e6f9db25c2..32157cf1ac 100644 --- a/Source/Core/Core/Analytics.cpp +++ b/Source/Core/Core/Analytics.cpp @@ -137,7 +137,7 @@ void DolphinAnalytics::ReportGameStart() } // Keep in sync with enum class GameQuirk definition. -const char* GAME_QUIRKS_NAMES[] = { +static const char* GAME_QUIRKS_NAMES[] = { "icache-matters", // ICACHE_MATTERS }; static_assert(sizeof(GAME_QUIRKS_NAMES) / sizeof(GAME_QUIRKS_NAMES[0]) == diff --git a/Source/Core/Core/HW/Sram.cpp b/Source/Core/Core/HW/Sram.cpp index 51ce971230..2c2be5f336 100644 --- a/Source/Core/Core/HW/Sram.cpp +++ b/Source/Core/Core/HW/Sram.cpp @@ -12,9 +12,10 @@ // English // 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{0}, {Common::BigEndianValue{0x2c}, Common::BigEndianValue{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', 'B'}, @@ -26,6 +27,7 @@ const Sram sram_dump = {Common::BigEndianValue{0}, {0x6E, 0x6D}, 0, {}}}; +// clang-format on #if 0 // german diff --git a/Source/Core/Core/HW/SystemTimers.cpp b/Source/Core/Core/HW/SystemTimers.cpp index eedaa8a0c8..3a0b3192a8 100644 --- a/Source/Core/Core/HW/SystemTimers.cpp +++ b/Source/Core/Core/HW/SystemTimers.cpp @@ -46,6 +46,7 @@ IPC_HLE_PERIOD: For the Wii Remote this is the call schedule: #include "Core/HW/SystemTimers.h" #include +#include #include #include @@ -192,7 +193,7 @@ void ThrottleCallback(u64 last_time, s64 cyclesLate) const s64 max_fallback = config.iTimingVariance * 1000; 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); last_time = time - max_fallback; } diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index c18b56ff13..85a577fca2 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -2184,12 +2184,13 @@ void SetupWiimotes() ASSERT(IsNetPlayRunning()); const NetSettings& netplay_settings = netplay_client->GetNetSettings(); 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) { static_cast( - static_cast(Wiimote::GetConfig()->GetController(i)) + static_cast( + Wiimote::GetConfig()->GetController(static_cast(i))) ->GetWiimoteGroup(WiimoteEmu::WiimoteGroup::Extension)) ->switch_extension = netplay_settings.m_WiimoteExtension[i]; } diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index 206936ed1d..9a96346f0f 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -1215,13 +1215,13 @@ bool NetPlayServer::StartGame() spac << m_settings.m_SyncCodes; 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 = - static_cast( - static_cast(Wiimote::GetConfig()->GetController(i)) - ->GetWiimoteGroup(WiimoteEmu::WiimoteGroup::Extension)) - ->switch_extension; + const int extension = static_cast( + static_cast( + Wiimote::GetConfig()->GetController(static_cast(i))) + ->GetWiimoteGroup(WiimoteEmu::WiimoteGroup::Extension)) + ->switch_extension; spac << extension; }