Use signed_int to serialize enums

This commit is contained in:
Nathan Hourt 2020-09-17 21:11:28 -05:00
parent 747567fbdc
commit 2f89e0812a
No known key found for this signature in database
GPG key ID: B4344309A110851E

View file

@ -530,14 +530,14 @@ namespace fc {
template<typename Stream>
static inline void pack( Stream& s, const T& v, uint32_t _max_depth ) {
FC_ASSERT( _max_depth > 0 );
fc::raw::pack( s, (int64_t)v, _max_depth - 1 );
fc::raw::pack( s, signed_int((int64_t)v), _max_depth - 1 );
}
template<typename Stream>
static inline void unpack( Stream& s, T& v, uint32_t _max_depth ) {
FC_ASSERT( _max_depth > 0 );
int64_t temp;
signed_int temp;
fc::raw::unpack( s, temp, _max_depth - 1 );
v = (T)temp;
v = (T)temp.value;
}
};