Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix linter warnings #241

Merged
merged 1 commit into from
Nov 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ void serialize_field<std::string>(
ser.serialize(tmpstring);
}
} else {
auto & string_sequence_field = *reinterpret_cast<rosidl_generator_c__String__Sequence *>(field);
auto & string_sequence_field =
*reinterpret_cast<rosidl_generator_c__String__Sequence *>(field);
std::vector<std::string> cpp_string_vector;
for (size_t i = 0; i < string_sequence_field.size; ++i) {
cpp_string_vector.push_back(
Expand Down Expand Up @@ -503,7 +504,8 @@ size_t next_field_align<std::string>(
} else {
current_alignment += eprosima::fastcdr::Cdr::alignment(current_alignment, padding);
current_alignment += padding;
auto & string_sequence_field = *reinterpret_cast<rosidl_generator_c__String__Sequence *>(field);
auto & string_sequence_field =
*reinterpret_cast<rosidl_generator_c__String__Sequence *>(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);
Expand Down Expand Up @@ -697,8 +699,12 @@ inline void deserialize_field<std::string>(
std::vector<std::string> cpp_string_vector;
deser >> cpp_string_vector;

auto & string_sequence_field = *reinterpret_cast<rosidl_generator_c__String__Sequence *>(field);
if (!rosidl_generator_c__String__Sequence__init(&string_sequence_field, cpp_string_vector.size())) {
auto & string_sequence_field =
*reinterpret_cast<rosidl_generator_c__String__Sequence *>(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");
}

Expand Down