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

Commit

Permalink
Fix build warnings due to -Wsign-compare with GCC 9. (#396)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
jacobperron committed Mar 19, 2020
1 parent c5d62e9 commit aa0a135
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rmw_connext_cpp/src/rmw_publish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ publish(DDS::DataWriter * dds_data_writer, const rcutils_uint8_array_t * cdr_str
DDS::ReturnCode_t status = DDS::RETCODE_ERROR;

instance->serialized_data.maximum(0);
if (cdr_stream->buffer_length > (std::numeric_limits<DDS_Long>::max)()) {
if (cdr_stream->buffer_length > static_cast<size_t>((std::numeric_limits<DDS_Long>::max)())) {
RMW_SET_ERROR_MSG("cdr_stream->buffer_length unexpectedly larger than DDS_Long's max value");
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion rmw_connext_shared_cpp/src/qos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ set_entity_qos_from_profile_generic(
entity_qos.history.kind == DDS::KEEP_LAST_HISTORY_QOS &&
static_cast<size_t>(entity_qos.history.depth) < qos_profile.depth)
{
if (qos_profile.depth > (std::numeric_limits<DDS::Long>::max)()) {
if (qos_profile.depth > static_cast<size_t>((std::numeric_limits<DDS::Long>::max)())) {
RMW_SET_ERROR_MSG(
"failed to set history depth since the requested queue size exceeds the DDS type");
return false;
Expand Down

0 comments on commit aa0a135

Please sign in to comment.