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"); }