From bec9653fa219a420d5733895223585ce391128d5 Mon Sep 17 00:00:00 2001 From: "Zezheng.Li" Date: Mon, 31 Jul 2023 17:44:53 +0800 Subject: [PATCH] fix format --- src/struct_pack/benchmark/msgpack_sample.hpp | 5 ++--- src/struct_pack/benchmark/struct_pb_sample.hpp | 4 ++-- src/struct_pack/tests/test_pragma_pack_and_alignas_mix.cpp | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/struct_pack/benchmark/msgpack_sample.hpp b/src/struct_pack/benchmark/msgpack_sample.hpp index 2e6003479c..ad7523379f 100644 --- a/src/struct_pack/benchmark/msgpack_sample.hpp +++ b/src/struct_pack/benchmark/msgpack_sample.hpp @@ -46,7 +46,7 @@ struct message_pack_sample : public base_sample { } private: - template + template void serialize(SampleType sample_type, T &sample) { { msgpack::pack(buffer_, sample); @@ -69,9 +69,8 @@ struct message_pack_sample : public base_sample { buf_size_map_.emplace(sample_type, buffer_.size()); } - template + template void deserialize(SampleType sample_type, T &sample) { - // get serialized buffer of sample for deserialize buffer_.clear(); msgpack::pack(buffer_, sample); diff --git a/src/struct_pack/benchmark/struct_pb_sample.hpp b/src/struct_pack/benchmark/struct_pb_sample.hpp index 72a261f733..23dc83c94f 100644 --- a/src/struct_pack/benchmark/struct_pb_sample.hpp +++ b/src/struct_pack/benchmark/struct_pb_sample.hpp @@ -116,7 +116,7 @@ struct struct_pb_sample_t : public base_sample { } private: - template + template void serialize(SampleType sample_type, T& sample) { auto sz = struct_pb::internal::get_needed_size(sample); buffer_.resize(sz); @@ -144,7 +144,7 @@ struct struct_pb_sample_t : public base_sample { buf_size_map_.emplace(sample_type, buffer_.size()); } - template + template void deserialize(SampleType sample_type, T& sample) { buffer_.clear(); auto sz = struct_pb::internal::get_needed_size(sample); diff --git a/src/struct_pack/tests/test_pragma_pack_and_alignas_mix.cpp b/src/struct_pack/tests/test_pragma_pack_and_alignas_mix.cpp index 25c54241ba..c9334ae68c 100644 --- a/src/struct_pack/tests/test_pragma_pack_and_alignas_mix.cpp +++ b/src/struct_pack/tests/test_pragma_pack_and_alignas_mix.cpp @@ -325,7 +325,7 @@ TEST_CASE("testing mix and compatible nested") { auto result = struct_pack::deserialize< test_pragma_pack_and_alignas_and_compatible_mix::dummy_2_4_v2>(buffer); CHECK(result.has_value() == true); - auto val=result.value(); + auto val = result.value(); CHECK(val == v2); } { @@ -333,7 +333,7 @@ TEST_CASE("testing mix and compatible nested") { auto result = struct_pack::deserialize< test_pragma_pack_and_alignas_and_compatible_mix::dummy_2_4_v1>(buffer); CHECK(result.has_value() == true); - auto val=result.value(); + auto val = result.value(); CHECK(val == v1); } }