Skip to content

Commit

Permalink
[CORE] Changes suggested by new llvm18 clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Sep 5, 2024
1 parent 15ea9bb commit c249daf
Show file tree
Hide file tree
Showing 78 changed files with 182 additions and 219 deletions.
2 changes: 1 addition & 1 deletion DataFormats/Common/interface/DetSetVectorNew.h
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ namespace edm {
typedef FindSetForNewDetSetVector<T> value;
};
} // namespace refhelper
/* ... implementation is provided, just in case it's needed */
/* ... implementation is provided, just in case it's needed */
} // namespace edm

namespace edmNew {
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/Common/interface/ELseverityLevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace edm {
ELsev_highestSeverity, // threshold use only
// -----
nLevels // how many levels?
}; // ELsev_
}; // ELsev_

// ----- Birth/death:
//
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/Common/interface/PtrVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace edm {

Ptr<T> const operator[](difference_type n) const { // Otherwise the
return base_->fromItr(iter_ + n); // boost::range
} // doesn't have []
} // doesn't have []

PtrHolder<T> operator->() const { return PtrHolder<T>(this->operator*()); }

Expand Down
14 changes: 4 additions & 10 deletions DataFormats/Common/test/Wrapper_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
class CopyNoMove {
public:
CopyNoMove() {}
CopyNoMove(CopyNoMove const&) { /* std::cout << "copied\n"; */
}
CopyNoMove& operator=(CopyNoMove const&) { /*std::cout << "assigned\n";*/
return *this;
}
CopyNoMove(CopyNoMove const&) { /* std::cout << "copied\n"; */ }
CopyNoMove& operator=(CopyNoMove const&) { /*std::cout << "assigned\n";*/ return *this; }

private:
};
Expand All @@ -28,11 +25,8 @@ class MoveNoCopy {
MoveNoCopy() {}
MoveNoCopy(MoveNoCopy const&) = delete;
MoveNoCopy& operator=(MoveNoCopy const&) = delete;
MoveNoCopy(MoveNoCopy&&) { /* std::cout << "moved\n";*/
}
MoveNoCopy& operator=(MoveNoCopy&&) { /* std::cout << "moved\n";*/
return *this;
}
MoveNoCopy(MoveNoCopy&&) { /* std::cout << "moved\n";*/ }
MoveNoCopy& operator=(MoveNoCopy&&) { /* std::cout << "moved\n";*/ return *this; }

private:
};
Expand Down
3 changes: 1 addition & 2 deletions DataFormats/FWLite/interface/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ namespace fwlite {
// DataGetterHelper caching is enabled. When user sets useCache to
// false no cache is created unless user attaches and controls it
// himself.
Event(
TFile* iFile, bool useCache = true, std::function<void(TBranch const&)> baFunc = [](TBranch const&) {});
Event(TFile* iFile, bool useCache = true, std::function<void(TBranch const&)> baFunc = [](TBranch const&) {});

Event(Event const&) = delete; // stop default

Expand Down
2 changes: 1 addition & 1 deletion DataFormats/FWLite/interface/OutputFiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace fwlite {
OutputFiles() { throw cms::Exception("InvalidInput") << "Must specify a string fileName" << std::endl; }
/// default constructor from parameter set
OutputFiles(const edm::ParameterSet& cfg)
: file_(cfg.getParameterSet("fwliteOutput").getParameter<std::string>("fileName")){};
: file_(cfg.getParameterSet("fwliteOutput").getParameter<std::string>("fileName")) {}
/// return output fuke name
std::string const& file() const { return file_; }

Expand Down
2 changes: 1 addition & 1 deletion DataFormats/FWLite/src/ChainEvent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ namespace fwlite {
return true;
}
} // end ignore "first" file that we tried
} // end loop over files
} // end loop over files

// did not find the event with id "id".
return false;
Expand Down
6 changes: 3 additions & 3 deletions DataFormats/FWLite/src/Event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ namespace fwlite {
Event const* event_;
};
} // namespace internal
//
// constructors and destructor
//
//
// constructors and destructor
//
Event::Event(TFile* iFile, bool useCache, std::function<void(TBranch const&)> baFunc)
: file_(iFile),
// eventTree_(nullptr),
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/TestObjects/interface/DeleteEarly.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace edmtest {
class DeleteEarly {
public:
DeleteEarly(){};
DeleteEarly() {}
~DeleteEarly() { ++s_nDeletes; }
// ---------- const member functions ---------------------

Expand Down
2 changes: 1 addition & 1 deletion FWCore/Concurrency/interface/WaitingTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace edm {

///Constructor
WaitingTask() noexcept : m_ptr{} {}
~WaitingTask() noexcept override{};
~WaitingTask() noexcept override {}

// ---------- const member functions ---------------------------

Expand Down
12 changes: 4 additions & 8 deletions FWCore/Concurrency/test/test_catch2_Async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ TEST_CASE("Test Async", "[edm::Async") {
using namespace edm::waiting_task::chain;
auto h1 = first([&service, &count](edm::WaitingTaskHolder h) {
edm::WaitingTaskWithArenaHolder h2(std::move(h));
service.runAsync(
h2, [&count]() { ++count; }, errorContext);
service.runAsync(h2, [&count]() { ++count; }, errorContext);
}) |
lastTask(edm::WaitingTaskHolder(group, &waitTask));

auto h2 = first([&service, &count](edm::WaitingTaskHolder h) {
edm::WaitingTaskWithArenaHolder h2(std::move(h));
service.runAsync(
h2, [&count]() { ++count; }, errorContext);
service.runAsync(h2, [&count]() { ++count; }, errorContext);
}) |
lastTask(edm::WaitingTaskHolder(group, &waitTask));
h2.doneWaiting(std::exception_ptr());
Expand All @@ -79,14 +77,12 @@ TEST_CASE("Test Async", "[edm::Async") {
using namespace edm::waiting_task::chain;
auto h = first([&service, &count](edm::WaitingTaskHolder h) {
edm::WaitingTaskWithArenaHolder h2(std::move(h));
service.runAsync(
h2, [&count]() { ++count; }, errorContext);
service.runAsync(h2, [&count]() { ++count; }, errorContext);
service.setAllowed(false);
}) |
then([&service, &count](edm::WaitingTaskHolder h) {
edm::WaitingTaskWithArenaHolder h2(std::move(h));
service.runAsync(
h2, [&count]() { ++count; }, errorContext);
service.runAsync(h2, [&count]() { ++count; }, errorContext);
}) |
lastTask(edm::WaitingTaskHolder(group, &waitTask));
h.doneWaiting(std::exception_ptr());
Expand Down
18 changes: 6 additions & 12 deletions FWCore/Concurrency/test/test_catch2_WaitingThreadPool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ TEST_CASE("Test WaitingThreadPool", "[edm::WaitingThreadPool") {
using namespace edm::waiting_task::chain;
auto h = first([&pool, &count](edm::WaitingTaskHolder h) {
edm::WaitingTaskWithArenaHolder h2(std::move(h));
pool.runAsync(
std::move(h2), [&count]() { ++count; }, errorContext);
pool.runAsync(std::move(h2), [&count]() { ++count; }, errorContext);
}) |
lastTask(edm::WaitingTaskHolder(group, &waitTask));
h.doneWaiting(std::exception_ptr());
Expand Down Expand Up @@ -62,8 +61,7 @@ TEST_CASE("Test WaitingThreadPool", "[edm::WaitingThreadPool") {
++count;
},
errorContext);
pool.runAsync(
h2, [&count]() { ++count; }, errorContext);
pool.runAsync(h2, [&count]() { ++count; }, errorContext);
}) |
lastTask(edm::WaitingTaskHolder(group, &waitTask));
h.doneWaiting(std::exception_ptr());
Expand All @@ -90,8 +88,7 @@ TEST_CASE("Test WaitingThreadPool", "[edm::WaitingThreadPool") {
while (mayContinue != 2) {
hardware_pause();
}
pool.runAsync(
h2, [&count]() { ++count; }, errorContext);
pool.runAsync(h2, [&count]() { ++count; }, errorContext);
}) |
lastTask(edm::WaitingTaskHolder(group, &waitTask));

Expand All @@ -101,8 +98,7 @@ TEST_CASE("Test WaitingThreadPool", "[edm::WaitingThreadPool") {
while (mayContinue != 2) {
hardware_pause();
}
pool.runAsync(
h2, [&count]() { ++count; }, errorContext);
pool.runAsync(h2, [&count]() { ++count; }, errorContext);
}) |
lastTask(edm::WaitingTaskHolder(group, &waitTask));
h2.doneWaiting(std::exception_ptr());
Expand All @@ -125,8 +121,7 @@ TEST_CASE("Test WaitingThreadPool", "[edm::WaitingThreadPool") {
using namespace edm::waiting_task::chain;
auto h = first([&pool](edm::WaitingTaskHolder h) {
edm::WaitingTaskWithArenaHolder h2(std::move(h));
pool.runAsync(
std::move(h2), []() { throw std::runtime_error("error"); }, errorContext);
pool.runAsync(std::move(h2), []() { throw std::runtime_error("error"); }, errorContext);
}) |
lastTask(edm::WaitingTaskHolder(group, &waitTask));
h.doneWaiting(std::exception_ptr());
Expand Down Expand Up @@ -265,8 +260,7 @@ TEST_CASE("Test WaitingThreadPool", "[edm::WaitingThreadPool") {

auto h2 = first([&pool, &count](edm::WaitingTaskHolder h) {
edm::WaitingTaskWithArenaHolder h2(std::move(h));
pool.runAsync(
h2, [&count]() { ++count; }, errorContext);
pool.runAsync(h2, [&count]() { ++count; }, errorContext);
}) |
lastTask(edm::WaitingTaskHolder(group, &waitTask));
h2.doneWaiting(std::exception_ptr());
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Framework/interface/ESProducts.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace edm {
};

} // namespace produce
} // namespace eventsetup
} // namespace eventsetup
struct ESFillDirectly {};

template <typename... TArgs>
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Framework/interface/HCMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ namespace edm {
return static_cast<ItemType*>(iStorage.find(makeKey<typename type_from_itemtype<Key, ItemType>::Type, Key>()));
}
} // namespace heterocontainer
} // namespace eventsetup
} // namespace eventsetup
} // namespace edm
#endif
2 changes: 1 addition & 1 deletion FWCore/Framework/interface/HCTypeTag.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace edm {
char const* m_name{""};
};
} // namespace heterocontainer
} // namespace eventsetup
} // namespace eventsetup
} // namespace edm
#define HCTYPETAG_HELPER_METHODS(_dataclass_) TYPELOOKUP_METHODS(_dataclass_)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace edm {
using Type = edm::global::impl::WatchProcessBlock<edm::global::EDAnalyzerBase>;
};
} // namespace analyzer
} // namespace global
} // namespace global
} // namespace edm

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ namespace edm {
using Type = edm::global::impl::EmptyType;
};
} // namespace filter
} // namespace global
} // namespace global
} // namespace edm

#endif
32 changes: 16 additions & 16 deletions FWCore/Framework/interface/global/implementors.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ namespace edm {
RunCacheHolder() = default;
RunCacheHolder(RunCacheHolder<T, C> const&) = delete;
RunCacheHolder<T, C>& operator=(RunCacheHolder<T, C> const&) = delete;
~RunCacheHolder() noexcept(false) override{};
~RunCacheHolder() noexcept(false) override {}

protected:
void preallocRuns(unsigned int iNRuns) final { caches_.reset(new std::shared_ptr<C>[iNRuns]); }
Expand All @@ -181,7 +181,7 @@ namespace edm {
LuminosityBlockCacheHolder() = default;
LuminosityBlockCacheHolder(LuminosityBlockCacheHolder<T, C> const&) = delete;
LuminosityBlockCacheHolder<T, C>& operator=(LuminosityBlockCacheHolder<T, C> const&) = delete;
~LuminosityBlockCacheHolder() noexcept(false) override{};
~LuminosityBlockCacheHolder() noexcept(false) override {}

protected:
void preallocLumis(unsigned int iNLumis) final { caches_.reset(new std::shared_ptr<C>[iNLumis]); }
Expand Down Expand Up @@ -212,7 +212,7 @@ namespace edm {
RunSummaryCacheHolder() = default;
RunSummaryCacheHolder(RunSummaryCacheHolder<T, C> const&) = delete;
RunSummaryCacheHolder<T, C>& operator=(RunSummaryCacheHolder<T, C> const&) = delete;
~RunSummaryCacheHolder() noexcept(false) override{};
~RunSummaryCacheHolder() noexcept(false) override {}

private:
void preallocRunsSummary(unsigned int iNRuns) final { caches_.reset(new std::shared_ptr<C>[iNRuns]); }
Expand Down Expand Up @@ -252,7 +252,7 @@ namespace edm {
LuminosityBlockSummaryCacheHolder() = default;
LuminosityBlockSummaryCacheHolder(LuminosityBlockSummaryCacheHolder<T, C> const&) = delete;
LuminosityBlockSummaryCacheHolder<T, C>& operator=(LuminosityBlockSummaryCacheHolder<T, C> const&) = delete;
~LuminosityBlockSummaryCacheHolder() noexcept(false) override{};
~LuminosityBlockSummaryCacheHolder() noexcept(false) override {}

private:
void preallocLumisSummary(unsigned int iNLumis) final { caches_.reset(new std::shared_ptr<C>[iNLumis]); }
Expand Down Expand Up @@ -309,7 +309,7 @@ namespace edm {
BeginProcessBlockProducer() = default;
BeginProcessBlockProducer(BeginProcessBlockProducer const&) = delete;
BeginProcessBlockProducer& operator=(BeginProcessBlockProducer const&) = delete;
~BeginProcessBlockProducer() noexcept(false) override{};
~BeginProcessBlockProducer() noexcept(false) override {}

private:
void doBeginProcessBlockProduce_(ProcessBlock&) final;
Expand All @@ -323,7 +323,7 @@ namespace edm {
EndProcessBlockProducer() = default;
EndProcessBlockProducer(EndProcessBlockProducer const&) = delete;
EndProcessBlockProducer& operator=(EndProcessBlockProducer const&) = delete;
~EndProcessBlockProducer() noexcept(false) override{};
~EndProcessBlockProducer() noexcept(false) override {}

private:
void doEndProcessBlockProduce_(ProcessBlock&) final;
Expand All @@ -337,7 +337,7 @@ namespace edm {
BeginRunProducer() = default;
BeginRunProducer(BeginRunProducer const&) = delete;
BeginRunProducer& operator=(BeginRunProducer const&) = delete;
~BeginRunProducer() noexcept(false) override{};
~BeginRunProducer() noexcept(false) override {}

private:
void doBeginRunProduce_(Run& rp, EventSetup const& c) final;
Expand All @@ -351,7 +351,7 @@ namespace edm {
EndRunProducer() = default;
EndRunProducer(EndRunProducer const&) = delete;
EndRunProducer& operator=(EndRunProducer const&) = delete;
~EndRunProducer() noexcept(false) override{};
~EndRunProducer() noexcept(false) override {}

private:
void doEndRunProduce_(Run& rp, EventSetup const& c) final;
Expand All @@ -365,7 +365,7 @@ namespace edm {
EndRunSummaryProducer() = default;
EndRunSummaryProducer(EndRunSummaryProducer const&) = delete;
EndRunSummaryProducer& operator=(EndRunSummaryProducer const&) = delete;
~EndRunSummaryProducer() noexcept(false) override{};
~EndRunSummaryProducer() noexcept(false) override {}

private:
void doEndRunProduce_(Run& rp, EventSetup const& c) final {
Expand All @@ -385,7 +385,7 @@ namespace edm {
BeginLuminosityBlockProducer() = default;
BeginLuminosityBlockProducer(BeginLuminosityBlockProducer const&) = delete;
BeginLuminosityBlockProducer& operator=(BeginLuminosityBlockProducer const&) = delete;
~BeginLuminosityBlockProducer() noexcept(false) override{};
~BeginLuminosityBlockProducer() noexcept(false) override {}

private:
void doBeginLuminosityBlockProduce_(LuminosityBlock& lb, EventSetup const& c) final;
Expand All @@ -398,7 +398,7 @@ namespace edm {
EndLuminosityBlockProducer() = default;
EndLuminosityBlockProducer(EndLuminosityBlockProducer const&) = delete;
EndLuminosityBlockProducer& operator=(EndLuminosityBlockProducer const&) = delete;
~EndLuminosityBlockProducer() noexcept(false) override{};
~EndLuminosityBlockProducer() noexcept(false) override {}

private:
void doEndLuminosityBlockProduce_(LuminosityBlock& lb, EventSetup const& c) final;
Expand All @@ -411,7 +411,7 @@ namespace edm {
EndLuminosityBlockSummaryProducer() = default;
EndLuminosityBlockSummaryProducer(EndLuminosityBlockSummaryProducer const&) = delete;
EndLuminosityBlockSummaryProducer& operator=(EndLuminosityBlockSummaryProducer const&) = delete;
~EndLuminosityBlockSummaryProducer() noexcept(false) override{};
~EndLuminosityBlockSummaryProducer() noexcept(false) override {}

private:
void doEndLuminosityBlockProduce_(LuminosityBlock& lb, EventSetup const& c) final {
Expand All @@ -431,7 +431,7 @@ namespace edm {
ExternalWork() = default;
ExternalWork(ExternalWork const&) = delete;
ExternalWork& operator=(ExternalWork const&) = delete;
~ExternalWork() noexcept(false) override{};
~ExternalWork() noexcept(false) override {}

private:
bool hasAcquire() const noexcept override { return true; }
Expand All @@ -447,7 +447,7 @@ namespace edm {
Accumulator() = default;
Accumulator(Accumulator const&) = delete;
Accumulator& operator=(Accumulator const&) = delete;
~Accumulator() noexcept(false) override{};
~Accumulator() noexcept(false) override {}

private:
bool hasAccumulator() const noexcept override { return true; }
Expand All @@ -463,7 +463,7 @@ namespace edm {
Transformer() = default;
Transformer(Transformer const&) = delete;
Transformer& operator=(Transformer const&) = delete;
~Transformer() noexcept(false) override{};
~Transformer() noexcept(false) override {}

template <typename G, typename F>
void registerTransform(ProductRegistryHelper::BranchAliasSetterT<G> iSetter,
Expand Down Expand Up @@ -531,7 +531,7 @@ namespace edm {
}
};
} // namespace impl
} // namespace global
} // namespace global
} // namespace edm

#endif
Loading

0 comments on commit c249daf

Please sign in to comment.