From 7f51ef5ed2740dab2bbf53c4dd5931b6e8ec6a5b Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 28 Jul 2022 07:45:06 -0700 Subject: Fix "unsafe narrowing" warnings in absl, 1/n. Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .h and win32 .inc files.) Bug: chromium:1292951 PiperOrigin-RevId: 463835431 Change-Id: If8e5f7f651d5cd96035e23e4623bdb08a7fedabe --- absl/synchronization/internal/kernel_timeout.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'absl/synchronization/internal/kernel_timeout.h') diff --git a/absl/synchronization/internal/kernel_timeout.h b/absl/synchronization/internal/kernel_timeout.h index bbd4d2d7..44a3a2e8 100644 --- a/absl/synchronization/internal/kernel_timeout.h +++ b/absl/synchronization/internal/kernel_timeout.h @@ -111,7 +111,8 @@ class KernelTimeout { constexpr uint64_t max_nanos = (std::numeric_limits::max)() - 999999u; uint64_t ms_from_now = - (std::min(max_nanos, ns_ - now) + 999999u) / 1000000u; + ((std::min)(max_nanos, static_cast(ns_ - now)) + 999999u) / + 1000000u; if (ms_from_now > kInfinite) { return kInfinite; } -- cgit v1.2.3