From fa108c444f18f6345b78090af47ec5fb4a7c2c36 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Thu, 1 Sep 2022 10:08:26 -0700 Subject: Rollback of 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: 471561809 Change-Id: I7abd6d83706f5ca135f1ce3458192a498a6280b9 --- absl/random/internal/seed_material.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'absl/random') diff --git a/absl/random/internal/seed_material.cc b/absl/random/internal/seed_material.cc index 1041302b..c03cad85 100644 --- a/absl/random/internal/seed_material.cc +++ b/absl/random/internal/seed_material.cc @@ -173,12 +173,12 @@ bool ReadSeedMaterialFromDevURandom(absl::Span values) { } while (success && buffer_size > 0) { - ssize_t bytes_read = read(dev_urandom, buffer, buffer_size); + int bytes_read = read(dev_urandom, buffer, buffer_size); int read_error = errno; success = (bytes_read > 0); if (success) { buffer += bytes_read; - buffer_size -= static_cast(bytes_read); + buffer_size -= bytes_read; } else if (bytes_read == -1 && read_error == EINTR) { success = true; // Need to try again. } -- cgit v1.2.3