]> granicus.if.org Git - icinga2/commitdiff
Explicitly use long with boost::posix_time 6230/head
authorJan Beich <jbeich@FreeBSD.org>
Sun, 15 Apr 2018 04:02:42 +0000 (04:02 +0000)
committerJan Beich <jbeich@FreeBSD.org>
Sun, 15 Apr 2018 04:06:11 +0000 (04:06 +0000)
In file included from lib/base/base_unity.cpp:61:
lib/base/timer.cpp:295:31: error: no matching conversion for functional-style cast from 'double' to 'boost::posix_time::milliseconds' (aka 'subsecond_duration<boost::posix_time::time_duration, 1000>')
                        l_TimerCV.timed_wait(lock, boost::posix_time::milliseconds(wait * 1000));
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from lib/remote/remote_unity.cpp:19:
lib/remote/eventqueue.cpp:111:30: error: no matching conversion for functional-style cast from 'double' to 'boost::posix_time::milliseconds' (aka 'subsecond_duration<boost::posix_time::time_duration, 1000>')
                if (!m_CV.timed_wait(lock, boost::posix_time::milliseconds(timeout * 1000)))
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from lib/checker/checker_unity.cpp:1:
lib/checker/checkercomponent.cpp:128:26: error: no matching conversion for functional-style cast from 'double' to 'boost::posix_time::milliseconds' (aka 'subsecond_duration<boost::posix_time::time_duration, 1000>')
                        m_CV.timed_wait(lock, boost::posix_time::milliseconds(wait * 1000));
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/date_time/time_duration.hpp:270:30: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'double' to 'const boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000>' for 1st argument
  class BOOST_SYMBOL_VISIBLE subsecond_duration : public base_duration
                             ^
/usr/local/include/boost/date_time/time_duration.hpp:270:30: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'double' to 'boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000>' for 1st argument
/usr/local/include/boost/date_time/time_duration.hpp:286:59: note: candidate template ignored: disabled by 'enable_if' [with T = double]
                                typename boost::enable_if<boost::is_integral<T>, void>::type* = 0) :
                                                          ^

lib/base/timer.cpp
lib/checker/checkercomponent.cpp
lib/remote/eventqueue.cpp

index d862f8088ae2f1fc25b2e9d106593c2ddc32f8bf..0eb03f754174192c5b722ea13bd277761d375056 100644 (file)
@@ -292,7 +292,7 @@ void Timer::TimerThreadProc()
 
                if (wait > 0.01) {
                        /* Wait for the next timer. */
-                       l_TimerCV.timed_wait(lock, boost::posix_time::milliseconds(wait * 1000));
+                       l_TimerCV.timed_wait(lock, boost::posix_time::milliseconds(long(wait * 1000)));
 
                        continue;
                }
index 12e43b73c7509c006e609b3c048328439abaa712..c26db9de1291f7b404e400cc2ca4ba94bf12e27c 100644 (file)
@@ -125,7 +125,7 @@ void CheckerComponent::CheckThreadProc()
 
                if (wait > 0) {
                        /* Wait for the next check. */
-                       m_CV.timed_wait(lock, boost::posix_time::milliseconds(wait * 1000));
+                       m_CV.timed_wait(lock, boost::posix_time::milliseconds(long(wait * 1000)));
 
                        continue;
                }
index 756c9b9a8e7e0ddb9b1f2ac93d385e6a7e37b99d..5f3b01a2f80744e7e258107e6f771256c92af898 100644 (file)
@@ -108,7 +108,7 @@ Dictionary::Ptr EventQueue::WaitForEvent(void *client, double timeout)
                        return result;
                }
 
-               if (!m_CV.timed_wait(lock, boost::posix_time::milliseconds(timeout * 1000)))
+               if (!m_CV.timed_wait(lock, boost::posix_time::milliseconds(long(timeout * 1000))))
                        return nullptr;
        }
 }