From 379b7ff42a98a366816825d040c7c317f35422c4 Mon Sep 17 00:00:00 2001 From: Alexey Malov Date: Mon, 26 Mar 2018 23:42:11 +0300 Subject: Fixes MSVC compiler warning C4800 "Forcing value to bool 'true' or 'false'" (#4350) --- src/google/protobuf/generated_message_util.h | 2 +- src/google/protobuf/io/coded_stream.h | 2 +- 2 files changed, 2 insertions(+), 2 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(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) { diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h index 9dad1c61..0f70ecde 100644 --- a/src/google/protobuf/io/coded_stream.h +++ b/src/google/protobuf/io/coded_stream.h @@ -851,7 +851,7 @@ class LIBPROTOBUF_EXPORT CodedOutputStream { } static bool IsDefaultSerializationDeterministic() { - return default_serialization_deterministic_.load(std::memory_order_relaxed); + return default_serialization_deterministic_.load(std::memory_order_relaxed) != 0; } private: -- cgit v1.2.3