fix: get rid of some more warnings (#5672)

This commit is contained in:
nerix
2024-10-27 13:42:23 +01:00
committed by GitHub
parent 74a385dfee
commit bbcd8c5eb2
21 changed files with 79 additions and 64 deletions
+3 -3
View File
@@ -79,7 +79,7 @@ void EditHotkeyDialog::setFromHotkey(std::shared_ptr<Hotkey> hotkey)
this->ui_->easyArgsLabel->setText(def->argumentsPrompt);
this->ui_->easyArgsLabel->setToolTip(def->argumentsPromptHover);
int matchIdx = -1;
for (int i = 0; i < def->possibleArguments.size(); i++)
for (size_t i = 0; i < def->possibleArguments.size(); i++)
{
const auto &[displayText, argData] = def->possibleArguments.at(i);
this->ui_->easyArgsPicker->addItem(displayText);
@@ -90,7 +90,7 @@ void EditHotkeyDialog::setFromHotkey(std::shared_ptr<Hotkey> hotkey)
continue;
}
bool matches = true;
for (int j = 0; j < argData.size(); j++)
for (size_t j = 0; j < argData.size(); j++)
{
if (argData.at(j) != hotkey->arguments().at(j))
{
@@ -100,7 +100,7 @@ void EditHotkeyDialog::setFromHotkey(std::shared_ptr<Hotkey> hotkey)
}
if (matches)
{
matchIdx = i;
matchIdx = static_cast<int>(i);
}
}
if (matchIdx != -1)
+9 -6
View File
@@ -219,11 +219,13 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, Split *split)
const auto &timeoutButtons =
getSettings()->timeoutButtons.getValue();
if (timeoutButtons.size() < buttonNum || 0 >= buttonNum)
if (static_cast<int>(timeoutButtons.size()) < buttonNum ||
0 >= buttonNum)
{
return QString("Invalid argument for execModeratorAction: "
"%1. Integer out of usable range: [1, %2]")
.arg(buttonNum, timeoutButtons.size() - 1);
.arg(buttonNum,
static_cast<int>(timeoutButtons.size()) - 1);
}
const auto &button = timeoutButtons.at(buttonNum - 1);
msg = QString("/timeout %1 %2")
@@ -690,9 +692,10 @@ void UserInfoPopup::installEvents()
{
const auto &vector = getSettings()->blacklistedUsers.raw();
for (int i = 0; i < vector.size(); i++)
for (int i = 0; i < static_cast<int>(vector.size()); i++)
{
if (this->userName_ == vector[i].getPattern())
if (this->userName_ ==
vector[static_cast<size_t>(i)].getPattern())
{
getSettings()->blacklistedUsers.removeAt(i);
i--;
@@ -899,9 +902,9 @@ void UserInfoPopup::updateUserData()
// get ignoreHighlights state
bool isIgnoringHighlights = false;
const auto &vector = getSettings()->blacklistedUsers.raw();
for (int i = 0; i < vector.size(); i++)
for (const auto &user : vector)
{
if (this->userName_ == vector[i].getPattern())
if (this->userName_ == user.getPattern())
{
isIgnoringHighlights = true;
break;