Merge pull request #13363 from JoshuaVandaele/nowarnings

Fix multiple minor warnings
This commit is contained in:
JMC47 2025-03-10 15:04:14 -04:00 committed by GitHub
commit 189d09011b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 7 deletions

View File

@ -910,7 +910,7 @@ void AchievementManager::LeaderboardEntriesCallback(int result, const char* erro
map_entry.username.assign(response_entry.user);
memcpy(map_entry.score.data(), response_entry.display, FORMAT_SIZE);
map_entry.rank = response_entry.rank;
if (ix == list->user_index)
if (static_cast<int32_t>(ix) == list->user_index)
leaderboard.player_index = response_entry.rank;
}
AchievementManager::GetInstance().m_update_callback({.leaderboards = {*leaderboard_id}});

View File

@ -509,6 +509,8 @@ void SerialInterfaceManager::ChangeDevice(SIDevices device, int channel)
void SerialInterfaceManager::ChangeDeviceDeterministic(SIDevices device, int channel)
{
if (channel < 0 || channel >= MAX_SI_CHANNELS)
return;
if (m_channel[channel].has_recent_device_change)
return;

View File

@ -4,6 +4,7 @@
#include "Core/NetPlayClient.h"
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstring>
#include <fstream>
@ -2668,9 +2669,10 @@ std::string GetPlayerMappingString(PlayerId pid, const PadMappingArray& pad_map,
wiimote_slots.push_back(i + 1);
}
std::vector<std::string> groups;
for (const auto& [group_name, slots] :
{std::make_pair("GC", &gc_slots), std::make_pair("GBA", &gba_slots),
std::make_pair("Wii", &wiimote_slots)})
std::array<std::pair<std::string, std::vector<size_t>*>, 3> slot_groups = {
{{"GC", &gc_slots}, {"GBA", &gba_slots}, {"Wii", &wiimote_slots}}};
for (const auto& [group_name, slots] : slot_groups)
{
if (!slots->empty())
groups.emplace_back(fmt::format("{}{}", group_name, fmt::join(*slots, ",")));

View File

@ -26,12 +26,12 @@ using namespace ciface::Core;
class ControlExpression;
// Check if operator is usable with assignment, e.g. += -= *=
bool IsCompoundAssignmentUsableBinaryOperator(TokenType type)
static bool IsCompoundAssignmentUsableBinaryOperator(TokenType type)
{
return type >= TOK_COMPOUND_ASSIGN_OPS_BEGIN && type < TOK_COMPOUND_ASSIGN_OPS_END;
}
TokenType GetBinaryOperatorTokenTypeFromChar(char c)
static TokenType GetBinaryOperatorTokenTypeFromChar(char c)
{
switch (c)
{
@ -744,7 +744,7 @@ ParseResult ParseResult::MakeErrorResult(Token token, std::string description)
return result;
}
bool IsInertToken(const Token& tok)
static bool IsInertToken(const Token& tok)
{
return tok.type == TOK_COMMENT || tok.type == TOK_WHITESPACE;
}