diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2019-10-16 21:02:59 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2019-10-16 21:02:59 +0300 |
commit | ba4e832488fbb7165b908a17225c367c13cb72f3 (patch) | |
tree | b370802ae7fec5036c615056c72019dedf0b6a64 | |
parent | 493adf3616bee052649c63c473f8355630c2797f (diff) |
Avoid compiler warning in bool cast (#440)
-rw-r--r-- | pb_encode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pb_encode.c b/pb_encode.c index 7a4ba31..4dd53a9 100644 --- a/pb_encode.c +++ b/pb_encode.c @@ -759,7 +759,7 @@ bool checkreturn pb_encode_submessage(pb_ostream_t *stream, const pb_field_t fie static bool checkreturn pb_enc_bool(pb_ostream_t *stream, const pb_field_t *field, const void *src) { - uint32_t value = (uint32_t)safe_read_bool(src); + uint32_t value = safe_read_bool(src) ? 1 : 0; PB_UNUSED(field); return pb_encode_varint(stream, value); } |