From ecad88d2128f920f5e11cc3ff443d62b225c79d3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Dec 2019 17:12:50 +0100 Subject: Cleanup: Use "using" instead of "typedef" where appropriate --- ingen/ClashAvoider.hpp | 4 ++-- ingen/Configuration.hpp | 6 +++--- ingen/FilePath.hpp | 6 +++--- ingen/LV2Features.hpp | 4 ++-- ingen/Log.hpp | 2 +- ingen/Node.hpp | 4 ++-- ingen/Store.hpp | 8 +++----- ingen/Tee.hpp | 2 +- ingen/client/BlockModel.hpp | 2 +- ingen/client/ClientStore.hpp | 3 ++- ingen/client/PluginModel.hpp | 4 ++-- src/ClashAvoider.cpp | 2 +- src/Library.cpp | 2 +- src/Parser.cpp | 6 +++--- src/Resource.cpp | 4 ++-- src/World.cpp | 10 +++++----- src/client/ClientStore.cpp | 2 +- src/gui/App.hpp | 2 +- src/gui/GraphBox.cpp | 2 +- src/gui/GraphCanvas.cpp | 2 +- src/gui/GraphCanvas.hpp | 4 ++-- src/gui/LoadPluginWindow.hpp | 2 +- src/gui/PluginMenu.cpp | 2 +- src/gui/PluginMenu.hpp | 4 ++-- src/gui/PropertiesWindow.cpp | 2 +- src/gui/PropertiesWindow.hpp | 2 +- src/gui/RDFS.cpp | 4 ++-- src/gui/RDFS.hpp | 4 ++-- src/gui/ThreadedLoader.hpp | 2 +- src/gui/WindowFactory.hpp | 2 +- src/server/BlockFactory.cpp | 2 +- src/server/BlockImpl.hpp | 2 +- src/server/Broadcaster.hpp | 2 +- src/server/BufferRef.hpp | 2 +- src/server/CompiledGraph.hpp | 2 +- src/server/ControlBindings.hpp | 6 +++--- src/server/DirectDriver.hpp | 5 ++--- src/server/GraphImpl.cpp | 2 +- src/server/GraphImpl.hpp | 10 ++++++---- src/server/InputPort.hpp | 6 +++--- src/server/JackDriver.cpp | 2 +- src/server/JackDriver.hpp | 5 ++--- src/server/LV2Block.hpp | 10 +++++----- src/server/PluginImpl.hpp | 4 ++-- src/server/PortAudioDriver.hpp | 5 ++--- src/server/PortImpl.hpp | 2 +- src/server/PreProcessContext.hpp | 2 +- src/server/Task.hpp | 2 +- src/server/events/CreateBlock.cpp | 2 +- src/server/events/CreateGraph.cpp | 2 +- src/server/events/CreatePort.cpp | 6 +++--- src/server/events/Delta.hpp | 2 +- src/server/events/DisconnectAll.hpp | 2 +- src/server/events/Mark.hpp | 2 +- src/server/ingen_lv2.cpp | 4 ++-- src/server/internals/Note.hpp | 2 +- src/server/types.hpp | 8 ++++---- 57 files changed, 102 insertions(+), 104 deletions(-) diff --git a/ingen/ClashAvoider.hpp b/ingen/ClashAvoider.hpp index d8fce196..60bb6b48 100644 --- a/ingen/ClashAvoider.hpp +++ b/ingen/ClashAvoider.hpp @@ -53,8 +53,8 @@ public: std::string name); private: - typedef std::map Offsets; - typedef std::map SymbolMap; + using Offsets = std::map; + using SymbolMap = std::map; const Store& _store; Offsets _offsets; diff --git a/ingen/Configuration.hpp b/ingen/Configuration.hpp index 5a1085fe..6c0343b1 100644 --- a/ingen/Configuration.hpp +++ b/ingen/Configuration.hpp @@ -137,9 +137,9 @@ private: } }; - typedef std::map Options; - typedef std::map ShortNames; - typedef std::map Keys; + using Options = std::map; + using ShortNames = std::map; + using Keys = std::map; std::string variable_string(LV2_URID type) const; diff --git a/ingen/FilePath.hpp b/ingen/FilePath.hpp index 376411ec..e4f22b88 100644 --- a/ingen/FilePath.hpp +++ b/ingen/FilePath.hpp @@ -41,14 +41,14 @@ class INGEN_API FilePath { public: #ifdef USE_WINDOWS_FILE_PATHS - typedef wchar_t value_type; + using value_type = wchar_t; static constexpr value_type preferred_separator = L'\\'; #else - typedef char value_type; + using value_type = char; static constexpr value_type preferred_separator = '/'; #endif - typedef std::basic_string string_type; + using string_type = std::basic_string; FilePath() = default; FilePath(const FilePath&) = default; diff --git a/ingen/LV2Features.hpp b/ingen/LV2Features.hpp index 9508bd82..e2ce600f 100644 --- a/ingen/LV2Features.hpp +++ b/ingen/LV2Features.hpp @@ -65,7 +65,7 @@ protected: class FeatureArray : public Raul::Noncopyable { public: - typedef std::vector< SPtr > FeatureVector; + using FeatureVector = std::vector>; explicit FeatureArray(FeatureVector& features); @@ -84,7 +84,7 @@ protected: SPtr lv2_features(World& world, Node* node) const; private: - typedef std::vector< SPtr > Features; + using Features = std::vector>; Features _features; }; diff --git a/ingen/Log.hpp b/ingen/Log.hpp index 3cc7de20..de27404b 100644 --- a/ingen/Log.hpp +++ b/ingen/Log.hpp @@ -39,7 +39,7 @@ class World; class INGEN_API Log { public: - typedef std::function Sink; + using Sink = std::function; Log(LV2_Log_Log* log, URIs& uris); diff --git a/ingen/Node.hpp b/ingen/Node.hpp index 038627b0..24e45f2a 100644 --- a/ingen/Node.hpp +++ b/ingen/Node.hpp @@ -61,8 +61,8 @@ public: PORT }; - typedef std::pair ArcsKey; - typedef std::map< ArcsKey, SPtr > Arcs; + using ArcsKey = std::pair; + using Arcs = std::map>; // Graphs only Arcs& arcs() { return _arcs; } diff --git a/ingen/Store.hpp b/ingen/Store.hpp index cf412ce6..3c92dcc4 100644 --- a/ingen/Store.hpp +++ b/ingen/Store.hpp @@ -47,9 +47,9 @@ public: return (i == end()) ? nullptr : i->second.get(); } - typedef std::pair const_range; - - typedef std::map< Raul::Path, SPtr > Objects; + using const_range = std::pair; + using Objects = std::map>; + using Mutex = std::recursive_mutex; iterator find_descendants_end(Store::iterator parent); const_iterator find_descendants_end(Store::const_iterator parent) const; @@ -75,8 +75,6 @@ public: const Raul::Symbol& symbol, bool allow_zero=true) const; - typedef std::recursive_mutex Mutex; - Mutex& mutex() { return _mutex; } private: diff --git a/ingen/Tee.hpp b/ingen/Tee.hpp index 153a3d4b..bf3fd335 100644 --- a/ingen/Tee.hpp +++ b/ingen/Tee.hpp @@ -32,7 +32,7 @@ namespace ingen { class Tee : public Interface { public: - typedef std::vector> Sinks; + using Sinks = std::vector>; explicit Tee(Sinks sinks) : _sinks(std::move(sinks)) {} diff --git a/ingen/client/BlockModel.hpp b/ingen/client/BlockModel.hpp index 6b9881c5..f6aa731a 100644 --- a/ingen/client/BlockModel.hpp +++ b/ingen/client/BlockModel.hpp @@ -50,7 +50,7 @@ public: GraphType graph_type() const override { return Node::GraphType::BLOCK; } - typedef std::vector< SPtr > Ports; + using Ports = std::vector>; SPtr get_port(const Raul::Symbol& symbol) const; SPtr get_port(uint32_t index) const; diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp index 5cb097e8..7d83e9f6 100644 --- a/ingen/client/ClientStore.hpp +++ b/ingen/client/ClientStore.hpp @@ -71,7 +71,8 @@ public: void clear(); - typedef std::map< const URI, SPtr > Plugins; + using Plugins = std::map>; + SPtr plugins() const { return _plugins; } SPtr plugins() { return _plugins; } void set_plugins(SPtr p) { _plugins = p; } diff --git a/ingen/client/PluginModel.hpp b/ingen/client/PluginModel.hpp index 468816aa..5f43b3c4 100644 --- a/ingen/client/PluginModel.hpp +++ b/ingen/client/PluginModel.hpp @@ -67,10 +67,10 @@ public: std::string human_name() const; std::string port_human_name(uint32_t i) const; - typedef std::map ScalePoints; + using ScalePoints = std::map; ScalePoints port_scale_points(uint32_t i) const; - typedef std::map Presets; + using Presets = std::map; const Presets& presets() const { return _presets; } static LilvWorld* lilv_world() { return _lilv_world; } diff --git a/src/ClashAvoider.cpp b/src/ClashAvoider.cpp index 5ae1f004..4dc8c64d 100644 --- a/src/ClashAvoider.cpp +++ b/src/ClashAvoider.cpp @@ -70,7 +70,7 @@ ClashAvoider::map_path(const Raul::Path& in) if (m != _symbol_map.end()) { return m->second; } else { - typedef std::pair InsertRecord; + using InsertRecord = std::pair; // See if parent is mapped Raul::Path parent = in.parent(); diff --git a/src/Library.cpp b/src/Library.cpp index 48002ef0..44deea90 100644 --- a/src/Library.cpp +++ b/src/Library.cpp @@ -41,7 +41,7 @@ Library::get_function(const char* name) #ifdef _WIN32 return (VoidFuncPtr)GetProcAddress((HMODULE)_lib, name); #else - typedef VoidFuncPtr (*VoidFuncGetter)(void*, const char*); + using VoidFuncGetter = VoidFuncPtr (*)(void*, const char*); VoidFuncGetter dlfunc = (VoidFuncGetter)dlsym; return dlfunc(_lib, name); #endif diff --git a/src/Parser.cpp b/src/Parser.cpp index ff416106..e8599cf5 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -147,7 +147,7 @@ get_properties(ingen::World& world, return props; } -typedef std::pair PortRecord; +using PortRecord = std::pair; static boost::optional get_port(ingen::World& world, @@ -354,7 +354,7 @@ parse_graph(ingen::World& world, target.put(path_to_uri(graph_path), props, ctx); // For each port on this graph - typedef std::map PortRecords; + using PortRecords = std::map; PortRecords ports; for (Sord::Iter p = model.find(graph, lv2_port, nil); !p.end(); ++p) { Sord::Node port = p.get_object(); @@ -532,7 +532,7 @@ parse(ingen::World& world, } // Get all subjects and their types (?subject a ?type) - typedef std::map< Sord::Node, std::set > Subjects; + using Subjects = std::map< Sord::Node, std::set >; Subjects subjects; for (Sord::Iter i = model.find(subject, rdf_type, nil); !i.end(); ++i) { const Sord::Node& subject = i.get_subject(); diff --git a/src/Resource.cpp b/src/Resource.cpp index 40f5fb4f..2601c2e3 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -29,7 +29,7 @@ bool Resource::add_property(const URI& uri, const Atom& value, Graph ctx) { // Ignore duplicate statements - typedef Properties::const_iterator iterator; + using iterator = Properties::const_iterator; const std::pair range = _properties.equal_range(uri); for (iterator i = range.first; i != range.second && i != _properties.end(); ++i) { if (i->second == value && i->second.context() == ctx) { @@ -150,7 +150,7 @@ Resource::type(const URIs& uris, bool& port, bool& is_output) { - typedef Properties::const_iterator iterator; + using iterator = Properties::const_iterator; const std::pair types_range = properties.equal_range(uris.rdf_type); graph = block = port = is_output = false; diff --git a/src/World.cpp b/src/World.cpp index 72b7b96b..1ba72259 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -141,7 +141,7 @@ public: } // Delete module objects but save pointers to libraries - typedef std::list> Libs; + using Libs = std::list>; Libs libs; for (auto& m : modules) { libs.emplace_back(std::move(m.second->library)); @@ -162,14 +162,14 @@ public: // Module libraries go out of scope and close here } - typedef std::map Modules; + using Modules = std::map; Modules modules; - typedef std::map InterfaceFactories; + using InterfaceFactories = std::map; InterfaceFactories interface_factories; - typedef bool (*ScriptRunner)(World& world, const char* filename); - typedef std::map ScriptRunners; + using ScriptRunner = bool (*)(World& world, const char* filename); + using ScriptRunners = std::map; ScriptRunners script_runners; using LilvWorldUPtr = std::unique_ptr; diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 6aadcf2a..a42efd16 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -240,7 +240,7 @@ ClientStore::message(const Message& msg) void ClientStore::operator()(const Put& msg) { - typedef Properties::const_iterator Iterator; + using Iterator = Properties::const_iterator; const auto& uri = msg.uri; const auto& properties = msg.properties; diff --git a/src/gui/App.hpp b/src/gui/App.hpp index 47352f50..13c46414 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -182,7 +182,7 @@ protected: float _max_run_load; std::string _status_text; - typedef std::unordered_map ActivityPorts; + using ActivityPorts = std::unordered_map; ActivityPorts _activity_ports; bool _enable_signal; diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp index d248d0a7..5ce54d99 100644 --- a/src/gui/GraphBox.cpp +++ b/src/gui/GraphBox.cpp @@ -664,7 +664,7 @@ GraphBox::event_export_image() dialog.set_transient_for(*_window); } - typedef std::map Types; + using Types = std::map; Types types; types["*.dot"] = "Graphviz DOT"; types["*.pdf"] = "Portable Document Format"; diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp index d10d569b..0c33072f 100644 --- a/src/gui/GraphCanvas.cpp +++ b/src/gui/GraphCanvas.cpp @@ -659,7 +659,7 @@ GraphCanvas::copy_selection() void GraphCanvas::paste() { - typedef Properties::const_iterator PropIter; + using PropIter = Properties::const_iterator; std::lock_guard lock(_app.world().rdf_mutex()); diff --git a/src/gui/GraphCanvas.hpp b/src/gui/GraphCanvas.hpp index 613c03da..9047a373 100644 --- a/src/gui/GraphCanvas.hpp +++ b/src/gui/GraphCanvas.hpp @@ -102,7 +102,7 @@ private: void auto_menu_position(int& x, int& y, bool& push_in); - typedef std::multimap LV2Children; + using LV2Children = std::multimap; Properties get_initial_data(Resource::Graph ctx=Resource::Graph::DEFAULT); @@ -117,7 +117,7 @@ private: App& _app; SPtr _graph; - typedef std::map, Ganv::Module*> Views; + using Views = std::map, Ganv::Module*>; Views _views; int _auto_position_count; diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp index ddd0b427..31843dde 100644 --- a/src/gui/LoadPluginWindow.hpp +++ b/src/gui/LoadPluginWindow.hpp @@ -130,7 +130,7 @@ private: SPtr _graph; - typedef std::map Rows; + using Rows = std::map; Rows _rows; Glib::RefPtr _plugins_liststore; diff --git a/src/gui/PluginMenu.cpp b/src/gui/PluginMenu.cpp index 0090aff1..f30c2b4b 100644 --- a/src/gui/PluginMenu.cpp +++ b/src/gui/PluginMenu.cpp @@ -66,7 +66,7 @@ PluginMenu::clear() void PluginMenu::add_plugin(SPtr p) { - typedef ClassMenus::iterator iterator; + using iterator = ClassMenus::iterator; if (!p->lilv_plugin() || lilv_plugin_is_replaced(p->lilv_plugin())) { return; diff --git a/src/gui/PluginMenu.hpp b/src/gui/PluginMenu.hpp index 284331d6..6c7aa6b0 100644 --- a/src/gui/PluginMenu.hpp +++ b/src/gui/PluginMenu.hpp @@ -56,8 +56,8 @@ private: Gtk::Menu* menu; }; - typedef std::multimap LV2Children; - typedef std::multimap ClassMenus; + using LV2Children = std::multimap; + using ClassMenus = std::multimap; /// Recursively add hierarchy rooted at `plugin_class` to `menu`. size_t build_plugin_class_menu(Gtk::Menu* menu, diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp index ee257843..9912f73a 100644 --- a/src/gui/PropertiesWindow.cpp +++ b/src/gui/PropertiesWindow.cpp @@ -42,7 +42,7 @@ using namespace client; namespace gui { -typedef std::set URISet; +using URISet = std::set; PropertiesWindow::PropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr& xml) diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp index c847da20..81e29ae1 100644 --- a/src/gui/PropertiesWindow.hpp +++ b/src/gui/PropertiesWindow.hpp @@ -105,7 +105,7 @@ private: void apply_clicked(); void ok_clicked(); - typedef std::map Records; + using Records = std::map; Records _records; SPtr _model; diff --git a/src/gui/RDFS.cpp b/src/gui/RDFS.cpp index 0b4a4e62..1091c443 100644 --- a/src/gui/RDFS.cpp +++ b/src/gui/RDFS.cpp @@ -117,8 +117,8 @@ datatypes(World& world, URISet& types, bool super) URISet types(World& world, SPtr model) { - typedef Properties::const_iterator PropIter; - typedef std::pair PropRange; + using PropIter = Properties::const_iterator; + using PropRange = std::pair; // Start with every rdf:type URISet types; diff --git a/src/gui/RDFS.hpp b/src/gui/RDFS.hpp index 4e9a8ab1..a8d161cb 100644 --- a/src/gui/RDFS.hpp +++ b/src/gui/RDFS.hpp @@ -36,10 +36,10 @@ namespace gui { namespace rdfs { /** Set of URIs. */ -typedef std::set URISet; +using URISet = std::set; /** Label => Resource map. */ -typedef std::map Objects; +using Objects = std::map; /** Return the label of `node`. */ std::string label(World& world, const LilvNode* node); diff --git a/src/gui/ThreadedLoader.hpp b/src/gui/ThreadedLoader.hpp index c1e97b6e..3ab8f4a2 100644 --- a/src/gui/ThreadedLoader.hpp +++ b/src/gui/ThreadedLoader.hpp @@ -80,7 +80,7 @@ private: const URI& filename); /** Returns nothing and takes no parameters (because they have all been bound) */ - typedef sigc::slot Closure; + using Closure = sigc::slot; void run(); diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp index 1b6201af..fad5b308 100644 --- a/src/gui/WindowFactory.hpp +++ b/src/gui/WindowFactory.hpp @@ -79,7 +79,7 @@ public: void clear(); private: - typedef std::map GraphWindowMap; + using GraphWindowMap = std::map; GraphWindow* new_graph_window(SPtr graph, SPtr view); diff --git a/src/server/BlockFactory.cpp b/src/server/BlockFactory.cpp index b6ad442e..18b19a4c 100644 --- a/src/server/BlockFactory.cpp +++ b/src/server/BlockFactory.cpp @@ -150,7 +150,7 @@ void BlockFactory::load_lv2_plugins() { // Build an array of port type nodes for checking compatibility - typedef std::vector< SPtr > Types; + using Types = std::vector>; Types types; for (unsigned t = PortType::ID::AUDIO; t <= PortType::ID::ATOM; ++t) { const URI& uri(PortType((PortType::ID)t).uri()); diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp index 608bfc3e..c8c36ddf 100644 --- a/src/server/BlockImpl.hpp +++ b/src/server/BlockImpl.hpp @@ -62,7 +62,7 @@ class BlockImpl : public NodeImpl , public boost::intrusive::slist_base_hook<> // In GraphImpl { public: - typedef Raul::Array Ports; + using Ports = Raul::Array; BlockImpl(PluginImpl* plugin, const Raul::Symbol& symbol, diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp index f03c0abb..a2d75284 100644 --- a/src/server/Broadcaster.hpp +++ b/src/server/Broadcaster.hpp @@ -103,7 +103,7 @@ public: private: friend class Transfer; - typedef std::set> Clients; + using Clients = std::set>; std::mutex _clients_mutex; Clients _clients; diff --git a/src/server/BufferRef.hpp b/src/server/BufferRef.hpp index c168601c..64eab668 100644 --- a/src/server/BufferRef.hpp +++ b/src/server/BufferRef.hpp @@ -26,7 +26,7 @@ namespace server { class Buffer; -typedef boost::intrusive_ptr BufferRef; +using BufferRef = boost::intrusive_ptr; // Defined in Buffer.cpp INGEN_API void intrusive_ptr_add_ref(Buffer* b); diff --git a/src/server/CompiledGraph.hpp b/src/server/CompiledGraph.hpp index 5cf12a10..959fb18e 100644 --- a/src/server/CompiledGraph.hpp +++ b/src/server/CompiledGraph.hpp @@ -53,7 +53,7 @@ private: CompiledGraph(GraphImpl* graph); - typedef std::set BlockSet; + using BlockSet = std::set; void dump(const std::string& name) const; diff --git a/src/server/ControlBindings.hpp b/src/server/ControlBindings.hpp index 9ac08a7a..3a39c664 100644 --- a/src/server/ControlBindings.hpp +++ b/src/server/ControlBindings.hpp @@ -118,9 +118,9 @@ public: void remove(RunContext& ctx, const std::vector& bindings); private: - typedef boost::intrusive::multiset< - Binding, - boost::intrusive::compare > Bindings; + using Bindings = + boost::intrusive::multiset>; Key midi_event_key(uint16_t size, const uint8_t* buf, uint16_t& value); diff --git a/src/server/DirectDriver.hpp b/src/server/DirectDriver.hpp index 945761e6..bb949a14 100644 --- a/src/server/DirectDriver.hpp +++ b/src/server/DirectDriver.hpp @@ -93,9 +93,8 @@ public: int real_time_priority() override { return 60; } private: - typedef boost::intrusive::slist - > Ports; + using Ports = boost::intrusive::slist>; Engine& _engine; Ports _ports; diff --git a/src/server/GraphImpl.cpp b/src/server/GraphImpl.cpp index b0f6145a..05bc6e4a 100644 --- a/src/server/GraphImpl.cpp +++ b/src/server/GraphImpl.cpp @@ -82,7 +82,7 @@ GraphImpl::duplicate(Engine& engine, dup->set_properties(props); // We need a map of port duplicates to duplicate arcs - typedef std::unordered_map PortMap; + using PortMap = std::unordered_map; PortMap port_map; // Add duplicates of all ports diff --git a/src/server/GraphImpl.hpp b/src/server/GraphImpl.hpp index 73724c3f..846996f3 100644 --- a/src/server/GraphImpl.hpp +++ b/src/server/GraphImpl.hpp @@ -99,8 +99,9 @@ public: // Graph specific stuff not inherited from Block - typedef boost::intrusive::slist< - BlockImpl, boost::intrusive::constant_time_size > Blocks; + using Blocks = + boost::intrusive::slist>; /** Add a block to this graph. * Pre-process thread only. @@ -118,8 +119,9 @@ public: uint32_t num_ports_non_rt() const; bool has_port_with_index(uint32_t index) const; - typedef boost::intrusive::slist< - DuplexPort, boost::intrusive::constant_time_size > PortList; + using PortList = + boost::intrusive::slist>; void add_input(DuplexPort& port) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); diff --git a/src/server/InputPort.hpp b/src/server/InputPort.hpp index 550a787d..35ddb2b9 100644 --- a/src/server/InputPort.hpp +++ b/src/server/InputPort.hpp @@ -67,9 +67,9 @@ public: const Atom& value, size_t buffer_size = 0); - typedef boost::intrusive::slist - > Arcs; + using Arcs = + boost::intrusive::slist>; /** Return the maximum polyphony of an output connected to this input. */ virtual uint32_t max_tail_poly(RunContext& context) const; diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index 537bd855..6d15f3a8 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -52,7 +52,7 @@ #include #include -typedef jack_default_audio_sample_t jack_sample_t; +using jack_sample_t = jack_default_audio_sample_t; namespace ingen { namespace server { diff --git a/src/server/JackDriver.hpp b/src/server/JackDriver.hpp index 6b64500e..00b1836a 100644 --- a/src/server/JackDriver.hpp +++ b/src/server/JackDriver.hpp @@ -142,9 +142,8 @@ private: #endif protected: - typedef boost::intrusive::slist - > Ports; + using Ports = boost::intrusive::slist>; using AudioBufPtr = UPtr>; diff --git a/src/server/LV2Block.hpp b/src/server/LV2Block.hpp index e10775a0..07c04321 100644 --- a/src/server/LV2Block.hpp +++ b/src/server/LV2Block.hpp @@ -110,7 +110,7 @@ protected: return (LilvInstance*)(*_instances)[voice]->instance; } - typedef Raul::Array< SPtr > Instances; + using Instances = Raul::Array>; void drop_instances(const MPtr& instances) { if (instances) { @@ -139,10 +139,10 @@ protected: void* const data; }; - typedef boost::intrusive::slist, - boost::intrusive::constant_time_size - > Responses; + using Responses = boost::intrusive::slist< + Response, + boost::intrusive::cache_last, + boost::intrusive::constant_time_size>; static LV2_Worker_Status work_respond( LV2_Worker_Respond_Handle handle, uint32_t size, const void* data); diff --git a/src/server/PluginImpl.hpp b/src/server/PluginImpl.hpp index 6ef6fe22..854157ec 100644 --- a/src/server/PluginImpl.hpp +++ b/src/server/PluginImpl.hpp @@ -62,8 +62,8 @@ public: bool is_zombie() const { return _is_zombie; } void set_is_zombie(bool t) { _is_zombie = t; } - typedef std::pair Preset; - typedef std::map Presets; + using Preset = std::pair; + using Presets = std::map; const Presets& presets(bool force_reload=false) { if (!_presets_loaded || force_reload) { diff --git a/src/server/PortAudioDriver.hpp b/src/server/PortAudioDriver.hpp index f65fc871..679223ad 100644 --- a/src/server/PortAudioDriver.hpp +++ b/src/server/PortAudioDriver.hpp @@ -109,9 +109,8 @@ private: void* outputs); protected: - typedef boost::intrusive::slist - > Ports; + using Ports = boost::intrusive::slist>; Engine& _engine; Ports _ports; diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp index 902e2cfa..5392d9b7 100644 --- a/src/server/PortImpl.hpp +++ b/src/server/PortImpl.hpp @@ -83,7 +83,7 @@ public: BufferRef buffer; }; - typedef Raul::Array Voices; + using Voices = Raul::Array; PortImpl(BufferFactory& bufs, BlockImpl* block, diff --git a/src/server/PreProcessContext.hpp b/src/server/PreProcessContext.hpp index 1d4b428a..7579e1e2 100644 --- a/src/server/PreProcessContext.hpp +++ b/src/server/PreProcessContext.hpp @@ -34,7 +34,7 @@ namespace server { class PreProcessContext { public: - typedef std::unordered_set DirtyGraphs; + using DirtyGraphs = std::unordered_set; /** Return true iff an atomic bundle is currently being pre-processed. */ bool in_bundle() const { return _in_bundle; } diff --git a/src/server/Task.hpp b/src/server/Task.hpp index a2e3e86a..a6489e61 100644 --- a/src/server/Task.hpp +++ b/src/server/Task.hpp @@ -96,7 +96,7 @@ public: void set_done(bool done) { _done = done; } private: - typedef std::deque> Children; + using Children = std::deque>; Task(const Task&) = delete; Task& operator=(const Task&) = delete; diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp index b9c844cb..cfeb0e3d 100644 --- a/src/server/events/CreateBlock.cpp +++ b/src/server/events/CreateBlock.cpp @@ -54,7 +54,7 @@ CreateBlock::CreateBlock(Engine& engine, bool CreateBlock::pre_process(PreProcessContext& ctx) { - typedef Properties::const_iterator iterator; + using iterator = Properties::const_iterator; const ingen::URIs& uris = _engine.world().uris(); const SPtr store = _engine.store(); diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp index e2dffc61..5561d147 100644 --- a/src/server/events/CreateGraph.cpp +++ b/src/server/events/CreateGraph.cpp @@ -109,7 +109,7 @@ CreateGraph::pre_process(PreProcessContext& ctx) const ingen::URIs& uris = _engine.world().uris(); - typedef Properties::const_iterator iterator; + using iterator = Properties::const_iterator; uint32_t ext_poly = 1; uint32_t int_poly = 1; diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index f463eb4f..09eb8cff 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -57,8 +57,8 @@ CreatePort::CreatePort(Engine& engine, { const ingen::URIs& uris = _engine.world().uris(); - typedef Properties::const_iterator Iterator; - typedef std::pair Range; + using Iterator = Properties::const_iterator; + using Range = std::pair; const Range types = properties.equal_range(uris.rdf_type); for (Iterator i = types.first; i != types.second; ++i) { @@ -116,7 +116,7 @@ CreatePort::pre_process(PreProcessContext& ctx) const uint32_t buf_size = bufs.default_size(_buf_type); const int32_t old_n_ports = _graph->num_ports_non_rt(); - typedef Properties::const_iterator PropIter; + using PropIter = Properties::const_iterator; PropIter index_i = _properties.find(uris.lv2_index); int32_t index = 0; diff --git a/src/server/events/Delta.hpp b/src/server/events/Delta.hpp index dcc265f8..4328ad83 100644 --- a/src/server/events/Delta.hpp +++ b/src/server/events/Delta.hpp @@ -95,7 +95,7 @@ private: LOADED_BUNDLE }; - typedef std::vector> SetEvents; + using SetEvents = std::vector>; void init(); diff --git a/src/server/events/DisconnectAll.hpp b/src/server/events/DisconnectAll.hpp index 8aa63d2b..3edfedd6 100644 --- a/src/server/events/DisconnectAll.hpp +++ b/src/server/events/DisconnectAll.hpp @@ -60,7 +60,7 @@ public: void undo(Interface& target) override; private: - typedef std::list Impls; + using Impls = std::list; const ingen::DisconnectAll _msg; GraphImpl* _parent; diff --git a/src/server/events/Mark.hpp b/src/server/events/Mark.hpp index 33aedcd6..ad8cb66b 100644 --- a/src/server/events/Mark.hpp +++ b/src/server/events/Mark.hpp @@ -59,7 +59,7 @@ public: private: enum class Type { BUNDLE_BEGIN, BUNDLE_END }; - typedef std::map> CompiledGraphs; + using CompiledGraphs = std::map>; CompiledGraphs _compiled_graphs; Type _type; diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index b40ccbf9..5ef3a321 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -92,7 +92,7 @@ class Lib { public: explicit Lib(const char* bundle_path); - typedef std::vector< SPtr > Graphs; + using Graphs = std::vector>; Graphs graphs; }; @@ -391,7 +391,7 @@ public: AtomReader& reader() { return _reader; } AtomWriter& writer() { return _writer; } - typedef std::vector Ports; + using Ports = std::vector; Ports& ports() { return _ports; } diff --git a/src/server/internals/Note.hpp b/src/server/internals/Note.hpp index 2911f55b..eed5dda7 100644 --- a/src/server/internals/Note.hpp +++ b/src/server/internals/Note.hpp @@ -84,7 +84,7 @@ private: SampleCount time; }; - typedef Raul::Array Voices; + using Voices = Raul::Array; void free_voice(RunContext& context, uint32_t voice, FrameTime time); diff --git a/src/server/types.hpp b/src/server/types.hpp index e7dae117..bd211c31 100644 --- a/src/server/types.hpp +++ b/src/server/types.hpp @@ -19,9 +19,9 @@ #include -typedef float Sample; -typedef uint32_t SampleCount; -typedef uint32_t SampleRate; -typedef uint32_t FrameTime; +using Sample = float; +using SampleCount = uint32_t; +using SampleRate = uint32_t; +using FrameTime = uint32_t; #endif // INGEN_ENGINE_TYPES_HPP -- cgit v1.2.1