Skip to content

Commit

Permalink
Always give value to output parameters.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
  • Loading branch information
MiguelCompany committed Apr 8, 2021
1 parent a48066e commit e69b64e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,9 @@ size_t max_serialized_size_@('__'.join([package_name] + list(interface_path.pare
const size_t wchar_size = 4;
(void)padding;
(void)wchar_size;
(void)full_bounded;
(void)is_plain;

full_bounded = true;
is_plain = true;

@[for member in message.structure.members]@
// member: @(member.name)
Expand Down Expand Up @@ -583,9 +584,13 @@ if isinstance(type_, AbstractNestedType):
@[ end if]@
@[ else]
for (size_t index = 0; index < array_size; ++index) {
bool inner_full_bounded;
bool inner_is_plain;
current_alignment +=
max_serialized_size_@('__'.join(type_.namespaced_name()))(
full_bounded, is_plain, current_alignment);
inner_full_bounded, inner_is_plain, current_alignment);
full_bounded &= inner_full_bounded;
is_plain &= inner_is_plain;
}
@[ end if]@
}
Expand All @@ -596,11 +601,6 @@ if isinstance(type_, AbstractNestedType):

static size_t _@(message.structure.namespaced_type.name)__max_serialized_size(bool & full_bounded, bool & is_plain)
{
// Start considering the type is plain.
// Internal methods will set values to false when necessary.
full_bounded = true;
is_plain = true;

return max_serialized_size_@('__'.join([package_name] + list(interface_path.parents[0].parts) + [message.structure.namespaced_type.name]))(
full_bounded, is_plain, 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,9 @@ max_serialized_size_@(message.structure.namespaced_type.name)(
const size_t wchar_size = 4;
(void)padding;
(void)wchar_size;
(void)full_bounded;
(void)is_plain;

full_bounded = true;
is_plain = true;

@[for member in message.structure.members]@

Expand Down Expand Up @@ -422,9 +423,13 @@ if isinstance(type_, AbstractNestedType):
@[ end if]@
@[ else]
for (size_t index = 0; index < array_size; ++index) {
bool inner_full_bounded;
bool inner_is_plain;
current_alignment +=
@('::'.join(type_.namespaces))::typesupport_fastrtps_cpp::max_serialized_size_@(type_.name)(
full_bounded, is_plain, current_alignment);
inner_full_bounded, inner_is_plain, current_alignment);
full_bounded &= inner_full_bounded;
is_plain &= inner_is_plain;
}
@[ end if]@
}
Expand Down Expand Up @@ -464,11 +469,6 @@ static uint32_t _@(message.structure.namespaced_type.name)__get_serialized_size(

static size_t _@(message.structure.namespaced_type.name)__max_serialized_size(bool & full_bounded, bool & is_plain)
{
// Start considering the type is plain.
// Internal methods will set values to false when necessary.
full_bounded = true;
is_plain = true;

return max_serialized_size_@(message.structure.namespaced_type.name)(full_bounded, is_plain, 0);
}

Expand Down

0 comments on commit e69b64e

Please sign in to comment.