Skip to content

Commit 8578a64

Browse files
committed
correct sign for StageCallback type
backward compatible, the function type implicitly converts from previous int definitions.
1 parent cc86dd8 commit 8578a64

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/include/moveit/task_constructor/container.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ContainerBase : public Stage
5656

5757
/** Callback function type used by traverse functions
5858
* The callback should return false if traversal should be stopped. */
59-
typedef std::function<bool(const Stage&, int depth)> StageCallback;
59+
typedef std::function<bool(const Stage&, unsigned int depth)> StageCallback;
6060
/// traverse direct children of this container, calling the callback for each of them
6161
bool traverseChildren(const StageCallback& processor) const;
6262
/// traverse all children of this container recursively

core/src/container.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ void ContainerBase::init(const moveit::core::RobotModelConstPtr& robot_model) {
285285
}
286286

287287
std::ostream& operator<<(std::ostream& os, const ContainerBase& container) {
288-
ContainerBase::StageCallback processor = [&os](const Stage& stage, int depth) -> bool {
288+
ContainerBase::StageCallback processor = [&os](const Stage& stage, unsigned int depth) -> bool {
289289
os << std::string(2 * depth, ' ') << *stage.pimpl() << std::endl;
290290
return true;
291291
};

core/src/introspection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void Introspection::fillStageStatistics(const Stage& stage, moveit_task_construc
204204

205205
moveit_task_constructor_msgs::TaskDescription&
206206
Introspection::fillTaskDescription(moveit_task_constructor_msgs::TaskDescription& msg) {
207-
ContainerBase::StageCallback stageProcessor = [this, &msg](const Stage& stage, int) -> bool {
207+
ContainerBase::StageCallback stageProcessor = [this, &msg](const Stage& stage, unsigned int) -> bool {
208208
// this method is called for each child stage of a given parent
209209
moveit_task_constructor_msgs::StageDescription desc;
210210
desc.id = stageId(&stage);
@@ -240,7 +240,7 @@ Introspection::fillTaskDescription(moveit_task_constructor_msgs::TaskDescription
240240

241241
moveit_task_constructor_msgs::TaskStatistics&
242242
Introspection::fillTaskStatistics(moveit_task_constructor_msgs::TaskStatistics& msg) {
243-
ContainerBase::StageCallback stageProcessor = [this, &msg](const Stage& stage, int) -> bool {
243+
ContainerBase::StageCallback stageProcessor = [this, &msg](const Stage& stage, unsigned int) -> bool {
244244
// this method is called for each child stage of a given parent
245245
moveit_task_constructor_msgs::StageStatistics stat; // create new Stage msg
246246
stat.id = stageId(&stage);

0 commit comments

Comments
 (0)