Update bool serialization

Make the logic clearer, to avoid issues on some compilers.
Thanks to @pureland and team.
This commit is contained in:
abitmore 2020-03-26 16:27:59 +00:00
parent 5768c6d884
commit 9763d1c194

View file

@ -307,7 +307,7 @@ namespace fc {
template<typename Stream> 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<typename Stream> inline void unpack( Stream& s, bool& v, uint32_t _max_depth )
{