From de935efe4f102aca47d67a43d2d9f73fdc87fd77 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 25 Mar 2024 12:33:54 +0100 Subject: codec: Fixed compilation errors and warnings --- modules/codec/c++/csv.hpp | 2 ++ modules/codec/c++/forst.tmpl.hpp | 18 ++++++++++-------- modules/codec/c++/schema_hash.hpp | 14 ++++++-------- 3 files changed, 18 insertions(+), 16 deletions(-) (limited to 'modules/codec/c++') diff --git a/modules/codec/c++/csv.hpp b/modules/codec/c++/csv.hpp index 3cb11c2..2d11bff 100644 --- a/modules/codec/c++/csv.hpp +++ b/modules/codec/c++/csv.hpp @@ -209,6 +209,8 @@ public: template static error_or decode(data& from, data& to){ + (void) to; + (void) from; return make_error(); } diff --git a/modules/codec/c++/forst.tmpl.hpp b/modules/codec/c++/forst.tmpl.hpp index 6b2f74a..a52f0b9 100644 --- a/modules/codec/c++/forst.tmpl.hpp +++ b/modules/codec/c++/forst.tmpl.hpp @@ -31,13 +31,14 @@ public: template struct forst_codec_info > { public: - static uint64_t max_layers(uint64_t i) constexpr noexcept { + template + static constexpr uint64_t max_layers() noexcept { if constexpr ( i < sizeof...(Members) ) { using MT = typename parameter_pack_type::type; - constexpr uint64_t layer_i = forst_codec_info::layers; + constexpr uint64_t layer_i = forst_codec_info::layers; - constexpr uint64_t layer_next = max_layers(i+1u); + constexpr uint64_t layer_next = max_layers(); constexpr uint64_t layer_val = layer_i > layer_next ? layer_i : layer_next; @@ -46,19 +47,20 @@ public: return 0u; } public: - static constexpr uint64_t layers = max_layers(0u); + static constexpr uint64_t layers = max_layers<0u>(); }; template struct forst_codec_info> { public: - static uint64_t max_layers(uint64_t i) constexpr noexcept { - if constexpr ( i < sizeof...(Members) ) { + template + static constexpr uint64_t max_layers() noexcept { + if constexpr ( i < sizeof...(T) ) { using MT = typename parameter_pack_type::type; constexpr uint64_t layer_i = forst_codec_info::layers; - constexpr uint64_t layer_next = max_layers(i+1u); + constexpr uint64_t layer_next = max_layers(); constexpr uint64_t layer_val = layer_i > layer_next ? layer_i : layer_next; @@ -67,7 +69,7 @@ public: return 0u; } public: - static constexpr uint64_t layers = max_layers(0u); + static constexpr uint64_t layers = max_layers<0u>(); }; } } diff --git a/modules/codec/c++/schema_hash.hpp b/modules/codec/c++/schema_hash.hpp index 5e44497..4b537e1 100644 --- a/modules/codec/c++/schema_hash.hpp +++ b/modules/codec/c++/schema_hash.hpp @@ -137,19 +137,17 @@ struct schema_hash_seed> { } }; -template -struct schema_hash_seed...>> { - using Schema = schema::Struct...>; +template +struct schema_hash_seed> { + using Schema = schema::Struct; template static constexpr uint32_t apply_ele(uint32_t seed){ - using Type = typename parameter_pack_type::type; - constexpr string_literal Lit = parameter_key_pack_type::literal; - using MemberT = typename parameter_pack_type...>::type; + using MemberT = typename parameter_pack_type::type; seed = schema_hash_seed::apply(seed); - if constexpr ( (i+1) < sizeof...(V) ){ + if constexpr ( (i+1) < sizeof...(Members) ){ return apply_ele(seed); } return seed; @@ -157,7 +155,7 @@ struct schema_hash_seed...>> { static constexpr uint32_t apply(uint32_t seed){ seed = hash_literal::apply(seed); - if constexpr (sizeof...(V) > 0){ + if constexpr (sizeof...(Members) > 0){ seed = apply_ele<0>(seed); } return seed; -- cgit v1.2.3