summaryrefslogtreecommitdiff
path: root/modules/codec/c++/simple.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/codec/c++/simple.hpp')
-rw-r--r--modules/codec/c++/simple.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/codec/c++/simple.hpp b/modules/codec/c++/simple.hpp
index 33831b6..4990578 100644
--- a/modules/codec/c++/simple.hpp
+++ b/modules/codec/c++/simple.hpp
@@ -169,7 +169,7 @@ template<typename FromEnc>
struct kelsimple_encode<schema::String, FromEnc> {
static error_or<void> encode(const data<schema::String, FromEnc>& from, buffer& to){
const auto str_size = from.size();
- typename native_data_type<schema::UInt64>::type str_len = static_cast<uint64_t>(str_size);
+ typename native_data_type<schema::UInt64>::type str_len = static_cast<uint64_t>(str_size.get());
{
auto eov = stream_value<schema::UInt64>::encode(str_len, to);
if(eov.is_error()){
@@ -177,8 +177,8 @@ struct kelsimple_encode<schema::String, FromEnc> {
}
}
- for(std::size_t i = 0; i < str_size; ++i){
- auto eov = stream_value<schema::Int8>::encode(from.at(i), to);
+ for(data<schema::UInt64> i = 0; i < str_size; ++i){
+ auto eov = stream_value<schema::Int8>::encode(from.at(i.get()), to);
if(eov.is_error()){
return eov;
}
@@ -344,14 +344,14 @@ struct kelsimple_decode<schema::String, FromEnc> {
}
to = data<schema::String,FromEnc>{val};
}
- const std::size_t str_size = to.size();
- for(std::size_t i = 0; i < str_size; ++i){
+ const data<schema::UInt64> str_size = to.size();
+ for(data<schema::UInt64> i = 0; i < str_size; ++i){
int8_t val{};
auto eov = stream_value<schema::Int8>::decode(val, from);
if(eov.is_error()){
return eov;
}
- to.set_at(i, val);
+ to.set_at(i.get(), val);
}
return void_t{};
}