From b28fa86e6ab633b2d3d9bfdb4642c661ff8c45fc Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 26 Oct 2022 01:10:35 +0200 Subject: Enable -Wconversion --- src/ChatPage.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/ChatPage.cpp') diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index 756ef425..2ea987c2 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -179,7 +179,8 @@ ChatPage::ChatPage(QSharedPointer userSettings, QObject *parent) static unsigned int prevNotificationCount = 0; unsigned int notificationCount = 0; for (const auto &room : sync.rooms.join) { - notificationCount += room.second.unread_notifications.notification_count; + notificationCount += + static_cast(room.second.unread_notifications.notification_count); } // HACK: If we had less notifications last time we checked, send an alert if the @@ -1064,12 +1065,15 @@ ChatPage::verifyOneTimeKeyCountAfterStartup() } std::map key_counts; - auto count = 0; + std::uint64_t count = 0; if (auto c = res.one_time_key_counts.find(mtx::crypto::SIGNED_CURVE25519); c == res.one_time_key_counts.end()) { key_counts[mtx::crypto::SIGNED_CURVE25519] = 0; } else { - key_counts[mtx::crypto::SIGNED_CURVE25519] = c->second; + key_counts[mtx::crypto::SIGNED_CURVE25519] = + c->second > std::numeric_limits::max() + ? std::numeric_limits::max() + : static_cast(c->second); count = c->second; } -- cgit 1.5.1