From 5a0fa31cc5de9b2fe59484207fdb03e8ed6b6e11 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Sat, 24 Nov 2018 09:24:32 -0800 Subject: [PATCH] fix linter warnings (#241) --- .../rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp b/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp index 04419c218..53efedec4 100644 --- a/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp +++ b/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp @@ -257,7 +257,8 @@ void serialize_field( ser.serialize(tmpstring); } } else { - auto & string_sequence_field = *reinterpret_cast(field); + auto & string_sequence_field = + *reinterpret_cast(field); std::vector cpp_string_vector; for (size_t i = 0; i < string_sequence_field.size; ++i) { cpp_string_vector.push_back( @@ -503,7 +504,8 @@ size_t next_field_align( } else { current_alignment += eprosima::fastcdr::Cdr::alignment(current_alignment, padding); current_alignment += padding; - auto & string_sequence_field = *reinterpret_cast(field); + auto & string_sequence_field = + *reinterpret_cast(field); for (size_t i = 0; i < string_sequence_field.size; ++i) { current_alignment = CStringHelper::next_field_align( &(string_sequence_field.data[i]), current_alignment); @@ -697,8 +699,12 @@ inline void deserialize_field( std::vector cpp_string_vector; deser >> cpp_string_vector; - auto & string_sequence_field = *reinterpret_cast(field); - if (!rosidl_generator_c__String__Sequence__init(&string_sequence_field, cpp_string_vector.size())) { + auto & string_sequence_field = + *reinterpret_cast(field); + if ( + !rosidl_generator_c__String__Sequence__init( + &string_sequence_field, cpp_string_vector.size())) + { throw std::runtime_error("unable to initialize rosidl_generator_c__String array"); }