From 9763d1c1945b1c246d947cae69094e91e5b14e9c Mon Sep 17 00:00:00 2001 From: abitmore Date: Thu, 26 Mar 2020 16:27:59 +0000 Subject: [PATCH] Update bool serialization Make the logic clearer, to avoid issues on some compilers. Thanks to @pureland and team. --- include/fc/io/raw.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp index 6b0371b55..ffd1ad53b 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -307,7 +307,7 @@ namespace fc { template inline void pack( Stream& s, const bool& v, uint32_t _max_depth ) { FC_ASSERT( _max_depth > 0 ); - fc::raw::pack( s, uint8_t(v), _max_depth - 1 ); + fc::raw::pack( s, v ? uint8_t(1) : uint8_t(0), _max_depth - 1 ); } template inline void unpack( Stream& s, bool& v, uint32_t _max_depth ) {