Fix some Clang warnings. (#1109)

task.cc: -Wparentheses
task_test.cc: -Winconsistent-missing-override
master
Michael Grupp 2018-04-25 12:22:11 +02:00 committed by Wally B. Feed
parent d9ada58710
commit 3d2ca564b6
2 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ void Task::AddDependency(std::weak_ptr<Task> dependency) {
{ {
MutexLocker locker(&mutex_); MutexLocker locker(&mutex_);
CHECK_EQ(state_, NEW); CHECK_EQ(state_, NEW);
if (shared_dependency = dependency.lock()) { if ((shared_dependency = dependency.lock())) {
++uncompleted_dependencies_; ++uncompleted_dependencies_;
} }
} }

View File

@ -34,14 +34,14 @@ class MockCallback {
class FakeThreadPool : public ThreadPoolInterface { class FakeThreadPool : public ThreadPoolInterface {
public: public:
void NotifyDependenciesCompleted(Task* task) { void NotifyDependenciesCompleted(Task* task) override {
auto it = tasks_not_ready_.find(task); auto it = tasks_not_ready_.find(task);
ASSERT_NE(it, tasks_not_ready_.end()); ASSERT_NE(it, tasks_not_ready_.end());
task_queue_.push_back(it->second); task_queue_.push_back(it->second);
tasks_not_ready_.erase(it); tasks_not_ready_.erase(it);
} }
void Schedule(const std::function<void()>& work_item) { void Schedule(const std::function<void()>& work_item) override {
LOG(FATAL) << "not implemented"; LOG(FATAL) << "not implemented";
} }