From 138629633f97d53d06b254c2ee383629cebe68ac Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 29 Aug 2022 23:13:16 +0200 Subject: [PATCH] Sketcher: modernize C++: replace 'typedef' with 'using' --- src/Mod/Sketcher/App/Analyse.h | 4 ++-- src/Mod/Sketcher/App/PropertyConstraintList.h | 2 +- src/Mod/Sketcher/App/SketchObject.h | 2 +- src/Mod/Sketcher/App/planegcs/GCS.cpp | 6 +++--- src/Mod/Sketcher/App/planegcs/Geo.h | 2 +- src/Mod/Sketcher/App/planegcs/Util.h | 16 ++++++++-------- src/Mod/Sketcher/Gui/CommandSketcherTools.cpp | 2 +- src/Mod/Sketcher/Gui/SoDatumLabel.h | 2 +- src/Mod/Sketcher/Gui/SoZoomTranslation.h | 4 ++-- src/Mod/Sketcher/Gui/TaskDlgEditSketch.h | 2 +- src/Mod/Sketcher/Gui/TaskSketcherConstraints.h | 2 +- src/Mod/Sketcher/Gui/TaskSketcherElements.h | 2 +- src/Mod/Sketcher/Gui/TaskSketcherMessages.h | 2 +- src/Mod/Sketcher/Gui/ViewProviderPython.h | 4 ++-- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Mod/Sketcher/App/Analyse.h b/src/Mod/Sketcher/App/Analyse.h index 97f7c498a6..5398ce5a6d 100644 --- a/src/Mod/Sketcher/App/Analyse.h +++ b/src/Mod/Sketcher/App/Analyse.h @@ -41,8 +41,8 @@ struct ConstraintIds { struct Constraint_Equal { - typedef ConstraintIds argument_type; - typedef bool result_type; + using argument_type = ConstraintIds; + using result_type = bool; struct Sketcher::ConstraintIds c; explicit Constraint_Equal(const ConstraintIds& c) : c(c) { diff --git a/src/Mod/Sketcher/App/PropertyConstraintList.h b/src/Mod/Sketcher/App/PropertyConstraintList.h index d95caf80c8..ee80911d90 100644 --- a/src/Mod/Sketcher/App/PropertyConstraintList.h +++ b/src/Mod/Sketcher/App/PropertyConstraintList.h @@ -138,7 +138,7 @@ public: bool getPyPathValue(const App::ObjectIdentifier &path, Py::Object &res) const override; - typedef std::pair ConstraintInfo ; + using ConstraintInfo = std::pair ; boost::signals2::signal &)> signalConstraintsRenamed; boost::signals2::signal &)> signalConstraintsRemoved; diff --git a/src/Mod/Sketcher/App/SketchObject.h b/src/Mod/Sketcher/App/SketchObject.h index ae802807ee..6d79af4269 100644 --- a/src/Mod/Sketcher/App/SketchObject.h +++ b/src/Mod/Sketcher/App/SketchObject.h @@ -725,7 +725,7 @@ const GeometryT * SketchObject::getGeometry(int GeoId) const return nullptr; } -typedef App::FeaturePythonT SketchObjectPython; +using SketchObjectPython = App::FeaturePythonT; } //namespace Sketcher diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index 9ff9d4f6a8..638189e90b 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -101,12 +101,12 @@ #include #include -typedef Eigen::FullPivHouseholderQR::IntDiagSizeVectorType MatrixIndexType; +using MatrixIndexType = Eigen::FullPivHouseholderQR::IntDiagSizeVectorType; #ifndef EIGEN_STOCK_FULLPIVLU_COMPUTE namespace Eigen { - typedef Matrix MatrixdType; + using MatrixdType = Matrix; template<> FullPivLU& FullPivLU::compute(const MatrixdType& matrix) @@ -429,7 +429,7 @@ void SolverReportingManager::LogMatrix(const std::string str, MatrixIndexType ma #endif -typedef boost::adjacency_list Graph; +using Graph = boost::adjacency_list ; /////////////////////////////////////// // Solver diff --git a/src/Mod/Sketcher/App/planegcs/Geo.h b/src/Mod/Sketcher/App/planegcs/Geo.h index 8324aa76be..f22bce938a 100644 --- a/src/Mod/Sketcher/App/planegcs/Geo.h +++ b/src/Mod/Sketcher/App/planegcs/Geo.h @@ -37,7 +37,7 @@ namespace GCS double *y; }; - typedef std::vector VEC_P; + using VEC_P = std::vector; ///Class DeriVector2 holds a vector value and its derivative on the ///parameter that the derivatives are being calculated for now. x,y is the diff --git a/src/Mod/Sketcher/App/planegcs/Util.h b/src/Mod/Sketcher/App/planegcs/Util.h index 421b303bd0..3b4a5b9366 100644 --- a/src/Mod/Sketcher/App/planegcs/Util.h +++ b/src/Mod/Sketcher/App/planegcs/Util.h @@ -29,14 +29,14 @@ namespace GCS { - typedef std::vector VEC_pD; - typedef std::vector VEC_D; - typedef std::vector VEC_I; - typedef std::map MAP_pD_pD; - typedef std::map MAP_pD_D; - typedef std::map MAP_pD_I; - typedef std::set SET_pD; - typedef std::set SET_I; + using VEC_pD = std::vector; + using VEC_D = std::vector; + using VEC_I = std::vector; + using MAP_pD_pD = std::map; + using MAP_pD_D = std::map; + using MAP_pD_I = std::map; + using SET_pD = std::set; + using SET_I = std::set; #ifndef M_PI #define M_PI 3.14159265358979323846 diff --git a/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp b/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp index be5131ec2c..151f1f7628 100644 --- a/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp +++ b/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp @@ -872,7 +872,7 @@ void CmdSketcherSymmetry::activated(int iMsg) int LastGeoId = 0; Sketcher::PointPos LastPointPos = Sketcher::PointPos::none; const Part::Geometry *LastGeo; - typedef enum { invalid = -1, line = 0, point = 1 } GeoType; + using GeoType = enum { invalid = -1, line = 0, point = 1 }; GeoType lastgeotype = invalid; diff --git a/src/Mod/Sketcher/Gui/SoDatumLabel.h b/src/Mod/Sketcher/Gui/SoDatumLabel.h index d283780e70..be80cea548 100644 --- a/src/Mod/Sketcher/Gui/SoDatumLabel.h +++ b/src/Mod/Sketcher/Gui/SoDatumLabel.h @@ -42,7 +42,7 @@ namespace SketcherGui { class SketcherGuiExport SoDatumLabel : public SoShape { - typedef SoShape inherited; + using inherited = SoShape; SO_NODE_HEADER(SoDatumLabel); diff --git a/src/Mod/Sketcher/Gui/SoZoomTranslation.h b/src/Mod/Sketcher/Gui/SoZoomTranslation.h index 94b81a7e00..3362057a45 100644 --- a/src/Mod/Sketcher/Gui/SoZoomTranslation.h +++ b/src/Mod/Sketcher/Gui/SoZoomTranslation.h @@ -31,7 +31,7 @@ namespace SketcherGui { class SketcherGuiExport SoZoomTranslation : public SoTranslation { - typedef SoTranslation inherited; + using inherited = SoTranslation; SO_NODE_HEADER(SoZoomTranslation); @@ -41,7 +41,7 @@ public: SoSFVec3f abPos; protected: - ~SoZoomTranslation() override {}; + ~SoZoomTranslation() override {} void doAction(SoAction * action) override; void getPrimitiveCount(SoGetPrimitiveCountAction * action) override; void getMatrix(SoGetMatrixAction * action) override; diff --git a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h index 73a057f1d7..4946a410fb 100644 --- a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h +++ b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h @@ -34,7 +34,7 @@ #include "TaskSketcherSolverAdvanced.h" #include -typedef boost::signals2::connection Connection; +using Connection = boost::signals2::connection; namespace SketcherGui { diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h index 5748ea31aa..1947be8a68 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h @@ -127,7 +127,7 @@ public Q_SLOTS: protected: void changeEvent(QEvent *e) override; ViewProviderSketch *sketchView; - typedef boost::signals2::connection Connection; + using Connection = boost::signals2::connection; Connection connectionConstraintsChanged; private: diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.h b/src/Mod/Sketcher/Gui/TaskSketcherElements.h index ba5d5aef1a..c423a953ba 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherElements.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.h @@ -132,7 +132,7 @@ protected: void changeEvent(QEvent *e) override; void leaveEvent ( QEvent * event ) override; ViewProviderSketch *sketchView; - typedef boost::signals2::connection Connection; + using Connection = boost::signals2::connection; Connection connectionElementsChanged; private: diff --git a/src/Mod/Sketcher/Gui/TaskSketcherMessages.h b/src/Mod/Sketcher/Gui/TaskSketcherMessages.h index b211daf83d..79208c22b2 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherMessages.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherMessages.h @@ -29,7 +29,7 @@ #include class Ui_TaskSketcherMessages; -typedef boost::signals2::connection Connection; +using Connection = boost::signals2::connection; namespace App { class Property; diff --git a/src/Mod/Sketcher/Gui/ViewProviderPython.h b/src/Mod/Sketcher/Gui/ViewProviderPython.h index 32ace07776..65d3ab6e66 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderPython.h +++ b/src/Mod/Sketcher/Gui/ViewProviderPython.h @@ -45,8 +45,8 @@ protected: std::map propView; }; -typedef Gui::ViewProviderPythonFeatureT ViewProviderPython; -typedef Gui::ViewProviderPythonFeatureT ViewProviderCustomPython; +using ViewProviderPython = Gui::ViewProviderPythonFeatureT; +using ViewProviderCustomPython = Gui::ViewProviderPythonFeatureT; } // namespace SketcherGui