diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000..0b704176b --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,8 @@ +--- +Checks: "-*, readability-delete-null-pointer" +WarningsAsErrors: true +HeaderFileExtensions: ['', 'h','hh','hpp','hxx'] +ImplementationFileExtensions: ['c','cc','cpp','cxx'] +HeaderFilterRegex: '' +FormatStyle: none +InheritParentConfig: false diff --git a/src/fdb5/api/fdb_c.cc b/src/fdb5/api/fdb_c.cc index 6a34344e7..eb69bc9d5 100644 --- a/src/fdb5/api/fdb_c.cc +++ b/src/fdb5/api/fdb_c.cc @@ -9,7 +9,6 @@ */ #include "eckit/io/MemoryHandle.h" -#include "eckit/io/FileDescHandle.h" #include "eckit/message/Message.h" #include "eckit/runtime/Main.h" #include "eckit/config/YAMLConfiguration.h" @@ -66,8 +65,8 @@ struct fdb_request_t { Tokenizer parse("/"); for (int i=0; i result; - parse(values[i], result); + std::vector result; + parse(values[i], result); vv.insert(std::end(vv), std::begin(result), std::end(result)); } request_.values(n, vv); @@ -110,7 +109,7 @@ struct fdb_split_key_t { } else { return FDB_ITERATION_COMPLETE; } - } + } while (it_ == key_->at(level_).end()) { if (level_size()-1) { level_++; @@ -198,11 +197,10 @@ struct fdb_datareader_t { return dh_->size(); } void set(DataHandle* dh) { - if (dh_) - delete dh_; + delete dh_; dh_ = dh; } - + private: DataHandle* dh_; }; diff --git a/src/fdb5/database/Report.h b/src/fdb5/database/Report.h index 9b65ed6e3..268f945fe 100644 --- a/src/fdb5/database/Report.h +++ b/src/fdb5/database/Report.h @@ -17,6 +17,7 @@ #define fdb5_Report_H #include +#include #include "eckit/memory/NonCopyable.h"