From 847fa56a5422c20a6f471e67ac0bca004ff5eac5 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 1 Sep 2022 09:19:13 -0700 Subject: Fix "unsafe narrowing" warnings in absl, 8/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 .cc files in */internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 471549854 Change-Id: Id685d0e4666212926f4e001b8ef4930b6a33a4cc --- absl/container/internal/inlined_vector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'absl/container/internal/inlined_vector.h') diff --git a/absl/container/internal/inlined_vector.h b/absl/container/internal/inlined_vector.h index fdca3061..a56b7573 100644 --- a/absl/container/internal/inlined_vector.h +++ b/absl/container/internal/inlined_vector.h @@ -641,8 +641,8 @@ auto Storage::Insert(ConstIterator pos, ValueAdapter values, SizeType insert_count) -> Iterator { StorageView storage_view = MakeStorageView(); - SizeType insert_index = - std::distance(ConstIterator(storage_view.data), pos); + auto insert_index = static_cast>( + std::distance(ConstIterator(storage_view.data), pos)); SizeType insert_end_index = insert_index + insert_count; SizeType new_size = storage_view.size + insert_count; -- cgit v1.2.3