aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar drivehappy <drivehappy@gmail.com>2017-03-28 16:57:19 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-28 16:57:19 -0700
commitd43eaf2b8fe40c57eaf5e31d0ae7dfa9f1c2f68b (patch)
treed1bab5e1a2bf0ad1764938c680bbcd22d31d4170 /src
parent585993201aaed07d50ea0478a5e2257a72370ac9 (diff)
Fix gcc warning when using map (#2213)
* Issue #2211: Addressing GCC warning on enumeral/non-enumeral in conditional expression. * Updated per 80 character wrap.
Diffstat (limited to 'src')
-rw-r--r--src/google/protobuf/map.h4
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.