diff --git a/src/data.cpp b/src/data.cpp index f270c23..019e8d5 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -565,7 +565,7 @@ void Value::copyIn(const void *ptr, StoreType type) case StoreType::UInteger: { if(!copyInScalar(store->as(), ptr, type)) throw NoConvert(SB()<<"Unable to assign "<code<<" with "<as(); + uint64_t orig = store->as(); switch(desc->code.code) { case TypeCode::UInt8: orig = uint8_t(orig); break; case TypeCode::UInt16: orig = uint16_t(orig); break; @@ -573,7 +573,7 @@ void Value::copyIn(const void *ptr, StoreType type) case TypeCode::UInt64: orig = uint64_t(orig); break; default: break; } - store->as() = orig; + store->as() = orig; break; } case StoreType::Bool: { diff --git a/src/dataencode.cpp b/src/dataencode.cpp index 5bf3990..d2d90c6 100644 --- a/src/dataencode.cpp +++ b/src/dataencode.cpp @@ -491,10 +491,10 @@ void from_wire_field(Buffer& buf, TypeStore& ctxt, const FieldDesc* desc, const case StoreType::UInteger: { auto& fld = store->as(); switch(desc->code.code) { - case TypeCode::UInt8: fld = from_wire_as(buf); return; - case TypeCode::UInt16: fld = from_wire_as(buf); return; - case TypeCode::UInt32: fld = from_wire_as(buf); return; - case TypeCode::UInt64: fld = from_wire_as(buf); return; + case TypeCode::UInt8: fld = from_wire_as(buf); return; + case TypeCode::UInt16: fld = from_wire_as(buf); return; + case TypeCode::UInt32: fld = from_wire_as(buf); return; + case TypeCode::UInt64: fld = from_wire_as(buf); return; default: break; } }