From c3279b82b40d434a35586cfb2bfb863b4d366130 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 29 Aug 2022 23:21:15 +0200 Subject: [PATCH] Mod: modernize C++: replace 'typedef' with 'using' --- src/Mod/Sandbox/App/DocumentProtectorPy.h | 2 +- src/Mod/Sandbox/Gui/Workbench.h | 4 ++-- src/Mod/Spreadsheet/App/Sheet.cpp | 10 +++++----- src/Mod/Spreadsheet/App/Sheet.h | 4 ++-- src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.h | 2 +- src/Mod/Surface/Gui/TaskFilling.h | 2 +- src/Mod/Surface/Gui/TaskSections.h | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Mod/Sandbox/App/DocumentProtectorPy.h b/src/Mod/Sandbox/App/DocumentProtectorPy.h index 368057e53c..8e943508d8 100644 --- a/src/Mod/Sandbox/App/DocumentProtectorPy.h +++ b/src/Mod/Sandbox/App/DocumentProtectorPy.h @@ -51,7 +51,7 @@ public: Py::Object recompute(const Py::Tuple&); private: - typedef PyObject* (*method_varargs_handler)(PyObject *_self, PyObject *_args); + using method_varargs_handler = PyObject* (*)(PyObject *_self, PyObject *_args); static method_varargs_handler pycxx_handler; static PyObject *method_varargs_ext_handler(PyObject *_self, PyObject *_args); diff --git a/src/Mod/Sandbox/Gui/Workbench.h b/src/Mod/Sandbox/Gui/Workbench.h index cdc20d3708..0e055cb7e6 100644 --- a/src/Mod/Sandbox/Gui/Workbench.h +++ b/src/Mod/Sandbox/Gui/Workbench.h @@ -47,7 +47,7 @@ protected: }; class SoWidgetShape : public SoShape { - typedef SoShape inherited; + using inherited = SoShape; SO_NODE_HEADER(SoWidgetShape); @@ -63,7 +63,7 @@ protected: //virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action); //virtual void rayPick (SoRayPickAction *action); virtual void generatePrimitives(SoAction *action); - void getQuad(SoState * state, SbVec3f & v0, SbVec3f & v1, SbVec3f & v2, SbVec3f & v3); + void getQuad(SoState * state, SbVec3f & v0, SbVec3f & v1, SbVec3f & v2, SbVec3f & v3); private: virtual ~SoWidgetShape(){}; diff --git a/src/Mod/Spreadsheet/App/Sheet.cpp b/src/Mod/Spreadsheet/App/Sheet.cpp index d7016432c7..51e55c235e 100644 --- a/src/Mod/Spreadsheet/App/Sheet.cpp +++ b/src/Mod/Spreadsheet/App/Sheet.cpp @@ -63,7 +63,7 @@ using namespace Spreadsheet; PROPERTY_SOURCE(Spreadsheet::Sheet, App::DocumentObject) -typedef boost::adjacency_list < +using DependencyList = boost::adjacency_list < boost::vecS, // class OutEdgeListS : a Sequence or an AssociativeContainer boost::vecS, // class VertexListS : a Sequence or a RandomAccessContainer boost::directedS, // class DirectedS : This is a directed graph @@ -71,10 +71,10 @@ boost::no_property, // class VertexProperty: boost::no_property, // class EdgeProperty: boost::no_property, // class GraphProperty: boost::listS // class EdgeListS: -> DependencyList; -typedef boost::graph_traits Traits; -typedef Traits::vertex_descriptor Vertex; -typedef Traits::edge_descriptor Edge; +>; +using Traits = boost::graph_traits; +using Vertex = Traits::vertex_descriptor; +using Edge = Traits::edge_descriptor; /** * Construct a new Sheet object. diff --git a/src/Mod/Spreadsheet/App/Sheet.h b/src/Mod/Spreadsheet/App/Sheet.h index a13e64f8f8..f758141a43 100644 --- a/src/Mod/Spreadsheet/App/Sheet.h +++ b/src/Mod/Spreadsheet/App/Sheet.h @@ -276,7 +276,7 @@ protected: PropertyRowHeights rowHeights; /* Document observers to track changes to external properties */ - typedef std::map ObserverMap; + using ObserverMap = std::map; ObserverMap observers; int currentRow = -1; @@ -292,7 +292,7 @@ protected: friend class PropertySheet; }; -typedef App::FeaturePythonT SheetPython; +using SheetPython = App::FeaturePythonT; } //namespace Spreadsheet diff --git a/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.h b/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.h index 85f5ab2213..2f14ecebd8 100644 --- a/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.h +++ b/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.h @@ -80,7 +80,7 @@ private: QPointer view; }; -typedef Gui::ViewProviderPythonFeatureT ViewProviderSheetPython; +using ViewProviderSheetPython = Gui::ViewProviderPythonFeatureT; } //namespace Spreadsheet diff --git a/src/Mod/Surface/Gui/TaskFilling.h b/src/Mod/Surface/Gui/TaskFilling.h index 9ac5a02530..d4abb9e8c8 100644 --- a/src/Mod/Surface/Gui/TaskFilling.h +++ b/src/Mod/Surface/Gui/TaskFilling.h @@ -43,7 +43,7 @@ class Ui_TaskFilling; class ViewProviderFilling : public PartGui::ViewProviderSpline { PROPERTY_HEADER_WITH_OVERRIDE(SurfaceGui::ViewProviderFilling); - typedef std::vector References; + using References = std::vector; public: enum ShapeType {Vertex, Edge, Face}; diff --git a/src/Mod/Surface/Gui/TaskSections.h b/src/Mod/Surface/Gui/TaskSections.h index afb97bbca6..629dfc43e4 100644 --- a/src/Mod/Surface/Gui/TaskSections.h +++ b/src/Mod/Surface/Gui/TaskSections.h @@ -42,7 +42,7 @@ class Ui_Sections; class ViewProviderSections : public PartGui::ViewProviderSpline { PROPERTY_HEADER_WITH_OVERRIDE(SurfaceGui::ViewProviderSections); - typedef std::vector References; + using References = std::vector; public: enum ShapeType {Vertex, Edge, Face};