From fa551afa2af48f92fef86f6b4e1bf1dd4c1500d2 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Fri, 11 Oct 2024 12:20:54 -0400 Subject: [PATCH] Adds spaces after operator overloads --- .clang-format | 2 +- include/caliper/Annotation.h | 14 ++++++------ include/caliper/CaliFunctional.h | 12 +++++----- include/caliper/Caliper.h | 18 +++++++-------- include/caliper/SnapshotRecord.h | 10 ++++----- include/caliper/common/Attribute.h | 16 +++++++------- include/caliper/common/Entry.h | 6 ++--- include/caliper/common/Node.h | 2 +- include/caliper/common/OutputStream.h | 2 +- include/caliper/common/Variant.h | 22 +++++++++---------- include/caliper/common/callback.hpp | 2 +- include/caliper/reader/Aggregator.h | 2 +- .../reader/FlatExclusiveRegionProfile.h | 2 +- .../reader/FlatInclusiveRegionProfile.h | 2 +- include/caliper/reader/FormatProcessor.h | 2 +- .../reader/NestedExclusiveRegionProfile.h | 2 +- .../reader/NestedInclusiveRegionProfile.h | 2 +- include/caliper/reader/Preprocessor.h | 2 +- include/caliper/reader/QueryProcessor.h | 2 +- include/caliper/reader/RecordSelector.h | 2 +- src/caliper/Annotation.cpp | 2 +- src/caliper/Caliper.cpp | 2 +- src/caliper/ConfigManager.cpp | 4 ++-- src/caliper/MetadataTree.h | 4 ++-- src/caliper/cali.cpp | 4 ++-- src/common/Attribute.cpp | 2 +- src/common/NodeBuffer.h | 4 ++-- src/common/OutputStream.cpp | 2 +- src/common/SnapshotBuffer.h | 4 ++-- src/common/Variant.cpp | 4 ++-- src/reader/Expand.cpp | 2 +- src/reader/Expand.h | 2 +- src/reader/FlatExclusiveRegionProfile.cpp | 2 +- src/reader/FlatInclusiveRegionProfile.cpp | 2 +- src/reader/NestedExclusiveRegionProfile.cpp | 2 +- src/reader/NestedInclusiveRegionProfile.cpp | 2 +- src/reader/RecordSelector.cpp | 3 ++- src/services/alloc/AllocService.cpp | 6 ++--- src/services/alloc/SplayTree.hpp | 4 ++-- src/tools/cali-query/AttributeExtract.cpp | 2 +- src/tools/cali-query/AttributeExtract.h | 2 +- src/tools/cali-query/cali-query.cpp | 4 ++-- src/tools/cali-query/query_common.h | 2 +- src/tools/cali-stat/cali-stat.cpp | 4 ++-- 44 files changed, 98 insertions(+), 97 deletions(-) diff --git a/.clang-format b/.clang-format index 0b206204..4ecc174d 100644 --- a/.clang-format +++ b/.clang-format @@ -179,7 +179,7 @@ SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: true SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true -SpaceBeforeParens: ControlStatements +SpaceBeforeParens: Custom SpaceBeforeParensOptions: AfterControlStatements: true AfterForeachMacros: true diff --git a/include/caliper/Annotation.h b/include/caliper/Annotation.h index ed3a78f2..50889322 100644 --- a/include/caliper/Annotation.h +++ b/include/caliper/Annotation.h @@ -28,8 +28,8 @@ class Function Function(const char* name); - Function(const Function&) = delete; - Function& operator=(const Function&) = delete; + Function(const Function&) = delete; + Function& operator= (const Function&) = delete; ~Function(); }; @@ -42,8 +42,8 @@ class ScopeAnnotation explicit ScopeAnnotation(const char* name); - ScopeAnnotation(const ScopeAnnotation&) = delete; - ScopeAnnotation& operator=(const ScopeAnnotation&) = delete; + ScopeAnnotation(const ScopeAnnotation&) = delete; + ScopeAnnotation& operator= (const ScopeAnnotation&) = delete; ~ScopeAnnotation(); }; @@ -128,7 +128,7 @@ class Annotation ~Annotation(); - Annotation& operator=(const Annotation&); + Annotation& operator= (const Annotation&); /// \brief Scope guard to automatically close an annotation at the end of /// the C++ scope. @@ -151,8 +151,8 @@ class Annotation Guard(Annotation& a); - Guard(const Guard&) = delete; - Guard& operator=(const Guard&) = delete; + Guard(const Guard&) = delete; + Guard& operator= (const Guard&) = delete; ~Guard(); }; diff --git a/include/caliper/CaliFunctional.h b/include/caliper/CaliFunctional.h index f11169fc..7b17e771 100644 --- a/include/caliper/CaliFunctional.h +++ b/include/caliper/CaliFunctional.h @@ -34,7 +34,7 @@ struct SafeAnnotation { Annotation& getAnnot() { return inner_annot; } - SafeAnnotation& operator=(SafeAnnotation& other) + SafeAnnotation& operator= (SafeAnnotation& other) { inner_annot = other.getAnnot(); return *this; @@ -208,7 +208,7 @@ struct WrappedFunction { WrappedFunction(const char* func_name, LB func) : body(func) { name = func_name; } template - auto operator()(Args... args) -> typename std::result_of::type + auto operator() (Args... args) -> typename std::result_of::type { cali::Annotation::Guard func_annot(wrapper_annotation().begin(name).getAnnot()); @@ -224,7 +224,7 @@ struct ArgWrappedFunction { ArgWrappedFunction(const char* func_name, LB func) : body(func) { name = func_name; } template - auto operator()(Args... args) -> typename std::enable_if< + auto operator() (Args... args) -> typename std::enable_if< !std::is_same::type, void>::value, typename std::result_of::type>::type { @@ -242,7 +242,7 @@ struct ArgWrappedFunction { } template - auto operator()(Args... args) -> typename std::enable_if< + auto operator() (Args... args) -> typename std::enable_if< std::is_same::type, void>::value, typename std::result_of::type>::type { @@ -320,7 +320,7 @@ struct RecordedFunction { RecordedFunction(const char* func_name, LB func) : body(func) { name = func_name; } template - auto operator()(Args... args) -> typename std::enable_if< + auto operator() (Args... args) -> typename std::enable_if< !std::is_same::type, void>::value, typename std::result_of::type>::type { @@ -339,7 +339,7 @@ struct RecordedFunction { } template - auto operator()(Args... args) -> typename std::enable_if< + auto operator() (Args... args) -> typename std::enable_if< std::is_same::type, void>::value, typename std::result_of::type>::type { diff --git a/include/caliper/Caliper.h b/include/caliper/Caliper.h index 736eb795..e9d15be2 100644 --- a/include/caliper/Caliper.h +++ b/include/caliper/Caliper.h @@ -51,8 +51,8 @@ class Channel Channel(const Channel&) = default; Channel(Channel&&) = default; - Channel& operator=(const Channel&) = default; - Channel& operator=(Channel&&) = default; + Channel& operator= (const Channel&) = default; + Channel& operator= (Channel&&) = default; ~Channel(); @@ -173,19 +173,19 @@ class Channel cali_id_t id() const; - operator bool() const { return mP.use_count() > 0; } + operator bool () const { return mP.use_count() > 0; } friend class Caliper; - friend bool operator==(const Channel&, const Channel&); - friend bool operator!=(const Channel&, const Channel&); + friend bool operator== (const Channel&, const Channel&); + friend bool operator!= (const Channel&, const Channel&); }; -inline bool operator==(const Channel& a, const Channel& b) +inline bool operator== (const Channel& a, const Channel& b) { return a.mP == b.mP; } -inline bool operator!=(const Channel& a, const Channel& b) +inline bool operator!= (const Channel& a, const Channel& b) { return a.mP != b.mP; } @@ -693,7 +693,7 @@ class Caliper : public CaliperMetadataAccessInterface Caliper(const Caliper&) = default; - Caliper& operator=(const Caliper&) = default; + Caliper& operator= (const Caliper&) = default; /// \brief Check if this is a signal-safe %Caliper instance. /// @@ -704,7 +704,7 @@ class Caliper : public CaliperMetadataAccessInterface bool is_signal() const { return m_is_signal; }; /// \brief Return \a true if this is a valid %Caliper instance. - operator bool() const; + operator bool () const; /// \brief Construct a Caliper instance object. /// diff --git a/include/caliper/SnapshotRecord.h b/include/caliper/SnapshotRecord.h index 6ce7b979..3441789e 100644 --- a/include/caliper/SnapshotRecord.h +++ b/include/caliper/SnapshotRecord.h @@ -42,7 +42,7 @@ class SnapshotView bool empty() const { return m_len == 0; } - const Entry& operator[](std::size_t n) const { return m_data[n]; } + const Entry& operator[] (std::size_t n) const { return m_data[n]; } Entry get(const Attribute& attr) const { @@ -86,8 +86,8 @@ class SnapshotBuilder SnapshotBuilder(SnapshotBuilder&&) = default; SnapshotBuilder(const SnapshotBuilder&) = delete; - SnapshotBuilder& operator=(SnapshotBuilder&&) = default; - SnapshotBuilder& operator=(const SnapshotBuilder&) = delete; + SnapshotBuilder& operator= (SnapshotBuilder&&) = default; + SnapshotBuilder& operator= (const SnapshotBuilder&) = delete; size_t capacity() const { return m_capacity; } @@ -129,8 +129,8 @@ class FixedSizeSnapshotRecord FixedSizeSnapshotRecord() : m_builder { N, m_data } {} - FixedSizeSnapshotRecord(const FixedSizeSnapshotRecord&) = delete; - FixedSizeSnapshotRecord operator=(const FixedSizeSnapshotRecord&) = delete; + FixedSizeSnapshotRecord(const FixedSizeSnapshotRecord&) = delete; + FixedSizeSnapshotRecord operator= (const FixedSizeSnapshotRecord&) = delete; SnapshotBuilder& builder() { return m_builder; } diff --git a/include/caliper/common/Attribute.h b/include/caliper/common/Attribute.h index 479f72dd..62e8c517 100644 --- a/include/caliper/common/Attribute.h +++ b/include/caliper/common/Attribute.h @@ -39,7 +39,7 @@ class Attribute constexpr Attribute() : m_node(nullptr) {} - operator bool() const { return m_node != nullptr; } + operator bool () const { return m_node != nullptr; } cali_id_t id() const { return m_node ? m_node->id() : CALI_INV_ID; } @@ -80,28 +80,28 @@ class Attribute Attribute(Node* node) : m_node(node) {} - friend bool operator<(const cali::Attribute& a, const cali::Attribute& b); - friend bool operator==(const cali::Attribute& a, const cali::Attribute& b); - friend bool operator!=(const cali::Attribute& a, const cali::Attribute& b); + friend bool operator< (const cali::Attribute& a, const cali::Attribute& b); + friend bool operator== (const cali::Attribute& a, const cali::Attribute& b); + friend bool operator!= (const cali::Attribute& a, const cali::Attribute& b); }; -inline bool operator<(const cali::Attribute& a, const cali::Attribute& b) +inline bool operator< (const cali::Attribute& a, const cali::Attribute& b) { return a.id() < b.id(); } -inline bool operator==(const cali::Attribute& a, const cali::Attribute& b) +inline bool operator== (const cali::Attribute& a, const cali::Attribute& b) { // we don't have copies of nodes, so the ptr should be unique return a.m_node == b.m_node; } -inline bool operator!=(const cali::Attribute& a, const cali::Attribute& b) +inline bool operator!= (const cali::Attribute& a, const cali::Attribute& b) { return a.m_node != b.m_node; } -std::ostream& operator<<(std::ostream&, const cali::Attribute&); +std::ostream& operator<< (std::ostream&, const cali::Attribute&); } // namespace cali diff --git a/include/caliper/common/Entry.h b/include/caliper/common/Entry.h index 25511d85..dd4ac1c3 100644 --- a/include/caliper/common/Entry.h +++ b/include/caliper/common/Entry.h @@ -83,10 +83,10 @@ class Entry static Entry unpack(const CaliperMetadataAccessInterface& db, const unsigned char* buffer, size_t* inc); - friend bool operator==(const Entry&, const Entry&); + friend bool operator== (const Entry&, const Entry&); }; -inline bool operator==(const Entry& lhs, const Entry& rhs) +inline bool operator== (const Entry& lhs, const Entry& rhs) { bool node_eq = lhs.m_node == rhs.m_node || (lhs.m_node && rhs.m_node && lhs.m_node->id() == rhs.m_node->id()); bool is_imm = lhs.is_immediate(); @@ -94,7 +94,7 @@ inline bool operator==(const Entry& lhs, const Entry& rhs) return node_eq && (!is_imm || (is_imm && lhs.m_value == rhs.m_value)); } -inline bool operator!=(const Entry& lhs, const Entry& rhs) +inline bool operator!= (const Entry& lhs, const Entry& rhs) { return !(lhs == rhs); } diff --git a/include/caliper/common/Node.h b/include/caliper/common/Node.h index 5023acb3..9ee9650b 100644 --- a/include/caliper/common/Node.h +++ b/include/caliper/common/Node.h @@ -38,7 +38,7 @@ class Node : public util::LockfreeIntrusiveTree Node(const Node&) = delete; - Node& operator=(const Node&) = delete; + Node& operator= (const Node&) = delete; /// \brief Check if the node's attribute and value are equal to /// \a attr and \a v diff --git a/include/caliper/common/OutputStream.h b/include/caliper/common/OutputStream.h index 30e50e79..fca08871 100644 --- a/include/caliper/common/OutputStream.h +++ b/include/caliper/common/OutputStream.h @@ -33,7 +33,7 @@ class OutputStream /// \brief Returns \a true if the stream is initialized, otherwise /// returns \a false - operator bool() const; + operator bool () const; StreamType type() const; diff --git a/include/caliper/common/Variant.h b/include/caliper/common/Variant.h index d82107fb..60c3019a 100644 --- a/include/caliper/common/Variant.h +++ b/include/caliper/common/Variant.h @@ -56,7 +56,7 @@ class Variant bool empty() const { return (m_v.type_and_size & CALI_VARIANT_TYPE_MASK) == CALI_TYPE_INV; }; - operator bool() const { return !empty(); } + operator bool () const { return !empty(); } bool has_unmanaged_data() const { @@ -100,7 +100,7 @@ class Variant return to; } - Variant& operator+=(const Variant& val); + Variant& operator+= (const Variant& val); Variant& min(const Variant& val); Variant& max(const Variant& val); @@ -120,32 +120,32 @@ class Variant // vector data() const; - friend bool operator==(const Variant& lhs, const Variant& rhs); - friend bool operator!=(const Variant& lhs, const Variant& rhs); - friend bool operator<(const Variant& lhs, const Variant& rhs); - friend bool operator>(const Variant& lhs, const Variant& rhs); + friend bool operator== (const Variant& lhs, const Variant& rhs); + friend bool operator!= (const Variant& lhs, const Variant& rhs); + friend bool operator< (const Variant& lhs, const Variant& rhs); + friend bool operator> (const Variant& lhs, const Variant& rhs); }; -inline bool operator==(const Variant& lhs, const Variant& rhs) +inline bool operator== (const Variant& lhs, const Variant& rhs) { return cali_variant_eq(lhs.m_v, rhs.m_v); } -inline bool operator!=(const Variant& lhs, const Variant& rhs) +inline bool operator!= (const Variant& lhs, const Variant& rhs) { return !cali_variant_eq(lhs.m_v, rhs.m_v); } -inline bool operator<(const Variant& lhs, const Variant& rhs) +inline bool operator< (const Variant& lhs, const Variant& rhs) { return (cali_variant_compare(lhs.m_v, rhs.m_v) < 0); } -inline bool operator>(const Variant& lhs, const Variant& rhs) +inline bool operator> (const Variant& lhs, const Variant& rhs) { return (cali_variant_compare(lhs.m_v, rhs.m_v) > 0); } -std::ostream& operator<<(std::ostream& os, const Variant& v); +std::ostream& operator<< (std::ostream& os, const Variant& v); } // namespace cali diff --git a/include/caliper/common/callback.hpp b/include/caliper/common/callback.hpp index 0a1c49f0..cd98da72 100644 --- a/include/caliper/common/callback.hpp +++ b/include/caliper/common/callback.hpp @@ -25,7 +25,7 @@ class callback bool empty() const { return mCb.empty(); } template - void operator()(Args&&... a) + void operator() (Args&&... a) { for (auto& f : mCb) f(a...); diff --git a/include/caliper/reader/Aggregator.h b/include/caliper/reader/Aggregator.h index bb942812..d5528027 100644 --- a/include/caliper/reader/Aggregator.h +++ b/include/caliper/reader/Aggregator.h @@ -34,7 +34,7 @@ class Aggregator void add(CaliperMetadataAccessInterface&, const EntryList&); - void operator()(CaliperMetadataAccessInterface& db, const EntryList& list) { add(db, list); } + void operator() (CaliperMetadataAccessInterface& db, const EntryList& list) { add(db, list); } void flush(CaliperMetadataAccessInterface&, SnapshotProcessFn push); diff --git a/include/caliper/reader/FlatExclusiveRegionProfile.h b/include/caliper/reader/FlatExclusiveRegionProfile.h index 3e7f4ca1..c5063c5a 100644 --- a/include/caliper/reader/FlatExclusiveRegionProfile.h +++ b/include/caliper/reader/FlatExclusiveRegionProfile.h @@ -32,7 +32,7 @@ class FlatExclusiveRegionProfile const char* region_attr_name = "" ); - void operator()(CaliperMetadataAccessInterface& db, const std::vector& rec); + void operator() (CaliperMetadataAccessInterface& db, const std::vector& rec); /// \brief Return tuple with { { region name -> value } map, sum in given region type, total sum } std::tuple, double, double> result() const; diff --git a/include/caliper/reader/FlatInclusiveRegionProfile.h b/include/caliper/reader/FlatInclusiveRegionProfile.h index cc7423e1..442c2ef5 100644 --- a/include/caliper/reader/FlatInclusiveRegionProfile.h +++ b/include/caliper/reader/FlatInclusiveRegionProfile.h @@ -32,7 +32,7 @@ class FlatInclusiveRegionProfile const char* region_attr_name = "" ); - void operator()(CaliperMetadataAccessInterface& db, const std::vector& rec); + void operator() (CaliperMetadataAccessInterface& db, const std::vector& rec); /// \brief Return tuple with { { region name -> value } map, sum in given region type, total sum } std::tuple, double, double> result() const; diff --git a/include/caliper/reader/FormatProcessor.h b/include/caliper/reader/FormatProcessor.h index 0b92648d..70006ce2 100644 --- a/include/caliper/reader/FormatProcessor.h +++ b/include/caliper/reader/FormatProcessor.h @@ -47,7 +47,7 @@ class FormatProcessor void flush(CaliperMetadataAccessInterface& db); /// \brief Make FormatProcessor usable as a SnapshotProcessFn. - void operator()(CaliperMetadataAccessInterface& db, const EntryList& rec) { process_record(db, rec); } + void operator() (CaliperMetadataAccessInterface& db, const EntryList& rec) { process_record(db, rec); } /// \brief Return all known formatter signatures. static const QuerySpec::FunctionSignature* formatter_defs(); diff --git a/include/caliper/reader/NestedExclusiveRegionProfile.h b/include/caliper/reader/NestedExclusiveRegionProfile.h index 7cab1a86..673b7c5d 100644 --- a/include/caliper/reader/NestedExclusiveRegionProfile.h +++ b/include/caliper/reader/NestedExclusiveRegionProfile.h @@ -32,7 +32,7 @@ class NestedExclusiveRegionProfile const char* region_attr_name = "" ); - void operator()(CaliperMetadataAccessInterface& db, const std::vector& rec); + void operator() (CaliperMetadataAccessInterface& db, const std::vector& rec); /// \brief Return tuple with { { region name -> value } map, sum in given region type, total sum } std::tuple, double, double> result() const; diff --git a/include/caliper/reader/NestedInclusiveRegionProfile.h b/include/caliper/reader/NestedInclusiveRegionProfile.h index 2c587487..89e63894 100644 --- a/include/caliper/reader/NestedInclusiveRegionProfile.h +++ b/include/caliper/reader/NestedInclusiveRegionProfile.h @@ -32,7 +32,7 @@ class NestedInclusiveRegionProfile const char* region_attr_name = "" ); - void operator()(CaliperMetadataAccessInterface& db, const std::vector& rec); + void operator() (CaliperMetadataAccessInterface& db, const std::vector& rec); /// \brief Return tuple with { { region name -> value } map, sum in given region type, total sum } std::tuple, double, double> result() const; diff --git a/include/caliper/reader/Preprocessor.h b/include/caliper/reader/Preprocessor.h index ef692af4..34fe34e8 100644 --- a/include/caliper/reader/Preprocessor.h +++ b/include/caliper/reader/Preprocessor.h @@ -34,7 +34,7 @@ class Preprocessor EntryList process(CaliperMetadataAccessInterface&, const EntryList&); - void operator()(CaliperMetadataAccessInterface& db, const EntryList& rec, SnapshotProcessFn push) + void operator() (CaliperMetadataAccessInterface& db, const EntryList& rec, SnapshotProcessFn push) { push(db, process(db, rec)); } diff --git a/include/caliper/reader/QueryProcessor.h b/include/caliper/reader/QueryProcessor.h index 7a29dd66..a9837447 100644 --- a/include/caliper/reader/QueryProcessor.h +++ b/include/caliper/reader/QueryProcessor.h @@ -35,7 +35,7 @@ class QueryProcessor void flush(CaliperMetadataAccessInterface&); - void operator()(CaliperMetadataAccessInterface& db, const EntryList& rec) { process_record(db, rec); } + void operator() (CaliperMetadataAccessInterface& db, const EntryList& rec) { process_record(db, rec); } }; } // namespace cali diff --git a/include/caliper/reader/RecordSelector.h b/include/caliper/reader/RecordSelector.h index 4835e60e..b69d1e92 100644 --- a/include/caliper/reader/RecordSelector.h +++ b/include/caliper/reader/RecordSelector.h @@ -35,7 +35,7 @@ class RecordSelector bool pass(const CaliperMetadataAccessInterface&, const EntryList&); - void operator()(CaliperMetadataAccessInterface&, const EntryList&, SnapshotProcessFn) const; + void operator() (CaliperMetadataAccessInterface&, const EntryList&, SnapshotProcessFn) const; static std::vector parse(const std::string&); }; diff --git a/src/caliper/Annotation.cpp b/src/caliper/Annotation.cpp index be559bcc..e0275862 100644 --- a/src/caliper/Annotation.cpp +++ b/src/caliper/Annotation.cpp @@ -236,7 +236,7 @@ Annotation::~Annotation() Annotation::Annotation(const Annotation& a) : pI(a.pI->attach()) {} -Annotation& Annotation::operator=(const Annotation& a) +Annotation& Annotation::operator= (const Annotation& a) { if (pI == a.pI) return *this; diff --git a/src/caliper/Caliper.cpp b/src/caliper/Caliper.cpp index 2b99f192..ec22cf89 100644 --- a/src/caliper/Caliper.cpp +++ b/src/caliper/Caliper.cpp @@ -1433,7 +1433,7 @@ Caliper Caliper::sigsafe_instance() return Caliper(GlobalData::gObj.g_ptr, GlobalData::tObj.t_ptr, true); } -Caliper::operator bool() const +Caliper::operator bool () const { return (sG && sT && !(m_is_signal && sT->lock.is_locked())); } diff --git a/src/caliper/ConfigManager.cpp b/src/caliper/ConfigManager.cpp index 2b7d0ae4..bc67f421 100644 --- a/src/caliper/ConfigManager.cpp +++ b/src/caliper/ConfigManager.cpp @@ -503,8 +503,8 @@ class ConfigManager::OptionSpec OptionSpec(const OptionSpec&) = default; OptionSpec(OptionSpec&&) = default; - OptionSpec& operator=(const OptionSpec&) = default; - OptionSpec& operator=(OptionSpec&&) = default; + OptionSpec& operator= (const OptionSpec&) = default; + OptionSpec& operator= (OptionSpec&&) = default; ~OptionSpec() {} diff --git a/src/caliper/MetadataTree.h b/src/caliper/MetadataTree.h index 5734f8ca..0e3205e7 100644 --- a/src/caliper/MetadataTree.h +++ b/src/caliper/MetadataTree.h @@ -69,8 +69,8 @@ class MetadataTree ~MetadataTree(); - MetadataTree(const MetadataTree&) = delete; - MetadataTree& operator=(const MetadataTree&) = delete; + MetadataTree(const MetadataTree&) = delete; + MetadataTree& operator= (const MetadataTree&) = delete; static void release(); diff --git a/src/caliper/cali.cpp b/src/caliper/cali.cpp index 428be449..b1647b5a 100644 --- a/src/caliper/cali.cpp +++ b/src/caliper/cali.cpp @@ -216,7 +216,7 @@ class UnpackEntryOp UnpackEntryOp(cali_entry_proc_fn fn, void* user_arg) : m_arg(user_arg), m_fn(fn) {} - inline bool operator()(const Entry& e) + inline bool operator() (const Entry& e) { if (e.is_immediate()) { if ((*m_fn)(m_arg, e.attribute(), e.value().c_variant()) == 0) @@ -241,7 +241,7 @@ class UnpackAttributeEntryOp UnpackAttributeEntryOp(cali_id_t id, cali_entry_proc_fn fn, void* user_arg) : m_arg(user_arg), m_fn(fn), m_id(id) {} - inline bool operator()(const Entry& e) + inline bool operator() (const Entry& e) { if (e.is_immediate() && e.attribute() == m_id) { if ((*m_fn)(m_arg, e.attribute(), e.value().c_variant()) == 0) diff --git a/src/common/Attribute.cpp b/src/common/Attribute.cpp index 8b74325e..938512f3 100644 --- a/src/common/Attribute.cpp +++ b/src/common/Attribute.cpp @@ -60,7 +60,7 @@ Variant Attribute::get(const Attribute& attr) const return Variant(); } -std::ostream& cali::operator<<(std::ostream& os, const Attribute& a) +std::ostream& cali::operator<< (std::ostream& os, const Attribute& a) { char buf[256]; diff --git a/src/common/NodeBuffer.h b/src/common/NodeBuffer.h index 49e3fd1e..4085f9fc 100644 --- a/src/common/NodeBuffer.h +++ b/src/common/NodeBuffer.h @@ -41,8 +41,8 @@ class NodeBuffer ~NodeBuffer(); - NodeBuffer(const NodeBuffer&) = delete; - NodeBuffer& operator=(const NodeBuffer&) = delete; + NodeBuffer(const NodeBuffer&) = delete; + NodeBuffer& operator= (const NodeBuffer&) = delete; void append(const NodeInfo& info); void append(const Node* node); diff --git a/src/common/OutputStream.cpp b/src/common/OutputStream.cpp index f1be6aaf..332d8c44 100644 --- a/src/common/OutputStream.cpp +++ b/src/common/OutputStream.cpp @@ -164,7 +164,7 @@ OutputStream::~OutputStream() mP.reset(); } -OutputStream::operator bool() const +OutputStream::operator bool () const { return mP->is_initialized; } diff --git a/src/common/SnapshotBuffer.h b/src/common/SnapshotBuffer.h index b6e66e37..9bf0464a 100644 --- a/src/common/SnapshotBuffer.h +++ b/src/common/SnapshotBuffer.h @@ -33,8 +33,8 @@ class SnapshotBuffer ~SnapshotBuffer(); - SnapshotBuffer(const SnapshotBuffer&) = delete; - SnapshotBuffer& operator=(const SnapshotBuffer&) = delete; + SnapshotBuffer(const SnapshotBuffer&) = delete; + SnapshotBuffer& operator= (const SnapshotBuffer&) = delete; void append(const CompressedSnapshotRecord& rec); diff --git a/src/common/Variant.cpp b/src/common/Variant.cpp index fff830fc..7aeb278b 100644 --- a/src/common/Variant.cpp +++ b/src/common/Variant.cpp @@ -176,13 +176,13 @@ std::ostream& Variant::write_cali(std::ostream& os) return os; } -std::ostream& cali::operator<<(std::ostream& os, const Variant& v) +std::ostream& cali::operator<< (std::ostream& os, const Variant& v) { os << v.to_string(); return os; } -Variant& Variant::operator+=(const Variant& val) +Variant& Variant::operator+= (const Variant& val) { cali_attr_type type = this->type(); diff --git a/src/reader/Expand.cpp b/src/reader/Expand.cpp index 85482e83..bfcec39f 100644 --- a/src/reader/Expand.cpp +++ b/src/reader/Expand.cpp @@ -157,7 +157,7 @@ Expand::~Expand() mP.reset(); } -void Expand::operator()(CaliperMetadataAccessInterface& db, const EntryList& list) const +void Expand::operator() (CaliperMetadataAccessInterface& db, const EntryList& list) const { mP->print(db, list); } diff --git a/src/reader/Expand.h b/src/reader/Expand.h index 065b8d0a..23539a22 100644 --- a/src/reader/Expand.h +++ b/src/reader/Expand.h @@ -33,7 +33,7 @@ class Expand : public Formatter ~Expand(); - void operator()(CaliperMetadataAccessInterface&, const EntryList&) const; + void operator() (CaliperMetadataAccessInterface&, const EntryList&) const; void process_record(CaliperMetadataAccessInterface&, const EntryList&); }; diff --git a/src/reader/FlatExclusiveRegionProfile.cpp b/src/reader/FlatExclusiveRegionProfile.cpp index 74e8b43b..58aa9847 100644 --- a/src/reader/FlatExclusiveRegionProfile.cpp +++ b/src/reader/FlatExclusiveRegionProfile.cpp @@ -64,7 +64,7 @@ FlatExclusiveRegionProfile::FlatExclusiveRegionProfile( mP->region_attr = db.get_attribute(region_attr_name); } -void FlatExclusiveRegionProfile::operator()(CaliperMetadataAccessInterface& db, const std::vector& rec) +void FlatExclusiveRegionProfile::operator() (CaliperMetadataAccessInterface& db, const std::vector& rec) { mP->process_record(db, rec); } diff --git a/src/reader/FlatInclusiveRegionProfile.cpp b/src/reader/FlatInclusiveRegionProfile.cpp index 6f124167..e51e3af6 100644 --- a/src/reader/FlatInclusiveRegionProfile.cpp +++ b/src/reader/FlatInclusiveRegionProfile.cpp @@ -68,7 +68,7 @@ FlatInclusiveRegionProfile::FlatInclusiveRegionProfile( mP->region_attr = db.get_attribute(region_attr_name); } -void FlatInclusiveRegionProfile::operator()(CaliperMetadataAccessInterface& db, const std::vector& rec) +void FlatInclusiveRegionProfile::operator() (CaliperMetadataAccessInterface& db, const std::vector& rec) { mP->process_record(db, rec); } diff --git a/src/reader/NestedExclusiveRegionProfile.cpp b/src/reader/NestedExclusiveRegionProfile.cpp index e760ff6e..daa83fd0 100644 --- a/src/reader/NestedExclusiveRegionProfile.cpp +++ b/src/reader/NestedExclusiveRegionProfile.cpp @@ -86,7 +86,7 @@ NestedExclusiveRegionProfile::NestedExclusiveRegionProfile( mP->region_attr = db.get_attribute(region_attr_name); } -void NestedExclusiveRegionProfile::operator()(CaliperMetadataAccessInterface& db, const std::vector& rec) +void NestedExclusiveRegionProfile::operator() (CaliperMetadataAccessInterface& db, const std::vector& rec) { mP->process_record(db, rec); } diff --git a/src/reader/NestedInclusiveRegionProfile.cpp b/src/reader/NestedInclusiveRegionProfile.cpp index a557129a..a5352dcc 100644 --- a/src/reader/NestedInclusiveRegionProfile.cpp +++ b/src/reader/NestedInclusiveRegionProfile.cpp @@ -94,7 +94,7 @@ NestedInclusiveRegionProfile::NestedInclusiveRegionProfile( mP->region_attr = db.get_attribute(region_attr_name); } -void NestedInclusiveRegionProfile::operator()(CaliperMetadataAccessInterface& db, const std::vector& rec) +void NestedInclusiveRegionProfile::operator() (CaliperMetadataAccessInterface& db, const std::vector& rec) { mP->process_record(db, rec); } diff --git a/src/reader/RecordSelector.cpp b/src/reader/RecordSelector.cpp index 85f27906..fe8f52b3 100644 --- a/src/reader/RecordSelector.cpp +++ b/src/reader/RecordSelector.cpp @@ -272,7 +272,8 @@ bool RecordSelector::pass(const CaliperMetadataAccessInterface& db, const EntryL return mP->pass(db, list); } -void RecordSelector::operator()(CaliperMetadataAccessInterface& db, const EntryList& list, SnapshotProcessFn push) const +void RecordSelector::operator() (CaliperMetadataAccessInterface& db, const EntryList& list, SnapshotProcessFn push) + const { if (mP->pass(db, list)) push(db, list); diff --git a/src/services/alloc/AllocService.cpp b/src/services/alloc/AllocService.cpp index 3058c7f1..738da17d 100644 --- a/src/services/alloc/AllocService.cpp +++ b/src/services/alloc/AllocService.cpp @@ -61,7 +61,7 @@ class ContainsAddress ContainsAddress(uint64_t a) : address(a) {} - inline int operator()(const AllocInfo& info) const + inline int operator() (const AllocInfo& info) const { if (address < info.start_addr) return -1; @@ -81,7 +81,7 @@ class HasStartAddress HasStartAddress(uint64_t a) : address(a) {} - inline int operator()(const AllocInfo& info) const + inline int operator() (const AllocInfo& info) const { if (address < info.start_addr) return -1; @@ -93,7 +93,7 @@ class HasStartAddress }; struct AllocInfoCmp { - int operator()(const AllocInfo& lhs, const AllocInfo& rhs) const + int operator() (const AllocInfo& lhs, const AllocInfo& rhs) const { if (lhs.start_addr < rhs.start_addr) return -1; diff --git a/src/services/alloc/SplayTree.hpp b/src/services/alloc/SplayTree.hpp index 248a9ec5..3a5a6758 100644 --- a/src/services/alloc/SplayTree.hpp +++ b/src/services/alloc/SplayTree.hpp @@ -198,9 +198,9 @@ class SplayTree return SplayTree(ret); } - T& operator*() { return m_root->val; } + T& operator* () { return m_root->val; } - operator bool() const { return m_root != nullptr; } + operator bool () const { return m_root != nullptr; } }; } // namespace util diff --git a/src/tools/cali-query/AttributeExtract.cpp b/src/tools/cali-query/AttributeExtract.cpp index 83c12641..cc15b762 100644 --- a/src/tools/cali-query/AttributeExtract.cpp +++ b/src/tools/cali-query/AttributeExtract.cpp @@ -43,7 +43,7 @@ AttributeExtract::~AttributeExtract() mP.reset(); } -void AttributeExtract::operator()(CaliperMetadataAccessInterface& db, const Node* node) +void AttributeExtract::operator() (CaliperMetadataAccessInterface& db, const Node* node) { mP->process_node(db, node); } diff --git a/src/tools/cali-query/AttributeExtract.h b/src/tools/cali-query/AttributeExtract.h index 37b2c656..c39ed8ee 100644 --- a/src/tools/cali-query/AttributeExtract.h +++ b/src/tools/cali-query/AttributeExtract.h @@ -26,7 +26,7 @@ class AttributeExtract ~AttributeExtract(); - void operator()(CaliperMetadataAccessInterface&, const Node*); + void operator() (CaliperMetadataAccessInterface&, const Node*); }; } // namespace cali diff --git a/src/tools/cali-query/cali-query.cpp b/src/tools/cali-query/cali-query.cpp index bcd831fb..332ed841 100644 --- a/src/tools/cali-query/cali-query.cpp +++ b/src/tools/cali-query/cali-query.cpp @@ -125,7 +125,7 @@ class FilterDuplicateNodes FilterDuplicateNodes() : m_max_node { 0 } {} - void operator()(CaliperMetadataAccessInterface& db, const Node* node, NodeProcessFn push) + void operator() (CaliperMetadataAccessInterface& db, const Node* node, NodeProcessFn push) { cali_id_t id = node->id(); @@ -149,7 +149,7 @@ struct NodeFilterStep { NodeFilterStep(NodeFilterFn filter_fn, NodeProcessFn push_fn) : m_filter_fn { filter_fn }, m_push_fn { push_fn } {} - void operator()(CaliperMetadataAccessInterface& db, const Node* node) { m_filter_fn(db, node, m_push_fn); } + void operator() (CaliperMetadataAccessInterface& db, const Node* node) { m_filter_fn(db, node, m_push_fn); } }; } // namespace diff --git a/src/tools/cali-query/query_common.h b/src/tools/cali-query/query_common.h index 6de63801..21dd7ba7 100644 --- a/src/tools/cali-query/query_common.h +++ b/src/tools/cali-query/query_common.h @@ -55,7 +55,7 @@ struct SnapshotFilterStep { : m_filter_fn { filter_fn }, m_push_fn { push_fn } {} - void operator()(CaliperMetadataAccessInterface& db, const EntryList& list) { m_filter_fn(db, list, m_push_fn); } + void operator() (CaliperMetadataAccessInterface& db, const EntryList& list) { m_filter_fn(db, list, m_push_fn); } }; /// \brief Process --help for cali-query and mpi-caliquery diff --git a/src/tools/cali-stat/cali-stat.cpp b/src/tools/cali-stat/cali-stat.cpp index 998d9261..72d9496d 100644 --- a/src/tools/cali-stat/cali-stat.cpp +++ b/src/tools/cali-stat/cali-stat.cpp @@ -228,7 +228,7 @@ struct Processor { bool do_reuse_stat; - void operator()(CaliperMetadataAccessInterface& db, const Node* node) + void operator() (CaliperMetadataAccessInterface& db, const Node* node) { stream_stat.process_node(db, node); @@ -236,7 +236,7 @@ struct Processor { reuse_stat.process_node(db, node); } - void operator()(CaliperMetadataAccessInterface& db, const EntryList& rec) + void operator() (CaliperMetadataAccessInterface& db, const EntryList& rec) { stream_stat.process_rec(db, rec);