diff --git a/lib/base/netstring.cpp b/lib/base/netstring.cpp index 60f08c265..8f8fe4f67 100644 --- a/lib/base/netstring.cpp +++ b/lib/base/netstring.cpp @@ -167,7 +167,7 @@ String NetString::ReadStringFromStream(const Shared::Ptr& stream, } } - if (maxMessageLength >= 0 && len > maxMessageLength) { + if (maxMessageLength >= 0 && len > static_cast(maxMessageLength)) { std::stringstream errorMessage; errorMessage << "Max data length exceeded: " << (maxMessageLength / 1024) << " KB"; @@ -246,7 +246,7 @@ String NetString::ReadStringFromStream(const Shared::Ptr& stream, } } - if (maxMessageLength >= 0 && len > maxMessageLength) { + if (maxMessageLength >= 0 && len > static_cast(maxMessageLength)) { std::stringstream errorMessage; errorMessage << "Max data length exceeded: " << (maxMessageLength / 1024) << " KB"; diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index 5c6443e84..4f21d05a0 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -549,7 +549,7 @@ std::vector>> IcingaDB::ChunkObjects(std chunks.reserve((std::distance(offset, end) + chunkSize - 1) / chunkSize); - while (std::distance(offset, end) >= chunkSize) { + while (static_cast(std::distance(offset, end)) >= chunkSize) { auto until (offset + chunkSize); chunks.emplace_back(offset, until); offset = until; diff --git a/lib/remote/apilistener-authority.cpp b/lib/remote/apilistener-authority.cpp index e169ad4b1..4f55db44a 100644 --- a/lib/remote/apilistener-authority.cpp +++ b/lib/remote/apilistener-authority.cpp @@ -25,7 +25,7 @@ void ApiListener::UpdateObjectAuthority() std::vector endpoints; Endpoint::Ptr my_endpoint; - int hostChildrenInheritObjectAuthority = 0; + std::size_t hostChildrenInheritObjectAuthority = 0; if (my_zone) { my_endpoint = Endpoint::GetLocalEndpoint(); diff --git a/test/icinga-dependencies.cpp b/test/icinga-dependencies.cpp index b1fbf7b4c..57a30e05f 100644 --- a/test/icinga-dependencies.cpp +++ b/test/icinga-dependencies.cpp @@ -35,7 +35,12 @@ static void RegisterDependency(Dependency::Ptr dep, const String& redundancyGrou dep->GetParent()->AddReverseDependency(dep); } -static void AssertCheckableRedundancyGroup(Checkable::Ptr checkable, int dependencyCount, int groupCount, int totalDependenciesCount) +static void AssertCheckableRedundancyGroup( + Checkable::Ptr checkable, + std::size_t dependencyCount, + std::size_t groupCount, + std::size_t totalDependenciesCount +) { BOOST_CHECK_MESSAGE( dependencyCount == checkable->GetDependencies().size(), diff --git a/test/remote-httpserverconnection.cpp b/test/remote-httpserverconnection.cpp index ac0f895b8..a2cb9ff2a 100644 --- a/test/remote-httpserverconnection.cpp +++ b/test/remote-httpserverconnection.cpp @@ -56,7 +56,7 @@ struct HttpServerConnectionFixture : TlsStreamFixture, ConfigurationCacheDirFixt template bool AssertServerDisconnected(const std::chrono::duration& timeout) { - auto iterations = timeout / std::chrono::milliseconds(50); + std::size_t iterations = timeout / std::chrono::milliseconds(50); for (std::size_t i = 0; i < iterations && !m_Connection->Disconnected(); i++) { Utility::Sleep(std::chrono::duration(timeout).count() / iterations); }