1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor: Remove some useless casts

Can't actually enable Wuseless-cast though because Qt's MOC-generated code is
full of them.
This commit is contained in:
Anthony Bilinski 2022-03-11 02:42:22 -08:00
parent afe5d9d82a
commit ece26e4a4f
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
3 changed files with 4 additions and 4 deletions

View File

@ -49,7 +49,7 @@ void ChatLine::visibilityChanged(bool visible)
ChatLineContent* ChatLine::getContent(int col) const
{
if (col < static_cast<int>(content.size()) && col >= 0)
if (col < content.size() && col >= 0)
return content[col];
return nullptr;
@ -145,7 +145,7 @@ void ChatLine::addColumn(ChatLineContent* item, ColumnFormat fmt)
void ChatLine::replaceContent(int col, ChatLineContent* lineContent)
{
if (col >= 0 && col < static_cast<int>(content.size()) && lineContent) {
if (col >= 0 && col < content.size() && lineContent) {
QGraphicsScene* scene = content[col]->scene();
delete content[col];

View File

@ -1670,7 +1670,7 @@ uint32_t Core::joinGroupchat(const GroupInvite& inviteInfo)
case TOX_CONFERENCE_TYPE_AV: {
qDebug() << QString("Trying to join AV groupchat invite sent by friend %1").arg(friendId);
groupNum = toxav_join_av_groupchat(tox.get(), friendId, cookie, cookieLength,
CoreAV::groupCallCallback, const_cast<Core*>(this));
CoreAV::groupCallCallback, this);
break;
}
default:

View File

@ -98,7 +98,7 @@ std::map<ChatLogIdx, ChatLogItem>::const_iterator
firstItemAfterDate(QDate date, const std::map<ChatLogIdx, ChatLogItem>& items)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
return std::lower_bound(items.begin(), items.end(), QDateTime(date.startOfDay()),
return std::lower_bound(items.begin(), items.end(), date.startOfDay(),
#else
return std::lower_bound(items.begin(), items.end(), QDateTime(date),
#endif