summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-15 18:36:39 +0100
committerDavid Robillard <d@drobilla.net>2020-12-15 19:32:03 +0100
commitde277295f7e879eba882b158015ba99486b142a5 (patch)
tree1b1cf5bed57e8231e03ce970997c357e69ca8765
parent7c84fcb0e6bcddc043b7b92dd9d854167844948f (diff)
downloadganv-de277295f7e879eba882b158015ba99486b142a5.tar.gz
ganv-de277295f7e879eba882b158015ba99486b142a5.tar.bz2
ganv-de277295f7e879eba882b158015ba99486b142a5.zip
Use "using"
-rw-r--r--.clang-tidy1
-rw-r--r--ganv/Module.hpp4
-rw-r--r--src/Canvas.cpp18
3 files changed, 11 insertions, 12 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 36cfbc7..d1bb0c4 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -62,7 +62,6 @@ Checks: >
-modernize-raw-string-literal,
-modernize-use-default-member-init,
-modernize-use-trailing-return-type,
- -modernize-use-using,
-performance-faster-string-find,
-readability-const-return-type,
-readability-container-size-empty,
diff --git a/ganv/Module.hpp b/ganv/Module.hpp
index 8d13700..343b815 100644
--- a/ganv/Module.hpp
+++ b/ganv/Module.hpp
@@ -98,8 +98,8 @@ public:
guint _index;
};
- typedef iterator_base<Port, GanvPort> iterator;
- typedef iterator_base<const Port, const GanvPort> const_iterator;
+ using iterator = iterator_base<Port, GanvPort>;
+ using const_iterator = iterator_base<const Port, const GanvPort>;
iterator begin() { return iterator(gobj(), 0); }
iterator end() { return iterator(gobj(), num_ports()); }
diff --git a/src/Canvas.cpp b/src/Canvas.cpp
index fdd7358..6239bed 100644
--- a/src/Canvas.cpp
+++ b/src/Canvas.cpp
@@ -103,12 +103,12 @@ static const double GANV_CANVAS_PAD = 8.0;
struct GanvCanvasImpl;
-typedef struct {
+struct IRect {
int x;
int y;
int width;
int height;
-} IRect;
+};
extern "C" {
static void add_idle(GanvCanvas* canvas);
@@ -144,7 +144,7 @@ static guint signal_disconnect;
static GEnumValue dir_values[3];
-typedef std::set<GanvNode*> Items;
+using Items = std::set<GanvNode*>;
#define FOREACH_ITEM(items, i) \
for (Items::const_iterator i = items.begin(); i != items.end(); ++i)
@@ -334,10 +334,10 @@ struct GanvCanvasImpl {
GVNodes layout_dot(const std::string& filename);
#endif
- typedef std::set<GanvEdge*, TailHeadOrder> Edges;
- typedef std::set<GanvEdge*, HeadTailOrder> DstEdges;
- typedef std::set<GanvEdge*> SelectedEdges;
- typedef std::set<GanvPort*> SelectedPorts;
+ using Edges = std::set<GanvEdge*, TailHeadOrder>;
+ using DstEdges = std::set<GanvEdge*, HeadTailOrder>;
+ using SelectedEdges = std::set<GanvEdge*>;
+ using SelectedPorts = std::set<GanvPort*>;
Edges::const_iterator first_edge_from(const GanvNode* src);
DstEdges::const_iterator first_edge_to(const GanvNode* dst);
@@ -505,11 +505,11 @@ struct GanvCanvasImpl {
#endif
};
-typedef struct {
+struct GanvEdgeKey {
GanvItem item;
GanvEdgePrivate* impl;
GanvEdgePrivate impl_data;
-} GanvEdgeKey;
+};
static void
make_edge_search_key(GanvEdgeKey* key,