From 9d408aa53267834542279490eac4c25878107967 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Wed, 16 Nov 2016 14:47:30 -0500 Subject: [PATCH] Fix serialization of enums to use variable-length integerd --- 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 bc5cd22..46dcf4b 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -324,13 +324,13 @@ namespace fc { struct if_enum { template static inline void pack( Stream& s, const T& v ) { - fc::raw::pack(s, (int64_t)v); + fc::raw::pack(s, signed_int((int32_t)v)); } template static inline void unpack( Stream& s, T& v ) { - int64_t temp; + signed_int temp; fc::raw::unpack(s, temp); - v = (T)temp; + v = (T)temp.value; } };