From 2f89e0812a8262490a53efa599cb044ba08a12f8 Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Thu, 17 Sep 2020 21:11:28 -0500 Subject: [PATCH] Use signed_int to serialize enums --- include/fc/io/raw.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp index 7a4b7d0..d10851b 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -530,14 +530,14 @@ namespace fc { template 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 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; } };