From 71079e42cb4ae53db02f9bbe446ad51ed62fd17f Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 14 Apr 2020 14:24:33 -0700 Subject: [PATCH] Export of internal Abseil changes -- 2182f6d50e2bcb77858aaab6001ebffdc13bee89 by Derek Mauro : Use base_internal::AtomicHook instead of std::atomic for StatusPayloadPrinter Imports #661 PiperOrigin-RevId: 306514102 -- 6f8047057f4530c17c06ab1737a1937c86402807 by Mark Barolak : Fix ABSL_RANDOM_RANDEN_COPTS setting on FreeBSD Import of https://github.com/abseil/abseil-cpp/pull/664 PiperOrigin-RevId: 306485774 -- cb3b73b9607d0009bbcfd7766f4f1fa4fde9c8b9 by Abseil Team : Avoid a -Wimplicit-int-float-conversion warning. Without this explicit cast, this code produces a warning of "implicit conversion from 'const int64_t' (aka 'const long') to 'double' may lose precision" when this warning is turned on. PiperOrigin-RevId: 306358838 -- ef895ea6b28c96b64531c218705bac9c3fa169d5 by Greg Falcon : Internal change PiperOrigin-RevId: 306040909 GitOrigin-RevId: 2182f6d50e2bcb77858aaab6001ebffdc13bee89 Change-Id: I69555c1722745a74c1603c62a621ca765d253fe5 --- absl/synchronization/internal/mutex_nonprod.cc | 4 ++++ absl/time/time.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/absl/synchronization/internal/mutex_nonprod.cc b/absl/synchronization/internal/mutex_nonprod.cc index 4590b98d..1732f836 100644 --- a/absl/synchronization/internal/mutex_nonprod.cc +++ b/absl/synchronization/internal/mutex_nonprod.cc @@ -32,6 +32,10 @@ namespace absl { ABSL_NAMESPACE_BEGIN + +void SetMutexDeadlockDetectionMode(OnDeadlockCycle) {} +void EnableMutexInvariantDebugging(bool) {} + namespace synchronization_internal { namespace { diff --git a/absl/time/time.h b/absl/time/time.h index 33a4a630..152f3ff8 100644 --- a/absl/time/time.h +++ b/absl/time/time.h @@ -1348,8 +1348,8 @@ constexpr Duration MakeDuration(int64_t hi, int64_t lo) { // it's positive and can be converted to int64_t without risk of UB. inline Duration MakePosDoubleDuration(double n) { const int64_t int_secs = static_cast(n); - const uint32_t ticks = - static_cast((n - int_secs) * kTicksPerSecond + 0.5); + const uint32_t ticks = static_cast( + (n - static_cast(int_secs)) * kTicksPerSecond + 0.5); return ticks < kTicksPerSecond ? MakeDuration(int_secs, ticks) : MakeDuration(int_secs + 1, ticks - kTicksPerSecond);