diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-09-10 20:39:21 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-09-10 20:39:21 +0200 |
commit | a4456ca179fe154cfd797225c16d4baf011abaee (patch) | |
tree | 44ae471923121e3f85bbd8ef1258cd16a77d07bf /modules/codec/c++/simple.hpp | |
parent | 6b761abbee4361571bd74e3deda9370ad94bd470 (diff) |
Changing return types on data functions
Diffstat (limited to 'modules/codec/c++/simple.hpp')
-rw-r--r-- | modules/codec/c++/simple.hpp | 12 |
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{}; } |