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/ui/MxcAnimatedImage.cpp | 2 +- src/ui/MxcMediaProxy.cpp | 2 +- src/ui/RoomSettings.cpp | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/ui') diff --git a/src/ui/MxcAnimatedImage.cpp b/src/ui/MxcAnimatedImage.cpp index 8ecea7d9..7f7210e3 100644 --- a/src/ui/MxcAnimatedImage.cpp +++ b/src/ui/MxcAnimatedImage.cpp @@ -82,7 +82,7 @@ MxcAnimatedImage::startDownload() std::string temp(ba.constData(), ba.size()); temp = mtx::crypto::to_string(mtx::crypto::decrypt_file(temp, encryptionInfo.value())); - buffer.setData(temp.data(), temp.size()); + buffer.setData(temp.data(), static_cast(temp.size())); } else { buffer.setData(device.readAll()); } diff --git a/src/ui/MxcMediaProxy.cpp b/src/ui/MxcMediaProxy.cpp index 3676a74e..dadd4478 100644 --- a/src/ui/MxcMediaProxy.cpp +++ b/src/ui/MxcMediaProxy.cpp @@ -122,7 +122,7 @@ MxcMediaProxy::startDownload() QByteArray ba = device.readAll(); std::string temp(ba.constData(), ba.size()); temp = mtx::crypto::to_string(mtx::crypto::decrypt_file(temp, encryptionInfo.value())); - buffer.setData(temp.data(), temp.size()); + buffer.setData(temp.data(), static_cast(temp.size())); } else { buffer.setData(device.readAll()); } diff --git a/src/ui/RoomSettings.cpp b/src/ui/RoomSettings.cpp index 546cda29..67be0bbb 100644 --- a/src/ui/RoomSettings.cpp +++ b/src/ui/RoomSettings.cpp @@ -132,7 +132,7 @@ RoomSettings::roomAvatarUrl() int RoomSettings::memberCount() const { - return info_.member_count; + return static_cast(info_.member_count); } void @@ -180,7 +180,8 @@ QStringList RoomSettings::allowedRooms() const { QStringList rooms; - rooms.reserve(accessRules_.allow.size()); + assert(accessRules_.allow.size() < std::numeric_limits::max()); + rooms.reserve(static_cast(accessRules_.allow.size())); for (const auto &e : accessRules_.allow) { if (e.type == mtx::events::state::JoinAllowanceType::RoomMembership) rooms.push_back(QString::fromStdString(e.room_id)); -- cgit 1.5.1