summary refs log tree commit diff
path: root/src/voip/CallManager.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-10-26 01:10:35 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-10-26 01:10:35 +0200
commitb28fa86e6ab633b2d3d9bfdb4642c661ff8c45fc (patch)
treee3500273bcd79fc9e6389e8dcc626607a2677678 /src/voip/CallManager.cpp
parentMerge pull request #1215 from foxB612/fix-thumbnail-size (diff)
downloadnheko-b28fa86e6ab633b2d3d9bfdb4642c661ff8c45fc.tar.xz
Enable -Wconversion
Diffstat (limited to 'src/voip/CallManager.cpp')
-rw-r--r--src/voip/CallManager.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/voip/CallManager.cpp b/src/voip/CallManager.cpp

index 5e711499..1bb1700f 100644 --- a/src/voip/CallManager.cpp +++ b/src/voip/CallManager.cpp
@@ -124,10 +124,10 @@ CallManager::CallManager(QObject *parent) // Request new credentials close to expiry // See https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00 turnURIs_ = getTurnURIs(res); - uint32_t ttl = std::max(res.ttl, UINT32_C(3600)); + uint32_t ttl = std::max(res.ttl, std::uint32_t{3600}); if (res.ttl < 3600) nhlog::net()->warn("Setting ttl to 1 hour"); - turnServerTimer_.setInterval(ttl * 1000 * 0.9); + turnServerTimer_.setInterval(std::chrono::seconds(ttl) * 10 / 9); }); connect(&session_, &WebRTCSession::stateChanged, this, [this](webrtc::State state) { @@ -728,7 +728,8 @@ CallManager::devices(bool isVideo) const isVideo ? UserSettings::instance()->camera() : UserSettings::instance()->microphone(); std::vector<std::string> devices = CallDevices::instance().names(isVideo, defaultDevice.toStdString()); - ret.reserve(devices.size()); + assert(devices.size() < std::numeric_limits<int>::max()); + ret.reserve(static_cast<int>(devices.size())); std::transform(devices.cbegin(), devices.cend(), std::back_inserter(ret), [](const auto &d) { return QString::fromStdString(d); }); @@ -867,7 +868,8 @@ CallManager::windowList() } #endif QStringList ret; - ret.reserve(windows_.size()); + assert(windows_.size() < std::numeric_limits<int>::max()); + ret.reserve(static_cast<int>(windows_.size())); for (const auto &w : windows_) ret.append(w.first);