From fcfc7a6d15eab5aff86d7b90c9e38fa386a103fa Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 17 Aug 2022 09:17:56 -0700 Subject: Fix "unsafe narrowing" warnings in absl, 5/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 strings/internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 468215101 Change-Id: I07fa487bcf2cf62d403489c3be7a5997cdef8987 --- absl/strings/internal/cordz_statistics.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'absl/strings/internal/cordz_statistics.h') diff --git a/absl/strings/internal/cordz_statistics.h b/absl/strings/internal/cordz_statistics.h index 57071905..9f558df4 100644 --- a/absl/strings/internal/cordz_statistics.h +++ b/absl/strings/internal/cordz_statistics.h @@ -45,12 +45,12 @@ struct CordzStatistics { }; // The size of the cord in bytes. This matches the result of Cord::size(). - int64_t size = 0; + size_t size = 0; // The estimated memory used by the sampled cord. This value matches the // value as reported by Cord::EstimatedMemoryUsage(). // A value of 0 implies the property has not been recorded. - int64_t estimated_memory_usage = 0; + size_t estimated_memory_usage = 0; // The effective memory used by the sampled cord, inversely weighted by the // effective indegree of each allocated node. This is a representation of the @@ -59,14 +59,14 @@ struct CordzStatistics { // by multiple Cord instances, and for cases where a Cord includes the same // node multiple times (either directly or indirectly). // A value of 0 implies the property has not been recorded. - int64_t estimated_fair_share_memory_usage = 0; + size_t estimated_fair_share_memory_usage = 0; // The total number of nodes referenced by this cord. // For ring buffer Cords, this includes the 'ring buffer' node. // For btree Cords, this includes all 'CordRepBtree' tree nodes as well as all // the substring, flat and external nodes referenced by the tree. // A value of 0 implies the property has not been recorded. - int64_t node_count = 0; + size_t node_count = 0; // Detailed node counts per type NodeCounts node_counts; -- cgit v1.2.3