Skip to content

Commit 7cd82d5

Browse files
committed
resolve clang warnings & suggestions
1 parent 8578a64 commit 7cd82d5

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

core/include/moveit/task_constructor/stage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class Stage
209209
/// overload: const char* values are stored as std::string
210210
inline void setProperty(const std::string& name, const char* value) { setProperty(name, std::string(value)); }
211211
/// analyze source of error and report accordingly
212-
void reportPropertyError(const Property::error& e);
212+
[[noreturn]] void reportPropertyError(const Property::error& e);
213213
double getTotalComputeTime() const;
214214

215215
protected:

core/src/container.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ void SerialContainer::onNewSolution(const SolutionBase& current) {
366366
solution.reserve(children.size());
367367
for (auto& in : incoming.solutions) {
368368
for (auto& out : outgoing.solutions) {
369-
InterfaceState::Priority prio(in.first.size() + 1 + out.first.size(), in.second + current.cost() + out.second);
369+
InterfaceState::Priority prio(static_cast<unsigned int>(in.first.size() + 1 + out.first.size()),
370+
in.second + current.cost() + out.second);
370371
// found a complete solution path connecting start to end?
371372
if (prio.depth() == children.size()) {
372373
if (std::isinf(prio.cost()))

core/src/stage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ std::ostream& operator<<(std::ostream& os, const InitStageException& e) {
6969
}
7070

7171
StagePrivate::StagePrivate(Stage* me, const std::string& name)
72-
: me_(me), name_(name), parent_(nullptr), total_compute_time_{}, introspection_(nullptr) {}
72+
: me_(me), name_(name), total_compute_time_{}, parent_(nullptr), introspection_(nullptr) {}
7373

7474
InterfaceFlags StagePrivate::interfaceFlags() const {
7575
InterfaceFlags f;
@@ -318,7 +318,7 @@ void StagePrivate::composePropertyErrorMsg(const std::string& property_name, std
318318
os << ", inherits from parent";
319319
if (p.initsFrom(Stage::INTERFACE))
320320
os << ", initializes from interface";
321-
} catch (const Property::undeclared& e) {
321+
} catch (const Property::undeclared&) {
322322
os << "undeclared";
323323
}
324324
if (parent()->parent())

visualization/motion_planning_tasks/src/task_display.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ class TaskDisplay : public rviz::Display
7676

7777
public:
7878
TaskDisplay();
79-
~TaskDisplay();
79+
~TaskDisplay() override;
8080

8181
void loadRobotModel();
8282

8383
void update(float wall_dt, float ros_dt) override;
8484
void reset() override;
85-
void save(rviz::Config config) const;
86-
void load(const rviz::Config& config);
85+
void save(rviz::Config config) const override;
86+
void load(const rviz::Config& config) override;
8787

88-
void setName(const QString& name);
88+
void setName(const QString& name) override;
8989
void setSolutionStatus(bool ok);
9090

9191
TaskListModel& getTaskListModel() { return *task_list_model_; }

visualization/motion_planning_tasks/src/task_panel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void setExpanded(QTreeView* view, const QModelIndex& index, bool expand, int dep
192192
// recursively expand all children
193193
if (depth != 0) {
194194
for (int row = 0, rows = index.model()->rowCount(index); row < rows; ++row)
195-
setExpanded(view, index.child(row, 0), expand, depth - 1);
195+
setExpanded(view, index.model()->index(row, 0, index), expand, depth - 1);
196196
}
197197

198198
view->setExpanded(index, expand);
@@ -212,7 +212,7 @@ TaskViewPrivate::TaskViewPrivate(TaskView* q_ptr) : q_ptr(q_ptr), exec_action_cl
212212
if (parent.isValid() && !parent.parent().isValid()) { // top-level task items inserted
213213
int expand = this->q_ptr->initial_task_expand->getOptionInt();
214214
for (int row = first; row <= last; ++row) {
215-
QModelIndex child = parent.child(row, 0);
215+
QModelIndex child = parent.model()->index(row, 0, parent);
216216
if (expand != TaskView::EXPAND_NONE) {
217217
// recursively expand all inserted items
218218
setExpanded(tasks_view, child, true);
@@ -352,7 +352,7 @@ void TaskView::load(const rviz::Config& config) {
352352

353353
QTreeView* view = d_ptr->solutions_view;
354354
rviz::Config group = config.mapGetChild("solution_sorting");
355-
int order;
355+
int order = 0;
356356
if (group.mapGetInt("column", &column) && group.mapGetInt("order", &order))
357357
view->sortByColumn(column, static_cast<Qt::SortOrder>(order));
358358
}

0 commit comments

Comments
 (0)