Skip to content

Commit

Permalink
use sizeof(wchar_t)
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
  • Loading branch information
dirk-thomas committed May 4, 2019
1 parent 5bf06fb commit 032fde8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ size_t get_serialized_size_@('__'.join([package_name] + list(interface_path.pare
current_alignment += padding +
eprosima::fastcdr::Cdr::alignment(current_alignment, padding) +
@[ if isinstance(member.type.value_type, AbstractWString)]@
4 *
sizeof(wchar_t) *
@[ end if]@
(array_ptr[index].size + 1);
}
Expand All @@ -454,7 +454,7 @@ size_t get_serialized_size_@('__'.join([package_name] + list(interface_path.pare
current_alignment += padding +
eprosima::fastcdr::Cdr::alignment(current_alignment, padding) +
@[ if isinstance(member.type, AbstractWString)]@
4 *
sizeof(wchar_t) *
@[ end if]@
(ros_message->@(member.name).size + 1);
@[ elif isinstance(member.type, BasicType)]@
Expand Down Expand Up @@ -523,12 +523,12 @@ if isinstance(type_, AbstractNestedType):
eprosima::fastcdr::Cdr::alignment(current_alignment, padding) +
@[ if type_.has_maximum_size()]@
@[ if isinstance(type_, AbstractWString)]@
4 *
sizeof(wchar_t) *
@[ end if]@
@(type_.maximum_size) +
@[ end if]@
@[ if isinstance(type_, AbstractWString)]@
4 *
sizeof(wchar_t) *
@[ end if]@
1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ get_serialized_size(
current_alignment += padding +
eprosima::fastcdr::Cdr::alignment(current_alignment, padding) +
@[ if isinstance(member.type.value_type, AbstractWString)]@
4 *
sizeof(wchar_t) *
@[ end if]@
(ros_message.@(member.name)[index].size() + 1);
}
Expand All @@ -306,7 +306,7 @@ get_serialized_size(
current_alignment += padding +
eprosima::fastcdr::Cdr::alignment(current_alignment, padding) +
@[ if isinstance(member.type, AbstractWString)]@
4 *
sizeof(wchar_t) *
@[ end if]@
(ros_message.@(member.name).size() + 1);
@[ elif isinstance(member.type, BasicType)]@
Expand Down Expand Up @@ -339,6 +339,7 @@ max_serialized_size_@(message.structure.namespaced_type.name)(
(void)full_bounded;

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

// Member: @(member.name)
{
@[ if isinstance(member.type, AbstractNestedType)]@
Expand Down Expand Up @@ -370,12 +371,12 @@ if isinstance(type_, AbstractNestedType):
eprosima::fastcdr::Cdr::alignment(current_alignment, padding) +
@[ if type_.has_maximum_size()]@
@[ if isinstance(type_, AbstractWString)]@
4 *
sizeof(wchar_t) *
@[ end if]@
@(type_.maximum_size) +
@[ end if]@
@[ if isinstance(type_, AbstractWString)]@
4 *
sizeof(wchar_t) *
@[ end if]@
1;
}
Expand Down

0 comments on commit 032fde8

Please sign in to comment.