Skip to content
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.

Commit

Permalink
Fix some comparisons with a sign mismatch (#32)
Browse files Browse the repository at this point in the history
Signed-off-by: Scott K Logan <logans@cottsay.net>
  • Loading branch information
cottsay committed Jun 24, 2019
1 parent 8b0a298 commit f430a91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ convert_ros_to_dds_@(__ros_msg_type_prefix)(const void * untyped_ros_message, vo
size_t size = @(member.type.size);
@[ else]@
size_t size = ros_message->@(member.name).size;
if (size > (std::numeric_limits<DDS::Long>::max)()) {
if (size > static_cast<size_t>((std::numeric_limits<DDS::Long>::max)())) {
return "array size exceeds maximum DDS sequence size";
}
DDS::Long length = static_cast<DDS::Long>(size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ convert_ros_message_to_dds(
size_t size = @(member.type.size);
@[ else]@
size_t size = ros_message.@(member.name).size();
if (size > (std::numeric_limits<DDS::Long>::max)()) {
if (size > static_cast<size_t>((std::numeric_limits<DDS::Long>::max)())) {
throw std::runtime_error("array size exceeds maximum DDS sequence size");
}
DDS::Long length = static_cast<DDS::Long>(size);
Expand Down

0 comments on commit f430a91

Please sign in to comment.