Skip to content

Commit

Permalink
Fixes MSVC compiler warning C4800 "Forcing value to bool 'true' or 'f…
Browse files Browse the repository at this point in the history
…alse'" (#4350)
  • Loading branch information
alexey-malov authored and xfxyjwf committed Mar 26, 2018
1 parent ac67376 commit 379b7ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/google/protobuf/generated_message_util.h
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/io/coded_stream.h
Expand Up @@ -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:
Expand Down

0 comments on commit 379b7ff

Please sign in to comment.