From 3d2ca564b6d8da348556d1012a39fa8422b235e5 Mon Sep 17 00:00:00 2001 From: Michael Grupp Date: Wed, 25 Apr 2018 12:22:11 +0200 Subject: [PATCH] Fix some Clang warnings. (#1109) task.cc: -Wparentheses task_test.cc: -Winconsistent-missing-override --- cartographer/common/task.cc | 2 +- cartographer/common/task_test.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cartographer/common/task.cc b/cartographer/common/task.cc index 7202268..dc3d28b 100644 --- a/cartographer/common/task.cc +++ b/cartographer/common/task.cc @@ -42,7 +42,7 @@ void Task::AddDependency(std::weak_ptr dependency) { { MutexLocker locker(&mutex_); CHECK_EQ(state_, NEW); - if (shared_dependency = dependency.lock()) { + if ((shared_dependency = dependency.lock())) { ++uncompleted_dependencies_; } } diff --git a/cartographer/common/task_test.cc b/cartographer/common/task_test.cc index 935b7a5..69eb54c 100644 --- a/cartographer/common/task_test.cc +++ b/cartographer/common/task_test.cc @@ -34,14 +34,14 @@ class MockCallback { class FakeThreadPool : public ThreadPoolInterface { public: - void NotifyDependenciesCompleted(Task* task) { + void NotifyDependenciesCompleted(Task* task) override { auto it = tasks_not_ready_.find(task); ASSERT_NE(it, tasks_not_ready_.end()); task_queue_.push_back(it->second); tasks_not_ready_.erase(it); } - void Schedule(const std::function& work_item) { + void Schedule(const std::function& work_item) override { LOG(FATAL) << "not implemented"; }