The comment in the code explains it in a lot more detail, but essentially this avoids a signed/unsigned mismatch in higher level code. Since the depth is meaningless in KEEP_ALL anyway, this shouldn't have any deleterious effects elsewhere. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> (cherry picked from commit d5980d5a8fb753d2d7074c635426b9a2805928ba) Co-authored-by: Chris Lalancette <clalancette@openrobotics.org>
This commit is contained in:
parent
517fd655bd
commit
410aa61d81
1 changed files with 7 additions and 1 deletions
|
@ -1739,7 +1739,13 @@ static bool dds_qos_to_rmw_qos(const dds_qos_t * dds_qos, rmw_qos_profile_t * qo
|
||||||
break;
|
break;
|
||||||
case DDS_HISTORY_KEEP_ALL:
|
case DDS_HISTORY_KEEP_ALL:
|
||||||
qos_policies->history = RMW_QOS_POLICY_HISTORY_KEEP_ALL;
|
qos_policies->history = RMW_QOS_POLICY_HISTORY_KEEP_ALL;
|
||||||
qos_policies->depth = (uint32_t) depth;
|
// When using a policy of KEEP_ALL, the depth is meaningless.
|
||||||
|
// CycloneDDS reports this as -1, but the rmw_qos_profile_t structure
|
||||||
|
// expects an unsigned number. Casting -1 to unsigned would yield
|
||||||
|
// a value of 2^32 - 1, but unfortunately our XML-RPC connection
|
||||||
|
// (used for the command-line tools) doesn't understand anything
|
||||||
|
// larger than 2^31 - 1. Just set the depth to 0 here instead.
|
||||||
|
qos_policies->depth = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
rmw_cyclonedds_cpp::unreachable();
|
rmw_cyclonedds_cpp::unreachable();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue