From b07bd8de4972dc3d2209ab8d0656be7406880eb8 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 28 Feb 2025 00:19:58 +0100 Subject: [PATCH 1/4] gitattributes: fix whitespace --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 3d96311aed..f86443eed6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,7 +12,7 @@ *.py our-py-style *.rst our-rst-style -*.otf lfs +*.otf lfs thirdparty/** -format.clang-format -format.autopep8 **/pybind11/* -format.clang-format -- GitLab From 962aaa416f19346cf7ea85aa8b3b38bc843ab10e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 28 Feb 2025 00:19:29 +0100 Subject: [PATCH 2/4] clang-format: use C++17 formatting And update to clang-format-16. --- .clang-format | 24 +++++++++++++++++++++--- .gitattributes | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.clang-format b/.clang-format index c0ea271b50..d57a23ea09 100644 --- a/.clang-format +++ b/.clang-format @@ -1,13 +1,31 @@ --- -# This configuration requires clang-format 9.0 or higher. +# This configuration requires clang-format 16 or higher. BasedOnStyle: Mozilla AlignAfterOpenBracket: AlwaysBreak AlignOperands: false AlwaysBreakAfterReturnType: None AlwaysBreakAfterDefinitionReturnType: None -BreakBeforeBraces: Allman +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: Always + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + BeforeCatch: true + BeforeElse: true + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true ColumnLimit: 100 -Standard: Cpp11 +Standard: c++17 FixNamespaceComments: true ReflowComments: false ... diff --git a/.gitattributes b/.gitattributes index f86443eed6..4c6668282a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ # Attributes used for formatting. -[attr]our-c-style whitespace=tab-in-indent format.clang-format=9 +[attr]our-c-style whitespace=tab-in-indent format.clang-format=16 [attr]our-py-style whitespace=tab-in-indent format.autopep8 [attr]our-rst-style conflict-marker-size=100 # Attributes for binary and/or large files -- GitLab From 8bed1a35f088933b1899f726d44688a0deaaed30 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 28 Feb 2025 00:20:06 +0100 Subject: [PATCH 3/4] cmake: use C++17 Also suppress `clang-tidy` lints that appear because of it. Will be fixed in a followup. Closes: #495 --- .clang-tidy | 5 +++++ CMakeLists.txt | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index e82b4e4bb8..4097eb3df1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -62,10 +62,13 @@ misc-*,\ -misc-use-anonymous-namespace,\ -misc-use-internal-linkage,\ modernize-*,\ +-modernize-avoid-bind,\ -modernize-avoid-c-arrays,\ +-modernize-concat-nested-namespaces,\ -modernize-loop-convert,\ -modernize-macro-to-enum,\ -modernize-make-shared,\ +-modernize-make-unique,\ -modernize-pass-by-value,\ -modernize-raw-string-literal,\ -modernize-return-braced-init-list,\ @@ -75,6 +78,7 @@ modernize-*,\ -modernize-use-emplace,\ -modernize-use-equals-default,\ -modernize-use-equals-delete,\ +-modernize-use-nodiscard,\ -modernize-use-noexcept,\ -modernize-use-nullptr,\ -modernize-use-override,\ @@ -122,6 +126,7 @@ readability-*,\ -readability-redundant-access-specifiers,\ -readability-redundant-casting,\ -readability-redundant-control-flow,\ +-readability-redundant-declaration,\ -readability-redundant-inline-specifier,\ -readability-redundant-member-init,\ -readability-redundant-smartptr-get,\ diff --git a/CMakeLists.txt b/CMakeLists.txt index 898e5db597..690be8b37f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.20) #If the user/superbuild hasn't explicitly stated what c++ standard to use -#require C++11 +#require C++17 if(NOT DEFINED CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_EXTENSIONS FALSE) endif() -- GitLab From e6340336a6b2af2541733cb54e2dc9a78d622169 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 28 Feb 2025 00:20:26 +0100 Subject: [PATCH 4/4] reformat: synchronize formatting with clang-format-16 --- smtk/AutoInit.h | 10 ++++++++-- smtk/SharedFromThis.h | 20 +++++++++++++++---- smtk/SystemConfig.h | 10 ++++++++-- smtk/common/WeakReferenceWrapper.h | 3 ++- .../pqSMTKAppComponentsAutoStart.cxx | 2 +- ...qSMTKCallObserversOnMainThreadBehavior.cxx | 8 ++++---- ...pqSMTKCloseWithActiveOperationBehavior.cxx | 2 +- .../pqSMTKRegisterImportersBehavior.cxx | 2 +- .../pqSMTKRenderResourceBehavior.cxx | 2 +- .../pqSMTKSaveOnCloseResourceBehavior.cxx | 4 ++-- .../paraview/markup/qtOntologyItem.cxx | 4 ++-- smtk/extension/qt/qtDiscreteValueEditor.cxx | 2 +- ...tSMTKCallObserversOnMainThreadBehavior.cxx | 6 +++--- .../qt/testing/cxx/unitQtComponentItem.cxx | 2 +- smtk/graph/ArcProperties.h | 8 ++++---- smtk/graph/testing/cxx/TestScalability.cxx | 6 +++--- smtk/mesh/core/Handle.h | 4 ++-- smtk/mesh/testing/cxx/TestElevateMesh.cxx | 6 +++--- .../cxx/TestElevateMeshOnStructuredGrid.cxx | 8 ++++---- .../testing/python/TestRuntimePyOperation.cxx | 6 +++--- smtk/mesh/utility/ExtractTessellation.cxx | 2 +- smtk/model/EntityRef.h | 5 ++++- smtk/view/ObjectGroupPhraseContent.cxx | 4 ++-- smtk/view/ReferenceItemPhraseModel.cxx | 2 +- 24 files changed, 78 insertions(+), 50 deletions(-) diff --git a/smtk/AutoInit.h b/smtk/AutoInit.h index bfa3c2675c..a13b4bf110 100644 --- a/smtk/AutoInit.h +++ b/smtk/AutoInit.h @@ -47,9 +47,15 @@ smtkAutoInitComponentMacro(C) static struct C##_ComponentInit \ { \ /* Call _AutoInit_Construct during initialization. */ \ - C##_ComponentInit() { smtkAutoInitConstructMacro(C) } \ + C##_ComponentInit() \ + { \ + smtkAutoInitConstructMacro(C) \ + } \ /* Call _AutoInit_Destruct during finalization. */ \ - ~C##_ComponentInit() { smtkAutoInitDestructMacro(C) } \ + ~C##_ComponentInit() \ + { \ + smtkAutoInitDestructMacro(C) \ + } \ } C##_ComponentInit_Instance; #endif // smtk_AutoInit_h diff --git a/smtk/SharedFromThis.h b/smtk/SharedFromThis.h index 62e2a2271b..84ec3a1c2b 100644 --- a/smtk/SharedFromThis.h +++ b/smtk/SharedFromThis.h @@ -30,7 +30,10 @@ /// Used by smtkTypeMacro and smtkTypeMacroBase to provide access to the inheritance hierarchy. #define smtkInheritanceHierarchyBase(...) \ - virtual smtk::string::Token typeToken() const { return smtk::string::Token(type_name); } \ + virtual smtk::string::Token typeToken() const \ + { \ + return smtk::string::Token(type_name); \ + } \ virtual std::vector classHierarchy() const \ { \ static std::vector baseTypes; \ @@ -68,7 +71,10 @@ } #define smtkInheritanceHierarchy(...) \ - smtk::string::Token typeToken() const override { return smtk::string::Token(type_name); } \ + smtk::string::Token typeToken() const override \ + { \ + return smtk::string::Token(type_name); \ + } \ std::vector classHierarchy() const override \ { \ static std::vector baseTypes; \ @@ -101,11 +107,17 @@ */ #define smtkTypenameMacroBase(...) \ static constexpr const char* const type_name = #__VA_ARGS__; \ - virtual std::string typeName() const { return type_name; } \ + virtual std::string typeName() const \ + { \ + return type_name; \ + } \ smtkInheritanceHierarchyBase(__VA_ARGS__); #define smtkTypenameMacro(...) \ static constexpr const char* const type_name = #__VA_ARGS__; \ - std::string typeName() const override { return type_name; } \ + std::string typeName() const override \ + { \ + return type_name; \ + } \ smtkInheritanceHierarchy(__VA_ARGS__); ///@} diff --git a/smtk/SystemConfig.h b/smtk/SystemConfig.h index 89f6733c3b..77e9168231 100644 --- a/smtk/SystemConfig.h +++ b/smtk/SystemConfig.h @@ -25,10 +25,16 @@ #endif //Windows specific stuff #define SMTK_BASE_TYPE(thisclass) \ - virtual const char* classname() const { return #thisclass; } + virtual const char* classname() const \ + { \ + return #thisclass; \ + } #define SMTK_DERIVED_TYPE(thisclass, superclass) \ typedef superclass Superclass; \ - const char* classname() const override { return #thisclass; } + const char* classname() const override \ + { \ + return #thisclass; \ + } #endif //__smtk_SystemConfig_h diff --git a/smtk/common/WeakReferenceWrapper.h b/smtk/common/WeakReferenceWrapper.h index 1d656da210..20b0175571 100644 --- a/smtk/common/WeakReferenceWrapper.h +++ b/smtk/common/WeakReferenceWrapper.h @@ -125,7 +125,8 @@ public: this->get(); } // Use this union to avoid strict-aliasing warnings about type-punned pointers: - union { + union + { Type* const* cache_ptr; const size_t* hash_ptr; } data; diff --git a/smtk/extension/paraview/appcomponents/pqSMTKAppComponentsAutoStart.cxx b/smtk/extension/paraview/appcomponents/pqSMTKAppComponentsAutoStart.cxx index c5e1b6da04..8c8275e1c9 100644 --- a/smtk/extension/paraview/appcomponents/pqSMTKAppComponentsAutoStart.cxx +++ b/smtk/extension/paraview/appcomponents/pqSMTKAppComponentsAutoStart.cxx @@ -186,7 +186,7 @@ void pqSMTKAppComponentsAutoStart::observeWrapper(pqSMTKWrapper* wrapper, pqServ [this]( const smtk::operation::Operation& op, smtk::operation::EventType event, - smtk::operation::Operation::Result const & + smtk::operation::Operation::Result const& /*result*/) -> int { (void)op; if (event == smtk::operation::EventType::WILL_OPERATE) diff --git a/smtk/extension/paraview/appcomponents/pqSMTKCallObserversOnMainThreadBehavior.cxx b/smtk/extension/paraview/appcomponents/pqSMTKCallObserversOnMainThreadBehavior.cxx index 7dd0423155..908fc96d37 100644 --- a/smtk/extension/paraview/appcomponents/pqSMTKCallObserversOnMainThreadBehavior.cxx +++ b/smtk/extension/paraview/appcomponents/pqSMTKCallObserversOnMainThreadBehavior.cxx @@ -30,7 +30,7 @@ pqSMTKCallObserversOnMainThreadBehavior::pqSMTKCallObserversOnMainThreadBehavior // thread. QObject::connect( pqSMTKBehavior::instance(), - (void (pqSMTKBehavior::*)(pqSMTKWrapper*, pqServer*)) & pqSMTKBehavior::addedManagerOnServer, + (void(pqSMTKBehavior::*)(pqSMTKWrapper*, pqServer*)) & pqSMTKBehavior::addedManagerOnServer, this, &pqSMTKCallObserversOnMainThreadBehavior::forceObserversToBeCalledOnMainThread); } @@ -87,7 +87,7 @@ void pqSMTKCallObserversOnMainThreadBehavior::forceObserversToBeCalledOnMainThre std::weak_ptr resourceManager = wrapper->smtkResourceManager(); QObject::connect( this, - (void (pqSMTKCallObserversOnMainThreadBehavior::*)(QString, int, QPrivateSignal)) & + (void(pqSMTKCallObserversOnMainThreadBehavior::*)(QString, int, QPrivateSignal)) & pqSMTKCallObserversOnMainThreadBehavior::resourceEvent, this, [this, resourceManager](QString resourceId, int event) { @@ -135,7 +135,7 @@ void pqSMTKCallObserversOnMainThreadBehavior::forceObserversToBeCalledOnMainThre // functors. QObject::connect( this, - (void (pqSMTKCallObserversOnMainThreadBehavior::*)(QString, int, QString, QPrivateSignal)) & + (void(pqSMTKCallObserversOnMainThreadBehavior::*)(QString, int, QString, QPrivateSignal)) & pqSMTKCallObserversOnMainThreadBehavior::operationEvent, this, [this](QString operationId, int event, QString resultName) { @@ -171,7 +171,7 @@ void pqSMTKCallObserversOnMainThreadBehavior::forceObserversToBeCalledOnMainThre // functors. QObject::connect( this, - (void (pqSMTKCallObserversOnMainThreadBehavior::*)(QString, QString, QPrivateSignal)) & + (void(pqSMTKCallObserversOnMainThreadBehavior::*)(QString, QString, QPrivateSignal)) & pqSMTKCallObserversOnMainThreadBehavior::selectionEvent, this, [this](QString selectionId, QString qstr) { diff --git a/smtk/extension/paraview/appcomponents/pqSMTKCloseWithActiveOperationBehavior.cxx b/smtk/extension/paraview/appcomponents/pqSMTKCloseWithActiveOperationBehavior.cxx index cb144a2129..62c79ec8b4 100644 --- a/smtk/extension/paraview/appcomponents/pqSMTKCloseWithActiveOperationBehavior.cxx +++ b/smtk/extension/paraview/appcomponents/pqSMTKCloseWithActiveOperationBehavior.cxx @@ -54,7 +54,7 @@ pqSMTKCloseWithActiveOperationBehavior::pqSMTKCloseWithActiveOperationBehavior(Q // tracks the number of active operations. QObject::connect( pqSMTKBehavior::instance(), - (void (pqSMTKBehavior::*)(pqSMTKWrapper*, pqServer*)) & pqSMTKBehavior::addedManagerOnServer, + (void(pqSMTKBehavior::*)(pqSMTKWrapper*, pqServer*)) & pqSMTKBehavior::addedManagerOnServer, this, &pqSMTKCloseWithActiveOperationBehavior::trackActiveOperations); diff --git a/smtk/extension/paraview/appcomponents/pqSMTKRegisterImportersBehavior.cxx b/smtk/extension/paraview/appcomponents/pqSMTKRegisterImportersBehavior.cxx index c0a1eaae15..c2af7e0cd3 100644 --- a/smtk/extension/paraview/appcomponents/pqSMTKRegisterImportersBehavior.cxx +++ b/smtk/extension/paraview/appcomponents/pqSMTKRegisterImportersBehavior.cxx @@ -175,7 +175,7 @@ pqSMTKRegisterImportersBehavior::pqSMTKRegisterImportersBehavior(QObject* parent { QObject::connect( pqSMTKBehavior::instance(), - (void (pqSMTKBehavior::*)(pqSMTKWrapper*, pqServer*)) & pqSMTKBehavior::addedManagerOnServer, + (void(pqSMTKBehavior::*)(pqSMTKWrapper*, pqServer*)) & pqSMTKBehavior::addedManagerOnServer, this, &pqSMTKRegisterImportersBehavior::constructImporters); } diff --git a/smtk/extension/paraview/appcomponents/pqSMTKRenderResourceBehavior.cxx b/smtk/extension/paraview/appcomponents/pqSMTKRenderResourceBehavior.cxx index ac3af96ddd..2dbdb90bc1 100644 --- a/smtk/extension/paraview/appcomponents/pqSMTKRenderResourceBehavior.cxx +++ b/smtk/extension/paraview/appcomponents/pqSMTKRenderResourceBehavior.cxx @@ -112,7 +112,7 @@ pqSMTKRenderResourceBehavior::pqSMTKRenderResourceBehavior(QObject* parent) QObject::connect( pqSMTKBehavior::instance(), - (void (pqSMTKBehavior::*)(pqSMTKWrapper*, pqServer*)) & pqSMTKBehavior::addedManagerOnServer, + (void(pqSMTKBehavior::*)(pqSMTKWrapper*, pqServer*)) & pqSMTKBehavior::addedManagerOnServer, onAddedManagerOnServer); } diff --git a/smtk/extension/paraview/appcomponents/pqSMTKSaveOnCloseResourceBehavior.cxx b/smtk/extension/paraview/appcomponents/pqSMTKSaveOnCloseResourceBehavior.cxx index efd028a4c8..a48e027918 100644 --- a/smtk/extension/paraview/appcomponents/pqSMTKSaveOnCloseResourceBehavior.cxx +++ b/smtk/extension/paraview/appcomponents/pqSMTKSaveOnCloseResourceBehavior.cxx @@ -60,7 +60,7 @@ pqSMTKSaveOnCloseResourceBehavior::pqSMTKSaveOnCloseResourceBehavior(QObject* pa pqObjectBuilder* builder = pqCore->getObjectBuilder(); QObject::connect( builder, - (void (pqObjectBuilder::*)(pqPipelineSource*)) & pqObjectBuilder::destroying, + (void(pqObjectBuilder::*)(pqPipelineSource*)) & pqObjectBuilder::destroying, [](pqPipelineSource* source) { pqSMTKResource* smtkResource = dynamic_cast(source); if (smtkResource == nullptr) @@ -124,7 +124,7 @@ pqSMTKSaveOnCloseResourceBehavior::pqSMTKSaveOnCloseResourceBehavior(QObject* pa QObject::connect( pqSMTKBehavior::instance(), - (void (pqSMTKBehavior::*)(pqSMTKWrapper*, pqServer*)) & + (void(pqSMTKBehavior::*)(pqSMTKWrapper*, pqServer*)) & pqSMTKBehavior::removingManagerFromServer, onRemovingManagerFromServer); diff --git a/smtk/extension/paraview/markup/qtOntologyItem.cxx b/smtk/extension/paraview/markup/qtOntologyItem.cxx index bfb113bd34..98c9a992a7 100644 --- a/smtk/extension/paraview/markup/qtOntologyItem.cxx +++ b/smtk/extension/paraview/markup/qtOntologyItem.cxx @@ -575,13 +575,13 @@ void qtOntologyItem::updateUI() // When user chooses an identifier, update the labels and item values. QObject::connect( m_p->m_completer, - (void (QCompleter::*)(const QModelIndex&)) & QCompleter::activated, + (void(QCompleter::*)(const QModelIndex&)) & QCompleter::activated, this, &qtOntologyItem::modelEntryChosen); // When the user hovers over an identifier, update the labels (but not the item values). QObject::connect( m_p->m_completer, - (void (QCompleter::*)(const QModelIndex&)) & QCompleter::highlighted, + (void(QCompleter::*)(const QModelIndex&)) & QCompleter::highlighted, this, &qtOntologyItem::modelEntryHighlighted); // Clear label text when the user enters a non-match diff --git a/smtk/extension/qt/qtDiscreteValueEditor.cxx b/smtk/extension/qt/qtDiscreteValueEditor.cxx index 69ff792e09..94b7cfa556 100644 --- a/smtk/extension/qt/qtDiscreteValueEditor.cxx +++ b/smtk/extension/qt/qtDiscreteValueEditor.cxx @@ -158,7 +158,7 @@ void qtDiscreteValueEditor::createWidget() QPointer guardedObject(this); QObject::connect( combo, - (void (QComboBox::*)(int)) & QComboBox::currentIndexChanged, + (void(QComboBox::*)(int)) & QComboBox::currentIndexChanged, this, [guardedObject]() { if (guardedObject) diff --git a/smtk/extension/qt/qtSMTKCallObserversOnMainThreadBehavior.cxx b/smtk/extension/qt/qtSMTKCallObserversOnMainThreadBehavior.cxx index c2571f27ea..57031deea8 100644 --- a/smtk/extension/qt/qtSMTKCallObserversOnMainThreadBehavior.cxx +++ b/smtk/extension/qt/qtSMTKCallObserversOnMainThreadBehavior.cxx @@ -72,7 +72,7 @@ void qtSMTKCallObserversOnMainThreadBehavior::forceObserversToBeCalledOnMainThre mgrs->get(); QObject::connect( this, - (void (qtSMTKCallObserversOnMainThreadBehavior::*)(QString, int, QPrivateSignal)) & + (void(qtSMTKCallObserversOnMainThreadBehavior::*)(QString, int, QPrivateSignal)) & qtSMTKCallObserversOnMainThreadBehavior::resourceEvent, this, [this, resourceManager](QString resourceId, int event) { @@ -124,7 +124,7 @@ void qtSMTKCallObserversOnMainThreadBehavior::forceObserversToBeCalledOnMainThre // functors. QObject::connect( this, - (void (qtSMTKCallObserversOnMainThreadBehavior::*)(QString, int, QString, QPrivateSignal)) & + (void(qtSMTKCallObserversOnMainThreadBehavior::*)(QString, int, QString, QPrivateSignal)) & qtSMTKCallObserversOnMainThreadBehavior::operationEvent, this, [this](QString operationId, int event, QString resultName) { @@ -164,7 +164,7 @@ void qtSMTKCallObserversOnMainThreadBehavior::forceObserversToBeCalledOnMainThre // functors. QObject::connect( this, - (void (qtSMTKCallObserversOnMainThreadBehavior::*)(QString, QString, QPrivateSignal)) & + (void(qtSMTKCallObserversOnMainThreadBehavior::*)(QString, QString, QPrivateSignal)) & qtSMTKCallObserversOnMainThreadBehavior::selectionEvent, this, [this](QString selectionId, QString qstr) { diff --git a/smtk/extension/qt/testing/cxx/unitQtComponentItem.cxx b/smtk/extension/qt/testing/cxx/unitQtComponentItem.cxx index df0e5096fe..6c387bc77c 100644 --- a/smtk/extension/qt/testing/cxx/unitQtComponentItem.cxx +++ b/smtk/extension/qt/testing/cxx/unitQtComponentItem.cxx @@ -382,7 +382,7 @@ int unitQtComponentItem(int argc, char* argv[]) QObject::connect(ef, &qtEventFilter::reset, [&m_visibleThings, &phraseModel]() { phraseModel->root()->visitChildren( [&phraseModel, &m_visibleThings]( - smtk::view::DescriptivePhrasePtr cphr, std::vector & /*unused*/) -> int { + smtk::view::DescriptivePhrasePtr cphr, std::vector& /*unused*/) -> int { std::map::iterator it; if ( cphr->relatedComponent() && diff --git a/smtk/graph/ArcProperties.h b/smtk/graph/ArcProperties.h index d19de5f24c..f37d442caa 100644 --- a/smtk/graph/ArcProperties.h +++ b/smtk/graph/ArcProperties.h @@ -377,7 +377,7 @@ public: template constexpr typename std::enable_if::value, std::size_t>::type - maxOutDegree(std::size_t) + maxOutDegree(std::size_t) { return T::MaxOutDegree; } @@ -394,7 +394,7 @@ constexpr std::size_t maxOutDegree(...) template constexpr typename std::enable_if::value, std::size_t>::type - maxInDegree(std::size_t) + maxInDegree(std::size_t) { return T::MaxInDegree; } @@ -411,7 +411,7 @@ constexpr std::size_t maxInDegree(...) template constexpr typename std::enable_if::value, std::size_t>::type - minOutDegree(std::size_t) + minOutDegree(std::size_t) { return T::MinOutDegree; } @@ -428,7 +428,7 @@ constexpr std::size_t minOutDegree(...) template constexpr typename std::enable_if::value, std::size_t>::type - minInDegree(std::size_t) + minInDegree(std::size_t) { return T::MinInDegree; } diff --git a/smtk/graph/testing/cxx/TestScalability.cxx b/smtk/graph/testing/cxx/TestScalability.cxx index 15c84a43aa..9e9fc1e056 100644 --- a/smtk/graph/testing/cxx/TestScalability.cxx +++ b/smtk/graph/testing/cxx/TestScalability.cxx @@ -166,7 +166,7 @@ int TestScalability(int argc, char* argv[]) for (const auto& node : resource->nodes()) { std::dynamic_pointer_cast(node)->outgoing().visit( - [&](const Node * /* to */) -> smtk::common::Visit { return nooptimize; }); + [&](const Node* /* to */) -> smtk::common::Visit { return nooptimize; }); } timer.toc(); std::cout << "Visited " << num_node * degree_node << " arc(s) in " << timer.elapsed() << "(" @@ -193,7 +193,7 @@ int TestScalability(int argc, char* argv[]) for (const auto& node : resource->nodes()) { std::dynamic_pointer_cast(node)->outgoing().visit( - [&](const Node * /* to */) -> smtk::common::Visit { + [&](const Node* /* to */) -> smtk::common::Visit { narc++; return nooptimize; }); @@ -207,7 +207,7 @@ int TestScalability(int argc, char* argv[]) for (const auto& node : resource->nodes()) { std::dynamic_pointer_cast(node)->outgoing().visit( - [&](const Node * /* to */) -> smtk::common::Visit { + [&](const Node* /* to */) -> smtk::common::Visit { narc++; return nooptimize; }); diff --git a/smtk/mesh/core/Handle.h b/smtk/mesh/core/Handle.h index 3d2507f700..2653ffeb89 100644 --- a/smtk/mesh/core/Handle.h +++ b/smtk/mesh/core/Handle.h @@ -44,8 +44,8 @@ namespace mesh typedef boost::icl::closed_interval HandleInterval; typedef boost::icl::interval_set HandleRange; -typedef decltype( - boost::icl::elements_begin(std::declval())) const_element_iterator; +typedef decltype(boost::icl::elements_begin( + std::declval())) const_element_iterator; /// Return an iterator to the first element in the range SMTKCORE_EXPORT const_element_iterator rangeElementsBegin(const HandleRange&); diff --git a/smtk/mesh/testing/cxx/TestElevateMesh.cxx b/smtk/mesh/testing/cxx/TestElevateMesh.cxx index 82d4cd9eb7..46a4a513b4 100644 --- a/smtk/mesh/testing/cxx/TestElevateMesh.cxx +++ b/smtk/mesh/testing/cxx/TestElevateMesh.cxx @@ -89,9 +89,9 @@ public: ++i, counter += 3) { std::size_t bin = xyz[counter + 2] < m_min ? 0 - : xyz[counter + 2] > m_max - ? m_hist.size() - 1 - : static_cast((xyz[counter + 2] - m_min) / (m_max - m_min) * m_hist.size()); + : xyz[counter + 2] > m_max + ? m_hist.size() - 1 + : static_cast((xyz[counter + 2] - m_min) / (m_max - m_min) * m_hist.size()); ++m_hist[bin]; } } diff --git a/smtk/mesh/testing/cxx/TestElevateMeshOnStructuredGrid.cxx b/smtk/mesh/testing/cxx/TestElevateMeshOnStructuredGrid.cxx index 975aa70420..5c55dd2f8e 100644 --- a/smtk/mesh/testing/cxx/TestElevateMeshOnStructuredGrid.cxx +++ b/smtk/mesh/testing/cxx/TestElevateMeshOnStructuredGrid.cxx @@ -93,10 +93,10 @@ public: ++i, counter += 3) { std::size_t bin = xyz[counter + m_coord] < m_min ? 0 - : xyz[counter + m_coord] >= m_max - ? m_hist.size() - 1 - : static_cast( - (xyz[counter + m_coord] - m_min) / (m_max - m_min) * m_hist.size()); + : xyz[counter + m_coord] >= m_max + ? m_hist.size() - 1 + : static_cast( + (xyz[counter + m_coord] - m_min) / (m_max - m_min) * m_hist.size()); ++m_hist[bin]; } } diff --git a/smtk/mesh/testing/python/TestRuntimePyOperation.cxx b/smtk/mesh/testing/python/TestRuntimePyOperation.cxx index efb19309e9..311872eee0 100644 --- a/smtk/mesh/testing/python/TestRuntimePyOperation.cxx +++ b/smtk/mesh/testing/python/TestRuntimePyOperation.cxx @@ -84,9 +84,9 @@ public: for (c_it i = pointIds.begin(); i != pointIds.end(); ++i, counter += 3) { std::size_t bin = xyz[counter + 2] < m_min ? 0 - : xyz[counter + 2] > m_max - ? m_hist.size() - 1 - : static_cast((xyz[counter + 2] - m_min) / (m_max - m_min) * m_hist.size()); + : xyz[counter + 2] > m_max + ? m_hist.size() - 1 + : static_cast((xyz[counter + 2] - m_min) / (m_max - m_min) * m_hist.size()); ++m_hist[bin]; } } diff --git a/smtk/mesh/utility/ExtractTessellation.cxx b/smtk/mesh/utility/ExtractTessellation.cxx index c73ec2b599..27997a5cf1 100644 --- a/smtk/mesh/utility/ExtractTessellation.cxx +++ b/smtk/mesh/utility/ExtractTessellation.cxx @@ -351,7 +351,7 @@ void extractTessellationInternal( //we are using VTK style connectivity or a compacted connectivity format. //determine the function pointer to use for the connectivity array - std::size_t (*addCellLen)(std::int64_t & conn, std::size_t index, int numPts) = + std::size_t (*addCellLen)(std::int64_t& conn, std::size_t index, int numPts) = detail::smtkToSMTKConn; if (tess.m_useVTKConnectivity) { diff --git a/smtk/model/EntityRef.h b/smtk/model/EntityRef.h index 59512aad8e..0a27cfebf6 100644 --- a/smtk/model/EntityRef.h +++ b/smtk/model/EntityRef.h @@ -60,7 +60,10 @@ class MeshSet; } \ } \ ~thisclass() override = default; /* Avoid warnings about non-virtual destructor */ \ - bool isValid() const { return this->EntityRef::isValid(); } \ + bool isValid() const \ + { \ + return this->EntityRef::isValid(); \ + } \ bool isValid(EntityPtr* entRec) const override \ { \ EntityPtr er; \ diff --git a/smtk/view/ObjectGroupPhraseContent.cxx b/smtk/view/ObjectGroupPhraseContent.cxx index 37e6d84e7c..85b0ac24f8 100644 --- a/smtk/view/ObjectGroupPhraseContent.cxx +++ b/smtk/view/ObjectGroupPhraseContent.cxx @@ -90,7 +90,7 @@ void ObjectGroupPhraseContent::children(DescriptivePhrases& container) const const smtk::resource::ManagerPtr& rsrcMgr, const smtk::operation::ManagerPtr& /*unused*/, const smtk::view::ManagerPtr& /*unused*/, - const smtk::view::SelectionPtr & + const smtk::view::SelectionPtr& /*unused*/) -> smtk::common::Visit { if (!rsrcMgr) { @@ -142,7 +142,7 @@ bool ObjectGroupPhraseContent::hasChildren() const const smtk::resource::ManagerPtr& rsrcMgr, const smtk::operation::ManagerPtr& /*unused*/, const smtk::view::ManagerPtr& /*unused*/, - const smtk::view::SelectionPtr & + const smtk::view::SelectionPtr& /*unused*/) -> smtk::common::Visit { if (!rsrcMgr) { diff --git a/smtk/view/ReferenceItemPhraseModel.cxx b/smtk/view/ReferenceItemPhraseModel.cxx index 238edcb79a..f53295ec22 100644 --- a/smtk/view/ReferenceItemPhraseModel.cxx +++ b/smtk/view/ReferenceItemPhraseModel.cxx @@ -68,7 +68,7 @@ void ReferenceItemPhraseModel::populateRoot() const smtk::resource::ManagerPtr& rsrcMgr, const smtk::operation::ManagerPtr& /*unused*/, const smtk::view::ManagerPtr& /*unused*/, - const smtk::view::SelectionPtr & + const smtk::view::SelectionPtr& /*unused*/) -> smtk::common::Visit { if (rsrcMgr) { -- GitLab