diff --git a/src/App/Application.cpp b/src/App/Application.cpp index fcb1c7e948..06edbd33e8 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -233,9 +233,7 @@ init_image_module() } Application::Application(std::map &mConfig) - : _mConfig(mConfig), _pActiveDoc(nullptr), _isRestoring(false),_allowPartial(false) - , _isClosingAll(false), _objCount(-1), _activeTransactionID(0) - , _activeTransactionGuard(0), _activeTransactionTmpName(false) + : _mConfig(mConfig) { //_hApp = new ApplicationOCC; mpcPramManager["System parameter"] = _pcSysParamMngr; diff --git a/src/App/Application.h b/src/App/Application.h index 45868f018b..551e8941f4 100644 --- a/src/App/Application.h +++ b/src/App/Application.h @@ -607,7 +607,7 @@ private: mutable std::map DocFileMap; std::map> mpcPramManager; std::map &_mConfig; - App::Document* _pActiveDoc; + App::Document* _pActiveDoc{nullptr}; std::deque _pendingDocs; std::deque _pendingDocsReopen; @@ -617,19 +617,19 @@ private: // missing object std::map > _docReloadAttempts; - bool _isRestoring; - bool _allowPartial; - bool _isClosingAll; + bool _isRestoring{false}; + bool _allowPartial{false}; + bool _isClosingAll{false}; // for estimate max link depth - int _objCount; + int _objCount{-1}; friend class AutoTransaction; std::string _activeTransactionName; - int _activeTransactionID; - int _activeTransactionGuard; - bool _activeTransactionTmpName; + int _activeTransactionID{0}; + int _activeTransactionGuard{0}; + bool _activeTransactionTmpName{false}; static Base::ConsoleObserverStd *_pConsoleObserverStd; static Base::ConsoleObserverFile *_pConsoleObserverFile; diff --git a/src/App/ColorModel.cpp b/src/App/ColorModel.cpp index 4fdd3485f1..2bd3a306e8 100644 --- a/src/App/ColorModel.cpp +++ b/src/App/ColorModel.cpp @@ -157,16 +157,7 @@ void ColorField::interpolate (Color clCol1, std::size_t usInd1, Color clCol2, st } -ColorGradientProfile::ColorGradientProfile() - : tStyle{ColorBarStyle::FLOW} - , fMin{} - , fMax{} - , ctColors{} - , tColorModel{} - , visibility{Visibility::Default} -{ - -} +ColorGradientProfile::ColorGradientProfile() = default; bool ColorGradientProfile::isEqual(const ColorGradientProfile& cg) const { @@ -309,8 +300,7 @@ void ColorGradient::setColorModel () } } -ColorLegend::ColorLegend () - : outsideGrayed(false) +ColorLegend::ColorLegend() { // default blue, green, red colorFields.emplace_back(0, 0, 1); diff --git a/src/App/ColorModel.h b/src/App/ColorModel.h index 36a55e1906..690701fc62 100644 --- a/src/App/ColorModel.h +++ b/src/App/ColorModel.h @@ -342,12 +342,12 @@ inline std::size_t ColorField::getColorIndex (float fVal) const struct AppExport ColorGradientProfile { - ColorBarStyle tStyle; - float fMin; - float fMax; - std::size_t ctColors; - std::size_t tColorModel; - VisibilityFlags visibility; + ColorBarStyle tStyle{ColorBarStyle::FLOW}; + float fMin{}; + float fMax{}; + std::size_t ctColors{}; + std::size_t tColorModel{}; + VisibilityFlags visibility{Visibility::Default}; ColorGradientProfile(); ColorGradientProfile (const ColorGradientProfile &) = default; @@ -484,7 +484,7 @@ protected: std::deque colorFields; std::deque names; std::deque values; - bool outsideGrayed; + bool outsideGrayed{false}; }; inline Color ColorLegend::getColor (float fVal) const diff --git a/src/App/ComplexGeoData.cpp b/src/App/ComplexGeoData.cpp index 4f5407461d..52c3c09199 100644 --- a/src/App/ComplexGeoData.cpp +++ b/src/App/ComplexGeoData.cpp @@ -55,10 +55,7 @@ using namespace Data; // NOLINTBEGIN(cppcoreguidelines-pro-bounds-pointer-arithmetic) -ComplexGeoData::ComplexGeoData() - :Tag(0) -{ -} +ComplexGeoData::ComplexGeoData() = default; Data::Segment* ComplexGeoData::getSubElementByName(const char* name) const { diff --git a/src/App/ComplexGeoData.h b/src/App/ComplexGeoData.h index 42a1a539a5..7f2bf79301 100644 --- a/src/App/ComplexGeoData.h +++ b/src/App/ComplexGeoData.h @@ -335,7 +335,7 @@ protected: static_cast(tmp.z)); } public: - mutable long Tag; + mutable long Tag{0}; public: diff --git a/src/App/DocumentObject.cpp b/src/App/DocumentObject.cpp index 2d56834e55..a5202192d2 100644 --- a/src/App/DocumentObject.cpp +++ b/src/App/DocumentObject.cpp @@ -63,7 +63,7 @@ DocumentObjectExecReturn *DocumentObject::StdReturn = nullptr; //=========================================================================== DocumentObject::DocumentObject() - : ExpressionEngine(),_pDoc(nullptr),pcNameInDocument(nullptr),_Id(0) + : ExpressionEngine() { // define Label of type 'Output' to avoid being marked as touched after relabeling ADD_PROPERTY_TYPE(Label,("Unnamed"),"Base",Prop_Output,"User name of the object (UTF8)"); diff --git a/src/App/DocumentObject.h b/src/App/DocumentObject.h index 6490de0605..a274a60c0c 100644 --- a/src/App/DocumentObject.h +++ b/src/App/DocumentObject.h @@ -626,20 +626,20 @@ private: protected: // attributes Py::SmartPtr PythonObject; /// pointer to the document this object belongs to - App::Document* _pDoc; + App::Document* _pDoc{nullptr}; /// Old label; used for renaming expressions std::string oldLabel; // pointer to the document name string (for performance) - const std::string *pcNameInDocument; + const std::string *pcNameInDocument{nullptr}; private: // accessed by App::Document to record and restore the correct view provider type std::string _pcViewProviderName; // unique identifier (among a document) of this object. - long _Id; + long _Id{0}; private: // Back pointer to all the fathers in a DAG of the document diff --git a/src/App/DocumentObjectPyImp.cpp b/src/App/DocumentObjectPyImp.cpp index dee1e06b3b..21854f7c50 100644 --- a/src/App/DocumentObjectPyImp.cpp +++ b/src/App/DocumentObjectPyImp.cpp @@ -471,11 +471,11 @@ PyObject* DocumentObjectPy::getSubObject(PyObject *args, PyObject *keywds) bool transform = Base::asBoolean(doTransform); struct SubInfo { - App::DocumentObject *sobj; + App::DocumentObject *sobj{nullptr}; Py::Object obj; Py::Object pyObj; Base::Matrix4D mat; - explicit SubInfo(const Base::Matrix4D &mat) : sobj(nullptr), mat(mat){} + explicit SubInfo(const Base::Matrix4D &mat) : mat(mat){} }; Base::Matrix4D mat; diff --git a/src/App/DocumentObserver.cpp b/src/App/DocumentObserver.cpp index 49f32235c8..df665b44fe 100644 --- a/src/App/DocumentObserver.cpp +++ b/src/App/DocumentObserver.cpp @@ -595,7 +595,7 @@ App::Document* DocumentWeakPtrT::operator->() const noexcept class DocumentObjectWeakPtrT::Private { public: - explicit Private(App::DocumentObject* obj) : object(obj), indocument(false) { + explicit Private(App::DocumentObject* obj) : object(obj) { set(obj); } void deletedDocument(const App::Document& doc) { @@ -642,7 +642,7 @@ public: } App::DocumentObject* object; - bool indocument; + bool indocument{false}; using Connection = boost::signals2::scoped_connection; Connection connectApplicationDeletedDocument; Connection connectDocumentCreatedObject; diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index dccf2c07d0..75ac7e2e37 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -967,7 +967,7 @@ std::map Expression::getIdentifiers() const { class AdjustLinksExpressionVisitor : public ExpressionVisitor { public: explicit AdjustLinksExpressionVisitor(const std::set &inList) - :inList(inList),res(false) + :inList(inList) {} void visit(Expression &e) override { @@ -976,7 +976,7 @@ public: } const std::set &inList; - bool res; + bool res{false}; }; bool Expression::adjustLinks(const std::set &inList) { @@ -1871,7 +1871,7 @@ bool FunctionExpression::isTouched() const class Collector { public: - Collector() : first(true) { } + Collector() = default; virtual ~Collector() = default; virtual void collect(Quantity value) { if (first) @@ -1881,7 +1881,7 @@ public: return q; } protected: - bool first; + bool first{true}; Quantity q; }; @@ -1899,7 +1899,7 @@ public: class AverageCollector : public Collector { public: - AverageCollector() : Collector(), n(0) { } + AverageCollector() : Collector() { } void collect(Quantity value) override { Collector::collect(value); @@ -1911,12 +1911,12 @@ public: Quantity getQuantity() const override { return q/(double)n; } private: - unsigned int n; + unsigned int n{0}; }; class StdDevCollector : public Collector { public: - StdDevCollector() : Collector(), n(0) { } + StdDevCollector() : Collector() { } void collect(Quantity value) override { Collector::collect(value); @@ -1941,14 +1941,14 @@ public: } private: - unsigned int n; + unsigned int n{0}; Quantity mean; Quantity M2; }; class CountCollector : public Collector { public: - CountCollector() : Collector(), n(0) { } + CountCollector() : Collector() { } void collect(Quantity value) override { Collector::collect(value); @@ -1959,7 +1959,7 @@ public: Quantity getQuantity() const override { return Quantity(n); } private: - unsigned int n; + unsigned int n{0}; }; class MinCollector : public Collector { diff --git a/src/App/Expression.h b/src/App/Expression.h index c70d348278..78f1edb1c5 100644 --- a/src/App/Expression.h +++ b/src/App/Expression.h @@ -84,7 +84,6 @@ public: : prop(_prop) , propLink(Base::freecad_dynamic_cast(&prop)) , signaller(_prop,false) - , _changed(0) {} ~ExpressionModifier() override = default; @@ -104,7 +103,7 @@ protected: P & prop; App::PropertyLinkBase *propLink; typename AtomicPropertyChangeInterface

::AtomicPropertyChange signaller; - int _changed; + int _changed{0}; }; /** diff --git a/src/App/ExpressionParser.h b/src/App/ExpressionParser.h index 90725a30c3..3e3b282bbe 100644 --- a/src/App/ExpressionParser.h +++ b/src/App/ExpressionParser.h @@ -522,12 +522,12 @@ public: Base::Quantity scaler; std::string unitStr; } quantity; - Expression::Component *component; - Expression * expr; + Expression::Component *component{nullptr}; + Expression * expr{nullptr}; ObjectIdentifier path; std::deque components; - long long int ivalue; - double fvalue; + long long int ivalue{0}; + double fvalue{0}; struct { const char *name = ""; double fvalue = 0; @@ -537,8 +537,7 @@ public: std::string string; std::pair func; ObjectIdentifier::String string_or_identifier; - semantic_type() : component(nullptr), expr(nullptr), ivalue(0), fvalue(0) - , func({FunctionExpression::NONE, std::string()}) {} + semantic_type() : func({FunctionExpression::NONE, std::string()}) {} }; #define YYSTYPE semantic_type diff --git a/src/App/FeaturePython.cpp b/src/App/FeaturePython.cpp index 2aeddc2651..aa6553a2fe 100644 --- a/src/App/FeaturePython.cpp +++ b/src/App/FeaturePython.cpp @@ -38,7 +38,7 @@ using namespace App; FeaturePythonImp::FeaturePythonImp(App::DocumentObject* o) - : object(o), has__object__(false) + : object(o) { } diff --git a/src/App/FeaturePython.h b/src/App/FeaturePython.h index eb9c22f0c6..144d1f73ed 100644 --- a/src/App/FeaturePython.h +++ b/src/App/FeaturePython.h @@ -86,7 +86,7 @@ public: private: App::DocumentObject* object; - bool has__object__; + bool has__object__{false}; #define FC_PY_FEATURE_PYTHON \ FC_PY_ELEMENT(execute)\ diff --git a/src/App/Graphviz.cpp b/src/App/Graphviz.cpp index d8183bb4ce..181c8e61ae 100644 --- a/src/App/Graphviz.cpp +++ b/src/App/Graphviz.cpp @@ -94,7 +94,7 @@ void Document::exportGraphviz(std::ostream& out) const class GraphCreator { public: - explicit GraphCreator(struct DocumentP* _d) : d(_d), vertex_no(0), seed(std::random_device()()), distribution(0,255) { + explicit GraphCreator(struct DocumentP* _d) : d(_d), seed(std::random_device()()), distribution(0,255) { build(); } @@ -658,7 +658,7 @@ void Document::exportGraphviz(std::ostream& out) const const struct DocumentP* d; Graph DepList; - int vertex_no; + int vertex_no{0}; std::map LocalVertexList; std::map GlobalVertexList; std::set objects; diff --git a/src/App/ImagePlane.cpp b/src/App/ImagePlane.cpp index 1e9574a05d..9d8b8133ba 100644 --- a/src/App/ImagePlane.cpp +++ b/src/App/ImagePlane.cpp @@ -31,8 +31,6 @@ PROPERTY_SOURCE(Image::ImagePlane, App::GeoFeature) ImagePlane::ImagePlane() - : XPixelsPerMeter{1000.0} - , YPixelsPerMeter{1000.0} { ADD_PROPERTY_TYPE( ImageFile,(nullptr) , "ImagePlane",App::Prop_None,"File of the image"); ADD_PROPERTY_TYPE( XSize, (100), "ImagePlane",App::Prop_None,"Size of a pixel in X"); diff --git a/src/App/ImagePlane.h b/src/App/ImagePlane.h index 5588af408b..4afffe1d9c 100644 --- a/src/App/ImagePlane.h +++ b/src/App/ImagePlane.h @@ -48,8 +48,8 @@ public: void setXSizeInPixel(int); void setYSizeInPixel(int); - double XPixelsPerMeter; - double YPixelsPerMeter; + double XPixelsPerMeter{1000.0}; + double YPixelsPerMeter{1000.0}; /// returns the type name of the ViewProvider const char* getViewProviderName() const override { diff --git a/src/App/Link.cpp b/src/App/Link.cpp index f3c3a2af06..3350a4fa5b 100644 --- a/src/App/Link.cpp +++ b/src/App/Link.cpp @@ -148,7 +148,6 @@ void LinkParams::removeCopyOnChangeApplyToAll() { EXTENSION_PROPERTY_SOURCE(App::LinkBaseExtension, App::DocumentObjectExtension) LinkBaseExtension::LinkBaseExtension() - :enableLabelCache(false),hasOldSubElement(false),hasCopyOnChange(true) { initExtensionType(LinkBaseExtension::getExtensionClassTypeId()); EXTENSION_ADD_PROPERTY_TYPE(_LinkTouched, (false), " Link", diff --git a/src/App/Link.h b/src/App/Link.h index 9e0ed2cafc..606fc3f3e4 100644 --- a/src/App/Link.h +++ b/src/App/Link.h @@ -385,12 +385,12 @@ protected: long prevLinkedObjectID = 0; mutable std::unordered_map myLabelCache; // for label based subname lookup - mutable bool enableLabelCache; - bool hasOldSubElement; + mutable bool enableLabelCache{false}; + bool hasOldSubElement{false}; std::vector copyOnChangeConns; std::vector copyOnChangeSrcConns; - bool hasCopyOnChange; + bool hasCopyOnChange{true}; mutable bool checkingProperty = false; bool pauseCopyOnChange = false; diff --git a/src/App/MergeDocuments.cpp b/src/App/MergeDocuments.cpp index d80c7bdb0d..10453b163f 100644 --- a/src/App/MergeDocuments.cpp +++ b/src/App/MergeDocuments.cpp @@ -71,7 +71,8 @@ private: }; } -MergeDocuments::MergeDocuments(App::Document* doc) : guiup(false), verbose(true), stream(nullptr), appdoc(doc) +MergeDocuments::MergeDocuments(App::Document* doc) + : appdoc(doc) { //NOLINTBEGIN connectExport = doc->signalExportObjects.connect diff --git a/src/App/MergeDocuments.h b/src/App/MergeDocuments.h index cdcae9308e..f1cd31ec97 100644 --- a/src/App/MergeDocuments.h +++ b/src/App/MergeDocuments.h @@ -53,10 +53,10 @@ public: const std::map &getNameMap() const {return nameMap;} private: - bool guiup; - bool verbose; - zipios::ZipInputStream* stream; - App::Document* appdoc; + bool guiup{false}; + bool verbose{true}; + zipios::ZipInputStream* stream{nullptr}; + App::Document* appdoc{nullptr}; std::vector objects; std::map nameMap; using Connection = boost::signals2::connection; diff --git a/src/App/Metadata.cpp b/src/App/Metadata.cpp index 785413960f..5bf2dbb23b 100644 --- a/src/App/Metadata.cpp +++ b/src/App/Metadata.cpp @@ -1120,11 +1120,7 @@ bool App::Meta::Dependency::operator==(const Dependency& rhs) const && dependencyType == rhs.dependencyType; } -Meta::Version::Version() - : major(0), - minor(0), - patch(0) -{} +Meta::Version::Version() = default; Meta::Version::Version(int major, int minor, int patch, std::string suffix) : major(major), @@ -1134,9 +1130,6 @@ Meta::Version::Version(int major, int minor, int patch, std::string suffix) {} Meta::Version::Version(const std::string& versionString) - : major(0), - minor(0), - patch(0) { std::istringstream stream(versionString); char separator {'.'}; diff --git a/src/App/Metadata.h b/src/App/Metadata.h index a741c19b2c..ff30828ce4 100644 --- a/src/App/Metadata.h +++ b/src/App/Metadata.h @@ -107,8 +107,8 @@ struct AppExport Version { explicit Version(const std::string& semanticString); int major{}; - int minor; - int patch; + int minor{}; + int patch{}; std::string suffix; std::string str() const; diff --git a/src/App/ObjectIdentifier.cpp b/src/App/ObjectIdentifier.cpp index 962a972bb8..09ae446063 100644 --- a/src/App/ObjectIdentifier.cpp +++ b/src/App/ObjectIdentifier.cpp @@ -1968,15 +1968,7 @@ void ObjectIdentifier::resolveAmbiguity(ResolveResults &result) { */ ObjectIdentifier::ResolveResults::ResolveResults(const ObjectIdentifier &oi) - : propertyIndex(0) - , resolvedDocument(nullptr) - , resolvedDocumentName() - , resolvedDocumentObject(nullptr) - , resolvedDocumentObjectName() - , resolvedSubObject(nullptr) - , resolvedProperty(nullptr) - , propertyName() - , propertyType(PseudoNone) + : propertyType(PseudoNone) { oi.resolve(*this); } diff --git a/src/App/ObjectIdentifier.h b/src/App/ObjectIdentifier.h index 2b3c2c5498..2ad34d5d19 100644 --- a/src/App/ObjectIdentifier.h +++ b/src/App/ObjectIdentifier.h @@ -448,16 +448,16 @@ protected: explicit ResolveResults(const ObjectIdentifier & oi); - int propertyIndex; - App::Document * resolvedDocument; + int propertyIndex{0}; + App::Document * resolvedDocument{nullptr}; String resolvedDocumentName; - App::DocumentObject * resolvedDocumentObject; + App::DocumentObject * resolvedDocumentObject{nullptr}; String resolvedDocumentObjectName; String subObjectName; - App::DocumentObject * resolvedSubObject; - App::Property * resolvedProperty; + App::DocumentObject * resolvedSubObject{nullptr}; + App::Property * resolvedProperty{nullptr}; std::string propertyName; - int propertyType; + int propertyType{0}; std::bitset<32> flags; std::string resolveErrorString() const; diff --git a/src/App/Property.cpp b/src/App/Property.cpp index edc9b1502e..a8bb121723 100644 --- a/src/App/Property.cpp +++ b/src/App/Property.cpp @@ -54,7 +54,7 @@ static std::atomic _PropID; // Here is the implementation! Description should take place in the header file! Property::Property() - :father(nullptr), myName(nullptr), _id(++_PropID) + : _id(++_PropID) { } diff --git a/src/App/Property.h b/src/App/Property.h index a0eeefa027..8957956124 100644 --- a/src/App/Property.h +++ b/src/App/Property.h @@ -296,8 +296,8 @@ private: void syncType(unsigned type); private: - PropertyContainer *father; - const char *myName; + PropertyContainer *father{nullptr}; + const char *myName{nullptr}; int64_t _id; public: @@ -334,7 +334,7 @@ public: */ template class AtomicPropertyChangeInterface { protected: - AtomicPropertyChangeInterface() : signalCounter(0), hasChanged(false) { } + AtomicPropertyChangeInterface() = default; public: class AtomicPropertyChange { @@ -409,8 +409,8 @@ public: }; protected: - int signalCounter; /**< Counter for invoking transaction start/stop */ - bool hasChanged; + int signalCounter{0}; /**< Counter for invoking transaction start/stop */ + bool hasChanged{false}; }; diff --git a/src/App/PropertyExpressionEngine.cpp b/src/App/PropertyExpressionEngine.cpp index 41b12a1705..4c3dcc8554 100644 --- a/src/App/PropertyExpressionEngine.cpp +++ b/src/App/PropertyExpressionEngine.cpp @@ -87,8 +87,7 @@ TYPESYSTEM_SOURCE(App::PropertyExpressionEngine , App::PropertyExpressionContain */ PropertyExpressionEngine::PropertyExpressionEngine() - : running(false) - , validator(0) + : validator(0) { } diff --git a/src/App/PropertyExpressionEngine.h b/src/App/PropertyExpressionEngine.h index 9db884f1b6..094e1056ea 100644 --- a/src/App/PropertyExpressionEngine.h +++ b/src/App/PropertyExpressionEngine.h @@ -192,7 +192,7 @@ private: void slotChangedProperty(const App::DocumentObject &obj, const App::Property &prop); void updateHiddenReference(const std::string &key); - bool running; /**< Boolean used to avoid loops */ + bool running = false; /**< Boolean used to avoid loops */ bool restoring = false; ExpressionMap expressions; /**< Stored expressions */ diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index 6c9238e182..8b7325d3c3 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -380,12 +380,7 @@ TYPESYSTEM_SOURCE(App::PropertyLinkHidden , App::PropertyLink) // Construction/Destruction -PropertyLink::PropertyLink() -:_pcLink(nullptr) -{ - -} - +PropertyLink::PropertyLink() = default; PropertyLink::~PropertyLink() { @@ -882,11 +877,7 @@ TYPESYSTEM_SOURCE(App::PropertyLinkSubHidden, App::PropertyLinkSub) // Construction/Destruction -PropertyLinkSub::PropertyLinkSub() - : _pcLinkSub(nullptr), _restoreLabel(false) -{ - -} +PropertyLinkSub::PropertyLinkSub() = default; PropertyLinkSub::~PropertyLinkSub() { @@ -2525,7 +2516,7 @@ public: DocInfoMap::iterator myPos; std::string myPath; - App::Document *pcDoc; + App::Document *pcDoc{nullptr}; std::set links; static std::string getDocPath( @@ -2637,12 +2628,6 @@ public: return myPath.c_str(); } - DocInfo() - :pcDoc(nullptr) - {} - - ~DocInfo() = default; - void deinit() { FC_LOG("deinit " << (pcDoc?pcDoc->getName():filePath())); assert(links.empty()); diff --git a/src/App/PropertyLinks.h b/src/App/PropertyLinks.h index a305e94fda..7fc84bd22e 100644 --- a/src/App/PropertyLinks.h +++ b/src/App/PropertyLinks.h @@ -630,7 +630,7 @@ public: Property *CopyOnLinkReplace(const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const override; protected: - App::DocumentObject *_pcLink; + App::DocumentObject *_pcLink{nullptr}; }; /** The general Link Property with Child scope @@ -860,11 +860,11 @@ public: void setSyncSubObject(bool enable); protected: - App::DocumentObject* _pcLinkSub; + App::DocumentObject* _pcLinkSub{nullptr}; std::vector _cSubList; std::vector _ShadowSubList; std::vector _mapped; - bool _restoreLabel; + bool _restoreLabel{false}; }; /** The general Link Property with Child scope diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index 516a71a381..be966ccc6c 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -600,12 +600,7 @@ TYPESYSTEM_SOURCE(App::PropertyIntegerConstraint, App::PropertyInteger) // Construction/Destruction -PropertyIntegerConstraint::PropertyIntegerConstraint() - : _ConstStruct(nullptr) -{ - -} - +PropertyIntegerConstraint::PropertyIntegerConstraint() = default; PropertyIntegerConstraint::~PropertyIntegerConstraint() { @@ -1044,11 +1039,7 @@ TYPESYSTEM_SOURCE(App::PropertyFloatConstraint, App::PropertyFloat) // Construction/Destruction -PropertyFloatConstraint::PropertyFloatConstraint() - : _ConstStruct(nullptr) -{ - -} +PropertyFloatConstraint::PropertyFloatConstraint() = default; PropertyFloatConstraint::~PropertyFloatConstraint() { diff --git a/src/App/PropertyStandard.h b/src/App/PropertyStandard.h index 04206c3d74..d94017e3eb 100644 --- a/src/App/PropertyStandard.h +++ b/src/App/PropertyStandard.h @@ -310,7 +310,7 @@ public: void setPyObject(PyObject *) override; protected: - const Constraints* _ConstStruct; + const Constraints* _ConstStruct{nullptr}; }; /** Percent property @@ -613,7 +613,7 @@ public: void setPyObject(PyObject *) override; protected: - const Constraints* _ConstStruct; + const Constraints* _ConstStruct{nullptr}; }; diff --git a/src/App/PropertyUnits.h b/src/App/PropertyUnits.h index 74ccf9690f..c10782ebe0 100644 --- a/src/App/PropertyUnits.h +++ b/src/App/PropertyUnits.h @@ -84,7 +84,7 @@ class AppExport PropertyQuantityConstraint : public PropertyQuantity TYPESYSTEM_HEADER_WITH_OVERRIDE(); public: - PropertyQuantityConstraint():_ConstStruct(nullptr){} + PropertyQuantityConstraint() = default; ~PropertyQuantityConstraint() override = default; /// Constraint methods @@ -113,9 +113,8 @@ public: const char* getEditorName() const override; void setPyObject(PyObject *) override; - -protected: - const Constraints* _ConstStruct; +private: + const Constraints* _ConstStruct{nullptr}; }; // ------------------------------------------------------ diff --git a/src/App/Transactions.cpp b/src/App/Transactions.cpp index 132d452526..7061381de3 100644 --- a/src/App/Transactions.cpp +++ b/src/App/Transactions.cpp @@ -272,10 +272,7 @@ TYPESYSTEM_SOURCE_ABSTRACT(App::TransactionObject, Base::Persistence) * A constructor. * A more elaborate description of the constructor. */ -TransactionObject::TransactionObject() - : status(New) -{ -} +TransactionObject::TransactionObject() = default; /** * A destructor. diff --git a/src/App/Transactions.h b/src/App/Transactions.h index c0cb264135..93bc592c6e 100644 --- a/src/App/Transactions.h +++ b/src/App/Transactions.h @@ -128,7 +128,7 @@ public: friend class Transaction; protected: - enum Status {New,Del,Chn} status; + enum Status {New,Del,Chn} status{New}; struct PropData : DynamicProperty::PropData { Base::Type propertyType; diff --git a/src/App/VRMLObject.cpp b/src/App/VRMLObject.cpp index a7b04846ad..8b7aff85fc 100644 --- a/src/App/VRMLObject.cpp +++ b/src/App/VRMLObject.cpp @@ -37,7 +37,7 @@ using namespace App; PROPERTY_SOURCE(App::VRMLObject, App::GeoFeature) -VRMLObject::VRMLObject() : index(0) +VRMLObject::VRMLObject() { ADD_PROPERTY_TYPE(VrmlFile,(nullptr),"",Prop_None,"Included file with the VRML definition"); ADD_PROPERTY_TYPE(Urls,(""),"",static_cast(Prop_ReadOnly|Prop_Output|Prop_Transient), @@ -48,8 +48,6 @@ VRMLObject::VRMLObject() : index(0) Resources.setSize(0); } -VRMLObject::~VRMLObject() = default; - short VRMLObject::mustExecute() const { return 0; diff --git a/src/App/VRMLObject.h b/src/App/VRMLObject.h index 59ea40d9bf..064da42a96 100644 --- a/src/App/VRMLObject.h +++ b/src/App/VRMLObject.h @@ -38,7 +38,6 @@ class AppExport VRMLObject : public GeoFeature public: /// Constructor VRMLObject(); - ~VRMLObject() override; /// returns the type name of the ViewProvider const char* getViewProviderName() const override { @@ -54,9 +53,11 @@ public: void SaveDocFile (Base::Writer &writer) const override; void RestoreDocFile(Base::Reader &reader) override; + //NOLINTBEGIN PropertyFileIncluded VrmlFile; PropertyStringList Urls; PropertyStringList Resources; + //NOLINTEND protected: void onChanged(const App::Property*) override; @@ -66,7 +67,7 @@ protected: private: mutable std::string vrmlPath; - mutable int index; + mutable int index{0}; }; } //namespace App