aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/generated_message_util.h
diff options
context:
space:
mode:
authorGravatar Alexey Malov <malov.aleksey@gmail.com>2018-03-26 23:42:11 +0300
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2018-03-26 13:42:11 -0700
commit379b7ff42a98a366816825d040c7c317f35422c4 (patch)
tree089ce9e0590dc252a97008e147723a48392f8df9 /src/google/protobuf/generated_message_util.h
parentac673763f7acb7db0608d8a792db102fe6c926c3 (diff)
Fixes MSVC compiler warning C4800 "Forcing value to bool 'true' or 'false'" (#4350)
Diffstat (limited to 'src/google/protobuf/generated_message_util.h')
-rw-r--r--src/google/protobuf/generated_message_util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h
index c0e41bf7..c26e3e52 100644
--- a/src/google/protobuf/generated_message_util.h
+++ b/src/google/protobuf/generated_message_util.h
@@ -175,7 +175,7 @@ struct LIBPROTOBUF_EXPORT FieldMetadata {
inline bool IsPresent(const void* base, uint32 hasbit) {
const uint32* has_bits_array = static_cast<const uint32*>(base);
- return has_bits_array[hasbit / 32] & (1u << (hasbit & 31));
+ return (has_bits_array[hasbit / 32] & (1u << (hasbit & 31))) != 0;
}
inline bool IsOneofPresent(const void* base, uint32 offset, uint32 tag) {