From d43eaf2b8fe40c57eaf5e31d0ae7dfa9f1c2f68b Mon Sep 17 00:00:00 2001 From: drivehappy Date: Tue, 28 Mar 2017 16:57:19 -0700 Subject: Fix gcc warning when using map (#2213) * Issue #2211: Addressing GCC warning on enumeral/non-enumeral in conditional expression. * Updated per 80 character wrap. --- src/google/protobuf/map.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 61a23897..e6d78b20 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -1290,7 +1290,9 @@ class Map { // Return a power of two no less than max(kMinTableSize, n). // Assumes either n < kMinTableSize or n is a power of two. size_type TableSize(size_type n) { - return n < kMinTableSize ? kMinTableSize : n; + return n < static_cast(kMinTableSize) + ? static_cast(kMinTableSize) + : n; } // Use alloc_ to allocate an array of n objects of type U. -- cgit v1.2.3