From 2dcbc3bd263907a424b68bb3393dfadd8a29f239 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 10 Sep 2024 20:47:35 +0200 Subject: Fixing compile errors from last change --- modules/codec-json/c++/json.tmpl.hpp | 2 +- modules/codec-json/tests/codec-json.cpp | 16 ++++++++-------- modules/codec-netcdf/tests/codec-netcdf.cpp | 2 +- modules/crypto/c++/hash.hpp | 6 +++--- modules/io_codec/examples/peer_echo_client.cpp | 2 +- modules/io_codec/examples/peer_echo_server.cpp | 2 +- modules/remote-filesystem/examples/remote_read_file.cpp | 2 +- modules/remote/tests/remote_loopback.cpp | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/codec-json/c++/json.tmpl.hpp b/modules/codec-json/c++/json.tmpl.hpp index bead73a..1eb46bc 100644 --- a/modules/codec-json/c++/json.tmpl.hpp +++ b/modules/codec-json/c++/json.tmpl.hpp @@ -109,7 +109,7 @@ struct json_encode { return err; } } - for(std::size_t i = 0; i < from.size(); ++i){ + for(std::size_t i = 0; i < from.size().get(); ++i){ auto err = to.push(from.get_at(i)); if(!err.template is_type()){ return err; diff --git a/modules/codec-json/tests/codec-json.cpp b/modules/codec-json/tests/codec-json.cpp index 1d6c0f0..95b0d40 100644 --- a/modules/codec-json/tests/codec-json.cpp +++ b/modules/codec-json/tests/codec-json.cpp @@ -273,10 +273,10 @@ SAW_TEST("Three Dim Array write and read"){ data native{2,1,2}; data json; - native.at(0,0,0).set("multi"); - native.at(0,0,1).set("baz"); - native.at(1,0,0).set("foo"); - native.at(1,0,1).set("bar"); + native.at({0,0,0}).set("multi"); + native.at({0,0,1}).set("baz"); + native.at({1,0,0}).set("foo"); + native.at({1,0,1}).set("bar"); codec codec; @@ -291,10 +291,10 @@ SAW_TEST("Three Dim Array write and read"){ native = {}; eov = codec.decode(json, native); SAW_EXPECT(eov.is_value(), "Decoding error"); - SAW_EXPECT(native.at(0,0,0) == "multi", "Invalid Value at 0,0,0"); - SAW_EXPECT(native.at(0,0,1) == "baz", "Invalid Value at 0,0,1"); - SAW_EXPECT(native.at(1,0,0) == "foo", "Invalid Value at 1,0,0"); - SAW_EXPECT(native.at(1,0,1) == "bar", "Invalid Value at 1,0,1"); + SAW_EXPECT(native.at({0,0,0}) == "multi", "Invalid Value at 0,0,0"); + SAW_EXPECT(native.at({0,0,1}) == "baz", "Invalid Value at 0,0,1"); + SAW_EXPECT(native.at({1,0,0}) == "foo", "Invalid Value at 1,0,0"); + SAW_EXPECT(native.at({1,0,1}) == "bar", "Invalid Value at 1,0,1"); } diff --git a/modules/codec-netcdf/tests/codec-netcdf.cpp b/modules/codec-netcdf/tests/codec-netcdf.cpp index 7e624df..540f60e 100644 --- a/modules/codec-netcdf/tests/codec-netcdf.cpp +++ b/modules/codec-netcdf/tests/codec-netcdf.cpp @@ -97,7 +97,7 @@ SAW_TEST("NetCDF Struct Array read"){ for(std::size_t i = 0; i < 5; ++i){ for(std::size_t j = 0; j < 3; ++j){ int64_t exp_val = i * 3 + j; - SAW_EXPECT(arr.at(i,j).get() == exp_val, "Incorrect value"); + SAW_EXPECT(arr.at({i,j}).get() == exp_val, "Incorrect value"); } } } diff --git a/modules/crypto/c++/hash.hpp b/modules/crypto/c++/hash.hpp index 8e8ca86..d7cf94d 100644 --- a/modules/crypto/c++/hash.hpp +++ b/modules/crypto/c++/hash.hpp @@ -14,14 +14,14 @@ template<> class hash { public: error_or> apply(const data& input, const data& salt){ - SAW_ASSERT(input.size() > 0u){ + SAW_ASSERT(input.size().get() > 0u){ return make_error("Strings for hashing shouldn't be zero"); } uint32_t t_cost = 2; uint32_t m_cost = 1<<16; uint32_t parallel = 1; const char* salt_c_ptr = nullptr; - if(salt.size() > 0){ + if(salt.size().get() > 0){ salt_c_ptr = &salt.at(0); } data hash; @@ -30,7 +30,7 @@ public: }catch(const std::exception&){ return make_error("Couldn't allocate hash string"); } - int rv = argon2i_hash_raw(t_cost, m_cost, parallel, &input.at(0), input.size(), salt_c_ptr, salt.size(), &hash.at(0), hash.size()); + int rv = argon2i_hash_raw(t_cost, m_cost, parallel, &input.at(0), input.size().get(), salt_c_ptr, salt.size().get(), &hash.at(0), hash.size().get()); if(rv != ARGON2_OK){ return make_error("Failed to hash"); } diff --git a/modules/io_codec/examples/peer_echo_client.cpp b/modules/io_codec/examples/peer_echo_client.cpp index 7cd6fe7..942deed 100644 --- a/modules/io_codec/examples/peer_echo_client.cpp +++ b/modules/io_codec/examples/peer_echo_client.cpp @@ -101,7 +101,7 @@ int main(int argc, char** argv){ exit(-2); } std::cout<<"Answer:\n"; - for(uint64_t i = 0u; i < nat_resp.size(); ++i){ + for(uint64_t i = 0u; i < nat_resp.size().get(); ++i){ if (nat_resp.at(i) != nat_echo.at(i)){ exit(-3); } diff --git a/modules/io_codec/examples/peer_echo_server.cpp b/modules/io_codec/examples/peer_echo_server.cpp index 5670953..4d201c0 100644 --- a/modules/io_codec/examples/peer_echo_server.cpp +++ b/modules/io_codec/examples/peer_echo_server.cpp @@ -70,7 +70,7 @@ int main(){ return eov; } } - for(uint64_t i = 0u; i < nat_resp.size(); ++i){ + for(uint64_t i = 0u; i < nat_resp.size().get(); ++i){ std::cout<().size();++i) std::cout<().at(i); + for(uint64_t i = 0; i < nat_foo.template get<"a">().size().get();++i) std::cout<().at(i); std::cout<<"\nb: "<().get()< foo{4}; - for(uint64_t i = 0; i < foo.size(); ++i){ + for(uint64_t i = 0; i < foo.size().get(); ++i){ foo.at(i).set(i * 2.0); } id sent_id = [&](){ @@ -85,7 +85,7 @@ SAW_TEST("Remote Loopback Data"){ auto conv = client.receive(alloc_id); auto eov = conv.take(); SAW_EXPECT(eov.is_value(), "Failed receive."); - SAW_EXPECT(eov.get_value().size() == 4u, "Wrong received value."); + SAW_EXPECT(eov.get_value().size().get() == 4u, "Wrong received value."); } } -- cgit v1.2.3