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
+2 -2
View File
@@ -196,12 +196,12 @@ public:
std::unique_lock lock(this->mutex_);
Equals eq;
for (int i = 0; i < this->buffer_.size(); ++i)
for (size_t i = 0; i < this->buffer_.size(); ++i)
{
if (eq(this->buffer_[i], needle))
{
this->buffer_[i] = replacement;
return i;
return static_cast<int>(i);
}
}
return -1;
+1 -1
View File
@@ -116,7 +116,7 @@ QString formatUpdatedEmoteList(const QString &platform,
text += QString(" %1 %2 emotes ").arg(emoteNames.size()).arg(platform);
}
auto i = 0;
size_t i = 0;
for (const auto &emoteName : emoteNames)
{
i++;
@@ -212,7 +212,8 @@ void MessageLayoutContainer::breakLine()
this->lineStart_ = this->elements_.size();
// this->currentX = (int)(this->scale * 8);
if (this->canCollapse() && this->line_ + 1 >= maxUncollapsedLines())
if (this->canCollapse() &&
static_cast<int>(this->line_ + 1) >= maxUncollapsedLines())
{
this->canAddMessages_ = false;
return;
@@ -514,9 +514,10 @@ int TextLayoutElement::getXFromIndex(size_t index)
else if (index < static_cast<size_t>(this->getText().size()))
{
int x = 0;
for (int i = 0; i < index; i++)
for (size_t i = 0; i < index; i++)
{
x += metrics.horizontalAdvance(this->getText()[i]);
x += metrics.horizontalAdvance(
this->getText()[static_cast<QString::size_type>(i)]);
}
return x + this->getRect().left();
}