From b0c28eea15a64fab2308baf2f8c40fa550933f40 Mon Sep 17 00:00:00 2001 From: Sebastian Eibl <sebastian.eibl@fau.de> Date: Mon, 13 Aug 2018 13:54:37 +0200 Subject: [PATCH] clang-tidy -checks=-*,modernize-use-override --- apps/benchmarks/CouetteFlow/CouetteFlow.cpp | 4 ++-- apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp | 2 +- .../benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp | 4 ++-- apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp | 2 +- src/core/config/Create.cpp | 4 ++-- tests/blockforest/BlockForestTest.cpp | 4 ++-- tests/core/logging/LoggingTest.cpp | 6 +++--- tests/gather/GatherSchemeTest.cpp | 2 +- tests/gather/MPIGatherSchemeTest.cpp | 8 ++++---- tests/lbm/boundary/DiffusionDirichlet.cpp | 2 +- tests/mesh/QHullTest.cpp | 10 +++++----- tests/pe/BodyStorage.cpp | 4 ++-- .../SettlingSphereMEMDynamicRefinement.cpp | 2 +- 13 files changed, 27 insertions(+), 27 deletions(-) diff --git a/apps/benchmarks/CouetteFlow/CouetteFlow.cpp b/apps/benchmarks/CouetteFlow/CouetteFlow.cpp index 1653b7fe5..a947b2a8e 100644 --- a/apps/benchmarks/CouetteFlow/CouetteFlow.cpp +++ b/apps/benchmarks/CouetteFlow/CouetteFlow.cpp @@ -464,9 +464,9 @@ public: protected: - void configure() { WALBERLA_ASSERT_NOT_NULLPTR( this->block_ ); pdf_ = this->block_->template getData< PdfField_T >( bdid_ ); } + void configure() override { WALBERLA_ASSERT_NOT_NULLPTR( this->block_ ); pdf_ = this->block_->template getData< PdfField_T >( bdid_ ); } - OutputType evaluate( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t f ) + OutputType evaluate( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t f ) override { WALBERLA_ASSERT_NOT_NULLPTR( pdf_ ); diff --git a/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp b/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp index 6533faa12..462bbeb41 100644 --- a/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp +++ b/apps/benchmarks/NonUniformGrid/NonUniformGrid.cpp @@ -456,7 +456,7 @@ public: const BlockDataID & flagField, const BlockDataID & pdfField, const real_t velocity ) : forest_( forest ), flagField_( flagField ), pdfField_( pdfField ), velocity_( velocity ) {} - BoundaryHandling_T * initialize( IBlock * const block ); + BoundaryHandling_T * initialize( IBlock * const block ) override; private: diff --git a/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp b/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp index 9b8d8e326..165f81f28 100644 --- a/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp +++ b/apps/benchmarks/PoiseuilleChannel/PoiseuilleChannel.cpp @@ -594,9 +594,9 @@ public: protected: - void configure() { WALBERLA_ASSERT_NOT_NULLPTR( this->block_ ); pdf_ = this->block_->template getData< PdfField_T >( bdid_ ); } + void configure() override { WALBERLA_ASSERT_NOT_NULLPTR( this->block_ ); pdf_ = this->block_->template getData< PdfField_T >( bdid_ ); } - OutputType evaluate( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t f ) + OutputType evaluate( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t f ) override { WALBERLA_ASSERT_NOT_NULLPTR( pdf_ ); diff --git a/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp b/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp index f936bcebe..6dfb5a2a8 100644 --- a/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp +++ b/apps/benchmarks/SchaeferTurek/SchaeferTurek.cpp @@ -819,7 +819,7 @@ public: flagFieldId_( flagFieldId ), pdfFieldId_( pdfFieldId ), blocks_( blocks ), setup_( setup ), timeTracker_( timeTracker ) {} - BoundaryHandling_T * initialize( IBlock * const block ); + BoundaryHandling_T * initialize( IBlock * const block ) override; private: diff --git a/src/core/config/Create.cpp b/src/core/config/Create.cpp index 03de639d0..7e945cfd8 100644 --- a/src/core/config/Create.cpp +++ b/src/core/config/Create.cpp @@ -205,7 +205,7 @@ namespace config { public: SingleConfigGenerator( const shared_ptr<Config> & config ): config_ ( config ) {} - virtual shared_ptr<Config> next() + shared_ptr<Config> next() override { auto res = config_; config_.reset(); @@ -223,7 +223,7 @@ namespace config { MultipleConfigGenerator( const std::string & baseName, const std::string & extension, int numberOfDigits ) : baseName_( baseName ), extension_( extension ), numberOfDigits_( numberOfDigits), counter_(-1) {} - virtual shared_ptr<Config> next() + shared_ptr<Config> next() override { ++counter_; std::stringstream ss; diff --git a/tests/blockforest/BlockForestTest.cpp b/tests/blockforest/BlockForestTest.cpp index 490992e90..e032b7de6 100644 --- a/tests/blockforest/BlockForestTest.cpp +++ b/tests/blockforest/BlockForestTest.cpp @@ -149,7 +149,7 @@ class Derived : public Base { public: uint_t override() const { return 10; } - uint_t func() const { return 20; } + uint_t func() const override { return 20; } }; @@ -179,7 +179,7 @@ class Multi : public Base, public SecondBase public: bool operator==( const Multi& /*rhs*/ ) const { return true; } uint_t override() const { return 1000; } - uint_t func() const { return 2000; } + uint_t func() const override { return 2000; } }; diff --git a/tests/core/logging/LoggingTest.cpp b/tests/core/logging/LoggingTest.cpp index dff85f06b..60c2e1b50 100644 --- a/tests/core/logging/LoggingTest.cpp +++ b/tests/core/logging/LoggingTest.cpp @@ -33,15 +33,15 @@ class MyStamp : public logging::Logging::CustomStamp { public: MyStamp() : step_(uint_c(0)) {} - ~MyStamp() = default; + ~MyStamp() override = default; void step( uint_t s ) { step_ = s; } - std::string stamp() + std::string stamp() override { std::ostringstream oss; oss << "[" << step_ << "]"; return oss.str(); } - uint_t maxStampWidth() { return 5; } + uint_t maxStampWidth() override { return 5; } private: uint_t step_; }; diff --git a/tests/gather/GatherSchemeTest.cpp b/tests/gather/GatherSchemeTest.cpp index 3c1b63868..438d731de 100644 --- a/tests/gather/GatherSchemeTest.cpp +++ b/tests/gather/GatherSchemeTest.cpp @@ -95,7 +95,7 @@ public: : cellInterval_ ( ci ) {} - virtual void process(const std::vector<std::vector<real_t> > & data) + void process(const std::vector<std::vector<real_t> > & data) override { uint_t counter =0; for( auto it = cellInterval_.begin(); it != cellInterval_.end(); ++it ) diff --git a/tests/gather/MPIGatherSchemeTest.cpp b/tests/gather/MPIGatherSchemeTest.cpp index ae32771d4..aecb1e184 100644 --- a/tests/gather/MPIGatherSchemeTest.cpp +++ b/tests/gather/MPIGatherSchemeTest.cpp @@ -40,10 +40,10 @@ class TestGatherPackInfo : public gather::GatherPackInfo { public: TestGatherPackInfo() = default; - virtual ~TestGatherPackInfo() = default; + ~TestGatherPackInfo() override = default; - virtual void packData ( const IBlock *, mpi::GenericSendBuffer<unsigned char> & outBuffer ) + void packData ( const IBlock *, mpi::GenericSendBuffer<unsigned char> & outBuffer ) override { auto mpi = MPIManager::instance(); @@ -56,7 +56,7 @@ public: } - virtual void unpackData( mpi::GenericRecvBuffer<unsigned char> & buffer ) + void unpackData( mpi::GenericRecvBuffer<unsigned char> & buffer ) override { int nrOfItems; buffer >> nrOfItems; @@ -68,7 +68,7 @@ public: receivedRanks_.insert( nrOfItems ); } - virtual void gatherFinished() + void gatherFinished() override { auto mpi = MPIManager::instance(); diff --git a/tests/lbm/boundary/DiffusionDirichlet.cpp b/tests/lbm/boundary/DiffusionDirichlet.cpp index 33670cb3b..98215ff64 100644 --- a/tests/lbm/boundary/DiffusionDirichlet.cpp +++ b/tests/lbm/boundary/DiffusionDirichlet.cpp @@ -196,7 +196,7 @@ class CosBoundaryConfiguration : public MyBoundaryHandling::DiffusionDirichlet_T public: CosBoundaryConfiguration( real_t period ) : period_( period ){} - virtual void val( real_t& _val, cell_idx_t x, cell_idx_t, cell_idx_t ) const { _val = real_c( cos( period_*( real_c(x) + real_c(0.5) ) ) ); } + void val( real_t& _val, cell_idx_t x, cell_idx_t, cell_idx_t ) const override { _val = real_c( cos( period_*( real_c(x) + real_c(0.5) ) ) ); } private: const real_t period_; diff --git a/tests/mesh/QHullTest.cpp b/tests/mesh/QHullTest.cpp index 65998853e..ddb4d46e5 100644 --- a/tests/mesh/QHullTest.cpp +++ b/tests/mesh/QHullTest.cpp @@ -46,12 +46,12 @@ class PointCloudDataSource : public vtk::PointDataSource public: PointCloudDataSource( const std::vector<Vector3<real_t>> & pointCloud ) : pointCloud_( pointCloud ) {} - virtual std::vector< Attributes > getAttributes() const { return std::vector< Attributes >(); } - virtual std::vector< Vector3< real_t > > getPoints() { return pointCloud_; } - virtual void configure() {}; + std::vector< Attributes > getAttributes() const override { return std::vector< Attributes >(); } + std::vector< Vector3< real_t > > getPoints() override { return pointCloud_; } + void configure() override {}; - virtual void push( std::ostream& /*os*/, const uint_t /*data*/, const uint_t /*point*/, const uint_t /*component*/ ) {}; - virtual void push( vtk::Base64Writer& /*b64*/, const uint_t /*data*/, const uint_t /*point*/, const uint_t /*component*/ ) {}; + void push( std::ostream& /*os*/, const uint_t /*data*/, const uint_t /*point*/, const uint_t /*component*/ ) override {}; + void push( vtk::Base64Writer& /*b64*/, const uint_t /*data*/, const uint_t /*point*/, const uint_t /*component*/ ) override {}; private: std::vector<Vector3<real_t>> pointCloud_; diff --git a/tests/pe/BodyStorage.cpp b/tests/pe/BodyStorage.cpp index 498f97394..730639317 100644 --- a/tests/pe/BodyStorage.cpp +++ b/tests/pe/BodyStorage.cpp @@ -32,14 +32,14 @@ class Body1 : public Sphere { public: static int refCount; Body1(walberla::id_t id, MaterialID matID) : Sphere(id, id, Vec3(0,0,0), Vec3(0,0,0), Quat(), 1, matID, false, true, false) {++refCount;} - ~Body1() {--refCount;} + ~Body1() override {--refCount;} }; class Body2 : public Sphere { public: static int refCount; Body2(walberla::id_t id, MaterialID matID) : Sphere(id, id, Vec3(0,0,0), Vec3(0,0,0), Quat(), 1, matID, false, true, false) {++refCount;} - ~Body2() {--refCount;} + ~Body2() override {--refCount;} }; int Body1::refCount = 0; diff --git a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp index fa5d1d216..3104a3c88 100644 --- a/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp +++ b/tests/pe_coupling/momentum_exchange_method/SettlingSphereMEMDynamicRefinement.cpp @@ -287,7 +287,7 @@ public: blocks_( blocks ), flagFieldID_( flagFieldID ), pdfFieldID_( pdfFieldID ), bodyFieldID_ ( bodyFieldID ) {} - BoundaryHandling_T * initialize( IBlock * const block ); + BoundaryHandling_T * initialize( IBlock * const block ) override; private: -- GitLab