Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Fix different signedness compiler warnings (#42)
Browse files Browse the repository at this point in the history
Specifically, "comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’"

Signed-off-by: Jacob Perron <[email protected]>
  • Loading branch information
jacobperron authored Feb 1, 2020
1 parent 5172a65 commit ee6472e
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 @@ -189,7 +189,7 @@ if isinstance(type_, AbstractNestedType):
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 > (std::numeric_limits<size_t>::max)()) {
fprintf(stderr, "array size exceeds maximum DDS sequence size\n");
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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 > (std::numeric_limits<size_t>::max)()) {
throw std::runtime_error("array size exceeds maximum DDS sequence size");
}
@[ if isinstance(member.type, BoundedSequence)]@
Expand Down

0 comments on commit ee6472e

Please sign in to comment.