diff options
author | drivehappy <drivehappy@gmail.com> | 2017-03-28 16:57:19 -0700 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2017-03-28 16:57:19 -0700 |
commit | d43eaf2b8fe40c57eaf5e31d0ae7dfa9f1c2f68b (patch) | |
tree | d1bab5e1a2bf0ad1764938c680bbcd22d31d4170 | |
parent | 585993201aaed07d50ea0478a5e2257a72370ac9 (diff) | |
download | protobuf-d43eaf2b8fe40c57eaf5e31d0ae7dfa9f1c2f68b.tar.gz protobuf-d43eaf2b8fe40c57eaf5e31d0ae7dfa9f1c2f68b.tar.bz2 protobuf-d43eaf2b8fe40c57eaf5e31d0ae7dfa9f1c2f68b.zip |
Fix gcc warning when using map (#2213)
* Issue #2211: Addressing GCC warning on enumeral/non-enumeral in conditional expression.
* Updated per 80 character wrap.
-rw-r--r-- | src/google/protobuf/map.h | 4 |
1 files changed, 3 insertions, 1 deletions
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<size_type>(kMinTableSize) + ? static_cast<size_type>(kMinTableSize) + : n; } // Use alloc_ to allocate an array of n objects of type U. |