From 9c1bdc81eba178615d71a94aed6cb734eb1abcee Mon Sep 17 00:00:00 2001 From: Till Hofmann Date: Sat, 27 Jul 2019 10:43:54 +0200 Subject: [PATCH] Cast milliseconds to long before constructing a boost::posix_time The constructor of boost::posix_time::milliseconds no longer accepts floating point numbers but long ints, cast accordingly. This fixes a compilaton error on Fedora 30. --- src/server/internal_subscription.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/internal_subscription.cpp b/src/server/internal_subscription.cpp index edf4715b..2fe4d224 100644 --- a/src/server/internal_subscription.cpp +++ b/src/server/internal_subscription.cpp @@ -14,7 +14,7 @@ InternalSubscription::InternalSubscription(SubscriptionServiceInternal & service , CurrentSession(SessionAuthenticationToken) , Callback(callback) , io(service.GetIOService()) - , Timer(io, boost::posix_time::milliseconds(data.RevisedPublishingInterval)) + , Timer(io, boost::posix_time::milliseconds(static_cast(data.RevisedPublishingInterval))) , LifeTimeCount(data.RevisedLifetimeCount) , Logger(logger) { @@ -105,7 +105,7 @@ void InternalSubscription::PublishResults(const boost::system::error_code & erro } TimerStopped = false; - Timer.expires_at(Timer.expires_at() + boost::posix_time::milliseconds(Data.RevisedPublishingInterval)); + Timer.expires_at(Timer.expires_at() + boost::posix_time::milliseconds(static_cast(Data.RevisedPublishingInterval))); std::shared_ptr self = shared_from_this(); Timer.async_wait([self](const boost::system::error_code & error) { self->PublishResults(error); }); }