From f80e8274555f0da157e0b8c1fcae975d66178ab7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 27 Nov 2020 17:57:44 +0100 Subject: Use "using" --- src/AlsaDriver.hpp | 15 +++++++-------- src/Patchage.cpp | 5 +++-- src/PatchageCanvas.cpp | 2 +- src/PatchageCanvas.hpp | 13 ++++++------- 4 files changed, 17 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/AlsaDriver.hpp b/src/AlsaDriver.hpp index a1de0e7..94dd101 100644 --- a/src/AlsaDriver.hpp +++ b/src/AlsaDriver.hpp @@ -1,5 +1,5 @@ /* This file is part of Patchage. - * Copyright 2007-2014 David Robillard + * Copyright 2007-2020 David Robillard * * Patchage is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free @@ -95,14 +95,13 @@ private: } }; - typedef std::set Ignored; - Ignored _ignored; + using Ignored = std::set; + using Modules = std::multimap; + using PortAddrs = std::map; - typedef std::multimap Modules; - Modules _modules; - - typedef std::map PortAddrs; - PortAddrs _port_addrs; + Ignored _ignored; + Modules _modules; + PortAddrs _port_addrs; bool ignore(const snd_seq_addr_t& addr, bool add = true); }; diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 022eace..997365d 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -1000,8 +1000,9 @@ Patchage::on_export_image() dialog.set_default_response(Gtk::RESPONSE_OK); dialog.set_transient_for(*_main_win); - typedef std::map Types; - Types types; + using Types = std::map; + + Types types; types["*.dot"] = "Graphviz DOT"; types["*.pdf"] = "Portable Document Format"; types["*.ps"] = "PostScript"; diff --git a/src/PatchageCanvas.cpp b/src/PatchageCanvas.cpp index 36a815e..1dfe9e0 100644 --- a/src/PatchageCanvas.cpp +++ b/src/PatchageCanvas.cpp @@ -134,7 +134,7 @@ PatchageCanvas::remove_port(const PortID& id) struct RemovePortsData { - typedef bool (*Predicate)(const PatchagePort*); + using Predicate = bool (*)(const PatchagePort*); RemovePortsData(Predicate p) : pred(p) diff --git a/src/PatchageCanvas.hpp b/src/PatchageCanvas.hpp index 35d0abb..0b200f4 100644 --- a/src/PatchageCanvas.hpp +++ b/src/PatchageCanvas.hpp @@ -1,5 +1,5 @@ /* This file is part of Patchage. - * Copyright 2007-2014 David Robillard + * Copyright 2007-2020 David Robillard * * Patchage is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free @@ -71,16 +71,15 @@ public: void clear(); private: - Patchage* _app; + using PortIndex = std::map; + using ModuleIndex = std::multimap; bool on_event(GdkEvent* ev); bool on_connection_event(Ganv::Edge* c, GdkEvent* ev); - typedef std::map PortIndex; - PortIndex _port_index; - - typedef std::multimap ModuleIndex; - ModuleIndex _module_index; + Patchage* _app; + PortIndex _port_index; + ModuleIndex _module_index; }; #endif // PATCHAGE_PATCHAGECANVAS_HPP -- cgit v1.2.1