diff options
author | David Robillard <d@drobilla.net> | 2017-12-25 13:59:47 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-12-25 16:26:13 -0500 |
commit | d6a9571641bcb34acb3521feb08eea33195fd9ca (patch) | |
tree | 5c28e2800d829b7b1896e2fcbe3f8870b88e039d /src/server | |
parent | 25177612b20f7d3ebd4138fed9cd9acffec7e756 (diff) | |
download | ingen-d6a9571641bcb34acb3521feb08eea33195fd9ca.tar.gz ingen-d6a9571641bcb34acb3521feb08eea33195fd9ca.tar.bz2 ingen-d6a9571641bcb34acb3521feb08eea33195fd9ca.zip |
Use nullptr
Diffstat (limited to 'src/server')
42 files changed, 185 insertions, 185 deletions
diff --git a/src/server/BlockFactory.cpp b/src/server/BlockFactory.cpp index de7c2de2..3314eb46 100644 --- a/src/server/BlockFactory.cpp +++ b/src/server/BlockFactory.cpp @@ -104,7 +104,7 @@ BlockFactory::plugin(const Raul::URI& uri) { load_plugin(uri); const Plugins::const_iterator i = _plugins.find(uri); - return ((i != _plugins.end()) ? i->second : NULL); + return ((i != _plugins.end()) ? i->second : nullptr); } void diff --git a/src/server/BlockImpl.cpp b/src/server/BlockImpl.cpp index d0f0d646..36bf3e30 100644 --- a/src/server/BlockImpl.cpp +++ b/src/server/BlockImpl.cpp @@ -159,7 +159,7 @@ BlockImpl::nth_port_by_type(uint32_t n, bool input, PortType type) } } } - return NULL; + return nullptr; } PortImpl* @@ -170,7 +170,7 @@ BlockImpl::port_by_symbol(const char* symbol) return _ports->at(p); } } - return NULL; + return nullptr; } void diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp index 7a8d2b8c..62d6b8e0 100644 --- a/src/server/BlockImpl.hpp +++ b/src/server/BlockImpl.hpp @@ -90,7 +90,7 @@ public: /** Duplicate this Node. */ virtual BlockImpl* duplicate(Engine& engine, const Raul::Symbol& symbol, - GraphImpl* parent) { return NULL; } + GraphImpl* parent) { return nullptr; } /** Return true iff this block is activated */ bool activated() const { return _activated; } @@ -102,7 +102,7 @@ public: void set_enabled(bool e) { _enabled = e; } /** Load a preset from the world for this block. */ - virtual LilvState* load_preset(const Raul::URI& uri) { return NULL; } + virtual LilvState* load_preset(const Raul::URI& uri) { return nullptr; } /** Restore `state`. */ virtual void apply_state(Worker* worker, const LilvState* state) {} diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp index 2353ab5d..c18da06a 100644 --- a/src/server/Buffer.cpp +++ b/src/server/Buffer.cpp @@ -46,12 +46,12 @@ Buffer::Buffer(BufferFactory& bufs, bool external, void* buf) : _factory(bufs) - , _buf(NULL) + , _buf(nullptr) , _type(type) , _value_type(value_type) , _capacity(capacity) , _latest_event(0) - , _next(NULL) + , _next(nullptr) , _refs(0) , _external(external) { @@ -210,7 +210,7 @@ Buffer::port_data(PortType port_type, SampleCount offset) } default: break; } - return NULL; + return nullptr; } const void* @@ -391,7 +391,7 @@ Buffer::next_value_offset(SampleCount offset, SampleCount end) const const LV2_Atom* Buffer::value() const { - return _value_buffer ? _value_buffer->get<const LV2_Atom>() : NULL; + return _value_buffer ? _value_buffer->get<const LV2_Atom>() : nullptr; } void @@ -417,7 +417,7 @@ Buffer::update_value_buffer(SampleCount offset) } LV2_Atom_Sequence* seq = get<LV2_Atom_Sequence>(); - LV2_Atom_Event* latest = NULL; + LV2_Atom_Event* latest = nullptr; LV2_ATOM_SEQUENCE_FOREACH(seq, ev) { if (ev->time.frames > offset) { break; diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp index f4e147ea..6d42b979 100644 --- a/src/server/Buffer.hpp +++ b/src/server/Buffer.hpp @@ -45,7 +45,7 @@ public: LV2_URID value_type, uint32_t capacity, bool external = false, - void* buf = NULL); + void* buf = nullptr); void clear(); void resize(uint32_t capacity); @@ -91,7 +91,7 @@ public: } else if (is_audio()) { return (const Sample*)_buf; } - return NULL; + return nullptr; } /// Audio buffers only @@ -101,7 +101,7 @@ public: } else if (is_audio()) { return (Sample*)_buf; } - return NULL; + return nullptr; } /// Numeric buffers only diff --git a/src/server/BufferFactory.cpp b/src/server/BufferFactory.cpp index f2451405..7c4dd003 100644 --- a/src/server/BufferFactory.cpp +++ b/src/server/BufferFactory.cpp @@ -25,14 +25,14 @@ namespace Ingen { namespace Server { BufferFactory::BufferFactory(Engine& engine, URIs& uris) - : _free_audio(NULL) - , _free_control(NULL) - , _free_sequence(NULL) - , _free_object(NULL) + : _free_audio(nullptr) + , _free_control(nullptr) + , _free_sequence(nullptr) + , _free_object(nullptr) , _engine(engine) , _uris(uris) , _seq_size(0) - , _silent_buffer(NULL) + , _silent_buffer(nullptr) { } @@ -109,7 +109,7 @@ Buffer* BufferFactory::try_get_buffer(LV2_URID type) { std::atomic<Buffer*>& head_ptr = free_list(type); - Buffer* head = NULL; + Buffer* head = nullptr; Buffer* next; do { head = head_ptr.load(); @@ -132,7 +132,7 @@ BufferFactory::get_buffer(LV2_URID type, return create(type, value_type, capacity); } - try_head->_next = NULL; + try_head->_next = nullptr; try_head->set_type(&BufferFactory::get_buffer, type, value_type); try_head->clear(); return BufferRef(try_head); @@ -149,7 +149,7 @@ BufferFactory::claim_buffer(LV2_URID type, return BufferRef(); } - try_head->_next = NULL; + try_head->_next = nullptr; try_head->set_type(&BufferFactory::claim_buffer, type, value_type); return BufferRef(try_head); } diff --git a/src/server/CompiledGraph.cpp b/src/server/CompiledGraph.cpp index 13d6690e..6002afa1 100644 --- a/src/server/CompiledGraph.cpp +++ b/src/server/CompiledGraph.cpp @@ -31,7 +31,7 @@ namespace Server { /** Graph contains ambiguous feedback with no delay nodes. */ class FeedbackException : public std::exception { public: - FeedbackException(const BlockImpl* node, const BlockImpl* root=NULL) + FeedbackException(const BlockImpl* node, const BlockImpl* root=nullptr) : node(node) , root(root) {} diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index 565f56b3..5f97452a 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -37,7 +37,7 @@ namespace Server { ControlBindings::ControlBindings(Engine& engine) : _engine(engine) - , _learn_binding(NULL) + , _learn_binding(nullptr) , _bindings(new Bindings()) , _feedback(new Buffer(*_engine.buffer_factory(), engine.world()->uris().atom_Sequence, @@ -68,7 +68,7 @@ ControlBindings::binding_key(const Atom& binding) const { const Ingen::URIs& uris = _engine.world()->uris(); Key key; - LV2_Atom* num = NULL; + LV2_Atom* num = nullptr; if (binding.type() == uris.atom_Object) { const LV2_Atom_Object_Body* obj = (const LV2_Atom_Object_Body*) binding.get_body(); @@ -340,7 +340,7 @@ bool ControlBindings::finish_learn(RunContext& context, Key key) { const Ingen::URIs& uris = context.engine().world()->uris(); - Binding* binding = _learn_binding.exchange(NULL); + Binding* binding = _learn_binding.exchange(nullptr); if (!binding || (key.type == Type::MIDI_NOTE && !binding->port->is_toggled())) { return false; } @@ -404,7 +404,7 @@ ControlBindings::pre_process(RunContext& ctx, Buffer* buffer) } // Set all controls bound to this key - const Binding k = {key, NULL}; + const Binding k = {key, nullptr}; for (Bindings::const_iterator i = _bindings->lower_bound(k); i != _bindings->end() && i->key == key; ++i) { diff --git a/src/server/ControlBindings.hpp b/src/server/ControlBindings.hpp index 20241fc0..aed1b607 100644 --- a/src/server/ControlBindings.hpp +++ b/src/server/ControlBindings.hpp @@ -67,7 +67,7 @@ public: /** One binding of a controller to a port. */ struct Binding : public boost::intrusive::set_base_hook<>, public Raul::Maid::Disposable { - Binding(Key k=Key(), PortImpl* p=NULL) : key(k), port(p) {} + Binding(Key k=Key(), PortImpl* p=nullptr) : key(k), port(p) {} inline bool operator<(const Binding& rhs) const { return key < rhs.key; } diff --git a/src/server/DirectDriver.hpp b/src/server/DirectDriver.hpp index 706adda8..219d0cb1 100644 --- a/src/server/DirectDriver.hpp +++ b/src/server/DirectDriver.hpp @@ -57,7 +57,7 @@ public: } } - return NULL; + return nullptr; } virtual void add_port(RunContext& context, EnginePort* port) { diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp index b01da97f..371ee5f4 100644 --- a/src/server/DuplexPort.cpp +++ b/src/server/DuplexPort.cpp @@ -158,7 +158,7 @@ DuplexPort::setup_buffers(RunContext& ctx, BufferFactory& bufs, uint32_t poly) void DuplexPort::set_is_driver_port(BufferFactory& bufs) { - _voices->at(0).buffer = new Buffer(bufs, buffer_type(), _value.type(), 0, true, NULL); + _voices->at(0).buffer = new Buffer(bufs, buffer_type(), _value.type(), 0, true, nullptr); PortImpl::set_is_driver_port(bufs); } diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index 2e32e706..1884e25d 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -72,7 +72,7 @@ Engine::Engine(Ingen::World* world) , _block_factory(new BlockFactory(world)) , _broadcaster(new Broadcaster()) , _buffer_factory(new BufferFactory(*this, world->uris())) - , _control_bindings(NULL) + , _control_bindings(nullptr) , _event_writer(new EventWriter(*this)) , _interface(_event_writer) , _atom_interface(nullptr) @@ -81,10 +81,10 @@ Engine::Engine(Ingen::World* world) , _redo_stack(new UndoStack(_world->uris(), _world->uri_map())) , _pre_processor(new PreProcessor(*this)) , _post_processor(new PostProcessor(*this)) - , _root_graph(NULL) + , _root_graph(nullptr) , _worker(new Worker(world->log(), event_queue_size())) , _sync_worker(new Worker(world->log(), event_queue_size(), true)) - , _listener(NULL) + , _listener(nullptr) , _cycle_start_time(0) , _rand_engine(0) , _uniform_dist(0.0f, 1.0f) @@ -137,7 +137,7 @@ Engine::Engine(Ingen::World* world) Engine::~Engine() { - _root_graph = NULL; + _root_graph = nullptr; deactivate(); // Process all pending events @@ -289,7 +289,7 @@ Engine::steal_task(unsigned start_thread) } } } - return NULL; + return nullptr; } SPtr<Store> diff --git a/src/server/EnginePort.hpp b/src/server/EnginePort.hpp index c657f75a..c14f363c 100644 --- a/src/server/EnginePort.hpp +++ b/src/server/EnginePort.hpp @@ -38,8 +38,8 @@ class EnginePort : public Raul::Noncopyable public: explicit EnginePort(DuplexPort* port) : _graph_port(port) - , _buffer(NULL) - , _handle(NULL) + , _buffer(nullptr) + , _handle(nullptr) , _driver_index(0) {} diff --git a/src/server/Event.hpp b/src/server/Event.hpp index 2cd17aa2..09018163 100644 --- a/src/server/Event.hpp +++ b/src/server/Event.hpp @@ -107,7 +107,7 @@ public: protected: Event(Engine& engine, SPtr<Interface> client, int32_t id, FrameTime time) : _engine(engine) - , _next(NULL) + , _next(nullptr) , _request_client(client) , _request_id(id) , _time(time) @@ -118,7 +118,7 @@ protected: /** Constructor for internal events only */ explicit Event(Engine& engine) : _engine(engine) - , _next(NULL) + , _next(nullptr) , _request_id(0) , _time(0) , _status(Status::NOT_PREPARED) diff --git a/src/server/GraphPlugin.hpp b/src/server/GraphPlugin.hpp index 9100b058..0314f9d6 100644 --- a/src/server/GraphPlugin.hpp +++ b/src/server/GraphPlugin.hpp @@ -46,7 +46,7 @@ public: Engine& engine, const LilvState* state) { - return NULL; + return nullptr; } const Raul::Symbol symbol() const { return Raul::Symbol("graph"); } diff --git a/src/server/InternalBlock.cpp b/src/server/InternalBlock.cpp index ffb5163f..3d8f7390 100644 --- a/src/server/InternalBlock.cpp +++ b/src/server/InternalBlock.cpp @@ -39,7 +39,7 @@ InternalBlock::duplicate(Engine& engine, BufferFactory& bufs = *engine.buffer_factory(); BlockImpl* copy = reinterpret_cast<InternalPlugin*>(_plugin)->instantiate( - bufs, symbol, _polyphonic, parent_graph(), engine, NULL); + bufs, symbol, _polyphonic, parent_graph(), engine, nullptr); for (size_t i = 0; i < num_ports(); ++i) { const Atom& value = port_impl(i)->value(); diff --git a/src/server/InternalPlugin.cpp b/src/server/InternalPlugin.cpp index 3342ef84..c81d7563 100644 --- a/src/server/InternalPlugin.cpp +++ b/src/server/InternalPlugin.cpp @@ -61,7 +61,7 @@ InternalPlugin::instantiate(BufferFactory& bufs, } else if (uri() == NS_INTERNALS "Trigger") { return new TriggerNode(this, bufs, symbol, polyphonic, parent, srate); } else { - return NULL; + return nullptr; } } diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index 44f92dd8..0255c422 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -57,7 +57,7 @@ JackDriver::JackDriver(Engine& engine) : _engine(engine) , _sem(0) , _flag(false) - , _client(NULL) + , _client(nullptr) , _block_length(0) , _seq_size(0) , _sample_rate(0) @@ -88,7 +88,7 @@ JackDriver::attach(const std::string& server_name, const std::string uuid = _engine.world()->jack_uuid(); if (!uuid.empty()) { _client = jack_client_open(client_name.c_str(), - JackSessionID, NULL, + JackSessionID, nullptr, uuid.c_str()); _engine.log().info(fmt("Connected to Jack as `%1%' (UUID `%2%')\n") % client_name.c_str() % uuid); @@ -98,7 +98,7 @@ JackDriver::attach(const std::string& server_name, // Try supplied server name if (!_client && !server_name.empty()) { if ((_client = jack_client_open(client_name.c_str(), - JackServerName, NULL, + JackServerName, nullptr, server_name.c_str()))) { _engine.log().info(fmt("Connected to Jack server `%1%'\n") % server_name); @@ -108,7 +108,7 @@ JackDriver::attach(const std::string& server_name, // Either server name not specified, or supplied server name does not exist // Connect to default server if (!_client) { - if ((_client = jack_client_open(client_name.c_str(), JackNullOption, NULL))) + if ((_client = jack_client_open(client_name.c_str(), JackNullOption, nullptr))) _engine.log().info("Connected to default Jack server\n"); } @@ -152,7 +152,7 @@ JackDriver::activate() if (!_client) attach(world->conf().option("jack-server").ptr<char>(), - world->conf().option("jack-name").ptr<char>(), NULL); + world->conf().option("jack-name").ptr<char>(), nullptr); if (!_client) { return false; @@ -187,7 +187,7 @@ JackDriver::deactivate() if (_client) { jack_deactivate(_client); jack_client_close(_client); - _client = NULL; + _client = nullptr; } _engine.log().info("Deactivated Jack client\n"); @@ -203,7 +203,7 @@ JackDriver::get_port(const Raul::Path& path) } } - return NULL; + return nullptr; } void @@ -257,7 +257,7 @@ JackDriver::unregister_port(EnginePort& port) _engine.log().error("Failed to unregister Jack port\n"); } - port.set_handle(NULL); + port.set_handle(nullptr); } void @@ -315,7 +315,7 @@ JackDriver::port_property_internal(const jack_port_t* jport, EnginePort* JackDriver::create_port(DuplexPort* graph_port) { - EnginePort* eport = NULL; + EnginePort* eport = nullptr; if (graph_port->is_a(PortType::AUDIO) || graph_port->is_a(PortType::CV)) { // Audio buffer port, use Jack buffer directly eport = new EnginePort(graph_port); @@ -402,7 +402,7 @@ JackDriver::post_process_port(RunContext& context, EnginePort* port) // Reset graph port buffer pointer to no longer point to the Jack buffer if (graph_port->is_driver_port()) { - graph_port->set_driver_buffer(NULL, 0); + graph_port->set_driver_buffer(nullptr, 0); } } @@ -512,7 +512,7 @@ JackDriver::_shutdown_cb() { _engine.log().info("Jack shutdown, exiting\n"); _is_activated = false; - _client = NULL; + _client = nullptr; } int diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp index e023e3d7..91490e69 100644 --- a/src/server/LV2Block.cpp +++ b/src/server/LV2Block.cpp @@ -63,7 +63,7 @@ LV2Block::LV2Block(LV2Plugin* plugin, SampleRate srate) : BlockImpl(plugin, symbol, polyphonic, parent, srate) , _lv2_plugin(plugin) - , _worker_iface(NULL) + , _worker_iface(nullptr) { assert(_lv2_plugin); } @@ -92,7 +92,7 @@ LV2Block::make_instance(URIs& uris, return SPtr<Instance>(); } - const LV2_Options_Interface* options_iface = NULL; + const LV2_Options_Interface* options_iface = nullptr; if (lilv_plugin_has_extension_data(lplug, uris.opt_interface)) { options_iface = (const LV2_Options_Interface*) lilv_instance_get_extension_data(inst, LV2_OPTIONS__interface); @@ -109,7 +109,7 @@ LV2Block::make_instance(URIs& uris, const LV2_Options_Option options[] = { { LV2_OPTIONS_PORT, p, uris.morph_currentType, sizeof(LV2_URID), uris.atom_URID, &port_type }, - { LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, NULL } + { LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, nullptr } }; options_iface->set(inst->lv2_handle, options); } @@ -131,8 +131,8 @@ LV2Block::make_instance(URIs& uris, PortImpl* const port = _ports->at(p); if (port->is_auto_morph()) { LV2_Options_Option options[] = { - { LV2_OPTIONS_PORT, p, uris.morph_currentType, 0, 0, NULL }, - { LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, 0 } + { LV2_OPTIONS_PORT, p, uris.morph_currentType, 0, 0, nullptr }, + { LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, nullptr } }; options_iface->get(inst->lv2_handle, options); @@ -391,7 +391,7 @@ LV2Block::instantiate(BufferFactory& bufs, const LilvState* state) const LilvNode* preds[] = { uris.lv2_designation, uris.lv2_portProperty, uris.atom_supports, - 0 }; + nullptr }; for (int p = 0; preds[p]; ++p) { LilvNodes* values = lilv_port_get_value(plug, id, preds[p]); LILV_FOREACH(nodes, v, values) { @@ -434,14 +434,14 @@ LV2Block::instantiate(BufferFactory& bufs, const LilvState* state) } // Load initial state if no state is explicitly given - LilvState* default_state = NULL; + LilvState* default_state = nullptr; if (!state) { state = default_state = load_preset(_lv2_plugin->uri()); } // Apply state if (state) { - apply_state(NULL, state); + apply_state(nullptr, state); } if (default_state) { @@ -467,8 +467,8 @@ LV2Block::save_state(const std::string& dir) const LilvState* state = lilv_state_new_from_instance( _lv2_plugin->lilv_plugin(), const_cast<LV2Block*>(this)->instance(0), &world->uri_map().urid_map_feature()->urid_map, - NULL, dir.c_str(), dir.c_str(), dir.c_str(), NULL, NULL, - LV2_STATE_IS_POD|LV2_STATE_IS_PORTABLE, NULL); + nullptr, dir.c_str(), dir.c_str(), dir.c_str(), nullptr, nullptr, + LV2_STATE_IS_POD|LV2_STATE_IS_PORTABLE, nullptr); if (!state) { return false; @@ -481,7 +481,7 @@ LV2Block::save_state(const std::string& dir) const &world->uri_map().urid_map_feature()->urid_map, &world->uri_map().urid_unmap_feature()->urid_unmap, state, - NULL, + nullptr, dir.c_str(), "state.ttl"); @@ -501,13 +501,13 @@ LV2Block::duplicate(Engine& engine, LilvState* state = lilv_state_new_from_instance( _lv2_plugin->lilv_plugin(), instance(0), &engine.world()->uri_map().urid_map_feature()->urid_map, - NULL, NULL, NULL, NULL, NULL, NULL, LV2_STATE_IS_NATIVE, NULL); + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, LV2_STATE_IS_NATIVE, nullptr); // Duplicate and instantiate block LV2Block* dup = new LV2Block(_lv2_plugin, symbol, _polyphonic, parent, rate); if (!dup->instantiate(*engine.buffer_factory(), state)) { delete dup; - return NULL; + return nullptr; } dup->set_properties(properties()); @@ -644,13 +644,13 @@ LV2Block::apply_state(Worker* worker, const LilvState* state) sched = worker->schedule_feature()->feature(world, this); } - const LV2_Feature* state_features[2] = { NULL, NULL }; + const LV2_Feature* state_features[2] = { nullptr, nullptr }; if (sched) { state_features[0] = sched.get(); } for (uint32_t v = 0; v < _polyphony; ++v) { - lilv_state_restore(state, instance(v), NULL, NULL, 0, state_features); + lilv_state_restore(state, instance(v), nullptr, nullptr, 0, state_features); } } @@ -669,7 +669,7 @@ get_port_value(const char* port_symbol, return port->value().get_body(); } - return NULL; + return nullptr; } boost::optional<Resource> @@ -687,8 +687,8 @@ LV2Block::save_preset(const Raul::URI& uri, LilvState* state = lilv_state_new_from_instance( _lv2_plugin->lilv_plugin(), instance(0), lmap, - NULL, NULL, NULL, path.c_str(), - get_port_value, this, LV2_STATE_IS_NATIVE, NULL); + nullptr, nullptr, nullptr, path.c_str(), + get_port_value, this, LV2_STATE_IS_NATIVE, nullptr); if (state) { const Properties::const_iterator l = props.find(_uris.rdfs_label); @@ -696,7 +696,7 @@ LV2Block::save_preset(const Raul::URI& uri, lilv_state_set_label(state, l->second.ptr<char>()); } - lilv_state_save(lworld, lmap, lunmap, state, NULL, + lilv_state_save(lworld, lmap, lunmap, state, nullptr, dirname.c_str(), basename.c_str()); const Raul::URI uri(lilv_node_as_uri(lilv_state_get_uri(state))); @@ -732,7 +732,7 @@ LV2Block::set_port_buffer(uint32_t voice, lilv_instance_connect_port( instance(voice), port_num, - buf ? buf->port_data(_ports->at(port_num)->type(), offset) : NULL); + buf ? buf->port_data(_ports->at(port_num)->type(), offset) : nullptr); } } // namespace Server diff --git a/src/server/LV2Options.hpp b/src/server/LV2Options.hpp index 1ef8db91..ef7c5ec9 100644 --- a/src/server/LV2Options.hpp +++ b/src/server/LV2Options.hpp @@ -48,7 +48,7 @@ public: sizeof(int32_t), _uris.atom_Int, &_seq_size }, { LV2_OPTIONS_INSTANCE, 0, _uris.param_sampleRate, sizeof(int32_t), _uris.atom_Int, &_sample_rate }, - { LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, NULL } + { LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, nullptr } }; LV2_Feature* f = (LV2_Feature*)malloc(sizeof(LV2_Feature)); diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp index 0ba990d0..cd29c0b1 100644 --- a/src/server/LV2Plugin.cpp +++ b/src/server/LV2Plugin.cpp @@ -48,11 +48,11 @@ LV2Plugin::update_properties() LilvNode* minor = lilv_world_get(_world->lilv_world(), lilv_plugin_get_uri(_lilv_plugin), _uris.lv2_minorVersion, - NULL); + nullptr); LilvNode* micro = lilv_world_get(_world->lilv_world(), lilv_plugin_get_uri(_lilv_plugin), _uris.lv2_microVersion, - NULL); + nullptr); if (lilv_node_is_int(minor) && lilv_node_is_int(micro)) { set_property(_uris.lv2_minorVersion, @@ -98,7 +98,7 @@ LV2Plugin::instantiate(BufferFactory& bufs, if (!b->instantiate(bufs, state)) { delete b; - return NULL; + return nullptr; } else { return b; } @@ -117,7 +117,7 @@ LV2Plugin::load_presets() lilv_world_load_resource(lworld, preset); LilvNodes* labels = lilv_world_find_nodes( - lworld, preset, uris.rdfs_label, NULL); + lworld, preset, uris.rdfs_label, nullptr); if (labels) { const LilvNode* label = lilv_nodes_get_first(labels); diff --git a/src/server/PortAudioDriver.cpp b/src/server/PortAudioDriver.cpp index 1c0a1b0b..a97f5105 100644 --- a/src/server/PortAudioDriver.cpp +++ b/src/server/PortAudioDriver.cpp @@ -125,17 +125,17 @@ PortAudioDriver::activate() // Configure audio format _inputParameters.sampleFormat = paFloat32|paNonInterleaved; _inputParameters.suggestedLatency = in_dev->defaultLowInputLatency; - _inputParameters.hostApiSpecificStreamInfo = NULL; + _inputParameters.hostApiSpecificStreamInfo = nullptr; _outputParameters.sampleFormat = paFloat32|paNonInterleaved; _outputParameters.suggestedLatency = out_dev->defaultLowOutputLatency; - _outputParameters.hostApiSpecificStreamInfo = NULL; + _outputParameters.hostApiSpecificStreamInfo = nullptr; // Open stream PaError st = paNoError; if ((st = Pa_OpenStream( &_stream, - _inputParameters.channelCount ? &_inputParameters : NULL, - _outputParameters.channelCount ? &_outputParameters : NULL, + _inputParameters.channelCount ? &_inputParameters : nullptr, + _outputParameters.channelCount ? &_outputParameters : nullptr, in_dev->defaultSampleRate, _block_length, // paFramesPerBufferUnspecified, // FIXME: ? 0, @@ -173,7 +173,7 @@ PortAudioDriver::get_port(const Raul::Path& path) } } - return NULL; + return nullptr; } void @@ -214,7 +214,7 @@ PortAudioDriver::port_property(const Raul::Path& path, EnginePort* PortAudioDriver::create_port(DuplexPort* graph_port) { - EnginePort* eport = NULL; + EnginePort* eport = nullptr; if (graph_port->is_a(PortType::AUDIO) || graph_port->is_a(PortType::CV)) { // Audio buffer port, use Jack buffer directly eport = new EnginePort(graph_port); diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index 50a48fbd..a3abe825 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -77,7 +77,7 @@ PortImpl::PortImpl(BufferFactory& bufs, , _is_driver_port(false) , _is_output(is_output) { - assert(block != NULL); + assert(block != nullptr); assert(_poly > 0); const Ingen::URIs& uris = bufs.uris(); @@ -398,7 +398,7 @@ void PortImpl::recycle_buffers() { for (uint32_t v = 0; v < _poly; ++v) - _voices->at(v).buffer = NULL; + _voices->at(v).buffer = nullptr; } void diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp index 46d4b606..0cbd842c 100644 --- a/src/server/PortImpl.hpp +++ b/src/server/PortImpl.hpp @@ -78,7 +78,7 @@ public: }; struct Voice { - Voice() : buffer(NULL) {} + Voice() : buffer(nullptr) {} SetState set_state; BufferRef buffer; diff --git a/src/server/PreProcessor.cpp b/src/server/PreProcessor.cpp index 211816c6..6beccd7c 100644 --- a/src/server/PreProcessor.cpp +++ b/src/server/PreProcessor.cpp @@ -37,8 +37,8 @@ namespace Server { PreProcessor::PreProcessor(Engine& engine) : _engine(engine) , _sem(0) - , _head(NULL) - , _tail(NULL) + , _head(nullptr) + , _tail(nullptr) , _block_state(BlockState::UNBLOCKED) , _exit_flag(false) , _thread(&PreProcessor::run, this) @@ -151,7 +151,7 @@ PreProcessor::process(RunContext& context, PostProcessor& dest, size_t limit) #endif Event* next = (Event*)last->next(); - last->next(NULL); + last->next(nullptr); dest.append(context, head, last); // Since _head was not NULL, we know it hasn't been changed since @@ -179,7 +179,7 @@ PreProcessor::run() ThreadManager::set_flag(THREAD_PRE_PROCESS); - Event* back = NULL; + Event* back = nullptr; while (!_exit_flag) { if (!_sem.timed_wait(std::chrono::seconds(1))) { continue; diff --git a/src/server/RunContext.cpp b/src/server/RunContext.cpp index b2e3f269..d065c41f 100644 --- a/src/server/RunContext.cpp +++ b/src/server/RunContext.cpp @@ -30,7 +30,7 @@ namespace Server { struct Notification { - inline Notification(PortImpl* p = 0, + inline Notification(PortImpl* p = nullptr, FrameTime f = 0, LV2_URID k = 0, uint32_t s = 0, @@ -115,7 +115,7 @@ RunContext::emit_notifications(FrameTime end) } if (_event_sink->read(sizeof(note), ¬e) == sizeof(note)) { Atom value = _engine.world()->forge().alloc( - note.size, note.type, NULL); + note.size, note.type, nullptr); if (_event_sink->read(note.size, value.get_body()) == note.size) { i += note.size; const char* key = _engine.world()->uri_map().unmap_uri(note.key); diff --git a/src/server/RunContext.hpp b/src/server/RunContext.hpp index 8df9915b..954e11d8 100644 --- a/src/server/RunContext.hpp +++ b/src/server/RunContext.hpp @@ -80,10 +80,10 @@ public: */ bool notify(LV2_URID key = 0, FrameTime time = 0, - PortImpl* port = 0, + PortImpl* port = nullptr, uint32_t size = 0, LV2_URID type = 0, - const void* body = NULL); + const void* body = nullptr); /** Emit pending notifications in some other non-realtime thread. */ void emit_notifications(FrameTime end); diff --git a/src/server/UndoStack.cpp b/src/server/UndoStack.cpp index de4c64ca..dad211ad 100644 --- a/src/server/UndoStack.cpp +++ b/src/server/UndoStack.cpp @@ -61,10 +61,10 @@ UndoStack::ignore_later_event(const LV2_Atom* first, const LV2_Atom_Object* f = (const LV2_Atom_Object*)first; const LV2_Atom_Object* s = (const LV2_Atom_Object*)second; if (f->body.otype == _uris.patch_Set && f->body.otype == s->body.otype) { - const LV2_Atom* f_subject = NULL; - const LV2_Atom* f_property = NULL; - const LV2_Atom* s_subject = NULL; - const LV2_Atom* s_property = NULL; + const LV2_Atom* f_subject = nullptr; + const LV2_Atom* f_property = nullptr; + const LV2_Atom* s_subject = nullptr; + const LV2_Atom* s_property = nullptr; lv2_atom_object_get(f, (LV2_URID)_uris.patch_subject, &f_subject, (LV2_URID)_uris.patch_property, &f_property, @@ -136,7 +136,7 @@ struct ListContext { SerdNode start_node(SerdWriter* writer) { const SerdNode node = ids.get(); - serd_writer_write_statement(writer, flags, NULL, &s, &p, &node, NULL, NULL); + serd_writer_write_statement(writer, flags, nullptr, &s, &p, &node, nullptr, nullptr); return node; } @@ -147,7 +147,7 @@ struct ListContext { // node rdf:first value p = serd_node_from_string(SERD_URI, NS_RDF "first"); flags = SERD_LIST_CONT; - serd_writer_write_statement(writer, flags|oflags, NULL, &node, &p, value, NULL, NULL); + serd_writer_write_statement(writer, flags|oflags, nullptr, &node, &p, value, nullptr, nullptr); end_node(writer, &node); } @@ -160,7 +160,7 @@ struct ListContext { void end(SerdWriter* writer) { const SerdNode nil = serd_node_from_string(SERD_URI, NS_RDF "nil"); - serd_writer_write_statement(writer, flags, NULL, &s, &p, &nil, NULL, NULL); + serd_writer_write_statement(writer, flags, nullptr, &s, &p, &nil, nullptr, nullptr); } BlankIDs& ids; @@ -181,7 +181,7 @@ UndoStack::write_entry(Sratom* sratom, // entry rdf:type ingen:UndoEntry SerdNode p = serd_node_from_string(SERD_URI, USTR(INGEN_NS "time")); SerdNode o = serd_node_from_string(SERD_LITERAL, USTR(time_str)); - serd_writer_write_statement(writer, SERD_ANON_CONT, NULL, subject, &p, &o, NULL, NULL); + serd_writer_write_statement(writer, SERD_ANON_CONT, nullptr, subject, &p, &o, nullptr, nullptr); p = serd_node_from_string(SERD_URI, USTR(INGEN_NS "events")); @@ -206,7 +206,7 @@ UndoStack::write_entry(Sratom* sratom, void UndoStack::save(FILE* stream, const char* name) { - SerdEnv* env = serd_env_new(NULL); + SerdEnv* env = serd_env_new(nullptr); serd_env_set_prefix_from_strings(env, USTR("atom"), USTR(LV2_ATOM_PREFIX)); serd_env_set_prefix_from_strings(env, USTR("ingen"), USTR(INGEN_NS)); serd_env_set_prefix_from_strings(env, USTR("patch"), USTR(LV2_PATCH_PREFIX)); diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index 306c7533..8937b327 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -40,8 +40,8 @@ Connect::Connect(Engine& engine, const Ingen::Connect& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) - , _graph(NULL) - , _head(NULL) + , _graph(nullptr) + , _head(nullptr) {} bool diff --git a/src/server/events/Copy.cpp b/src/server/events/Copy.cpp index c83acb6e..b1cea1db 100644 --- a/src/server/events/Copy.cpp +++ b/src/server/events/Copy.cpp @@ -37,9 +37,9 @@ Copy::Copy(Engine& engine, const Ingen::Copy& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) - , _old_block(NULL) - , _parent(NULL) - , _block(NULL) + , _old_block(nullptr) + , _parent(nullptr) + , _block(nullptr) {} bool diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp index c636bf3c..d2a7d350 100644 --- a/src/server/events/CreateBlock.cpp +++ b/src/server/events/CreateBlock.cpp @@ -44,8 +44,8 @@ CreateBlock::CreateBlock(Engine& engine, : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) - , _graph(NULL) - , _block(NULL) + , _graph(nullptr) + , _block(nullptr) {} bool @@ -116,7 +116,7 @@ CreateBlock::pre_process(PreProcessContext& ctx) } // Load state from directory if given in properties - LilvState* state = NULL; + LilvState* state = nullptr; Properties::iterator s = _properties.find(uris.state_state); if (s != _properties.end() && s->second.type() == uris.forge.Path) { state = LV2Block::load_state(_engine.world(), s->second.ptr<char>()); diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp index a22160ba..7a2c7304 100644 --- a/src/server/events/CreateGraph.cpp +++ b/src/server/events/CreateGraph.cpp @@ -40,8 +40,8 @@ CreateGraph::CreateGraph(Engine& engine, : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) - , _graph(NULL) - , _parent(NULL) + , _graph(nullptr) + , _parent(nullptr) {} CreateGraph::~CreateGraph() diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index bc43ca41..e17b8b01 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -46,9 +46,9 @@ CreatePort::CreatePort(Engine& engine, , _path(path) , _port_type(PortType::UNKNOWN) , _buf_type(0) - , _graph(NULL) - , _graph_port(NULL) - , _engine_port(NULL) + , _graph(nullptr) + , _graph_port(nullptr) + , _engine_port(nullptr) , _properties(properties) { const Ingen::URIs& uris = _engine.world()->uris(); diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index b83dcef9..e50e5fa8 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -41,8 +41,8 @@ Delete::Delete(Engine& engine, const Ingen::Del& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) - , _engine_port(NULL) - , _disconnect_event(NULL) + , _engine_port(nullptr) + , _disconnect_event(nullptr) { if (uri_is_path(msg.uri)) { _path = uri_to_path(msg.uri); @@ -142,7 +142,7 @@ Delete::execute(RunContext& context) _engine.control_bindings()->remove(context, _removed_bindings); } - GraphImpl* parent = _block ? _block->parent_graph() : NULL; + GraphImpl* parent = _block ? _block->parent_graph() : nullptr; if (_port) { // Adjust port indices if necessary for (size_t i = 0; i < _ports_array->size(); ++i) { diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 0b26b797..e5ff8325 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -47,13 +47,13 @@ Delta::Delta(Engine& engine, SampleCount timestamp, const Ingen::Put& msg) : Event(engine, client, msg.seq, timestamp) - , _create_event(NULL) + , _create_event(nullptr) , _subject(msg.uri) , _properties(msg.properties) - , _object(NULL) - , _graph(NULL) - , _binding(NULL) - , _state(NULL) + , _object(nullptr) + , _graph(nullptr) + , _binding(nullptr) + , _state(nullptr) , _context(msg.ctx) , _type(Type::PUT) , _block(false) @@ -66,14 +66,14 @@ Delta::Delta(Engine& engine, SampleCount timestamp, const Ingen::Delta& msg) : Event(engine, client, msg.seq, timestamp) - , _create_event(NULL) + , _create_event(nullptr) , _subject(msg.uri) , _properties(msg.add) , _remove(msg.remove) - , _object(NULL) - , _graph(NULL) - , _binding(NULL) - , _state(NULL) + , _object(nullptr) + , _graph(nullptr) + , _binding(nullptr) + , _state(nullptr) , _context(msg.ctx) , _type(Type::PATCH) , _block(false) @@ -86,13 +86,13 @@ Delta::Delta(Engine& engine, SampleCount timestamp, const Ingen::SetProperty& msg) : Event(engine, client, msg.seq, timestamp) - , _create_event(NULL) + , _create_event(nullptr) , _subject(msg.subject) , _properties{{msg.predicate, msg.value}} - , _object(NULL) - , _graph(NULL) - , _binding(NULL) - , _state(NULL) + , _object(nullptr) + , _graph(nullptr) + , _binding(nullptr) + , _state(nullptr) , _context(msg.ctx) , _type(Type::SET) , _block(false) @@ -159,14 +159,14 @@ static LilvNode* get_file_node(LilvWorld* lworld, const URIs& uris, const Atom& value) { if (value.type() == uris.atom_Path) { - return lilv_new_file_uri(lworld, NULL, value.ptr<char>()); + return lilv_new_file_uri(lworld, nullptr, value.ptr<char>()); } else if (uris.forge.is_uri(value)) { const std::string str = uris.forge.str(value, false); if (str.substr(0, 5) == "file:") { return lilv_new_uri(lworld, value.ptr<char>()); } } - return NULL; + return nullptr; } bool @@ -324,7 +324,7 @@ Delta::pre_process(PreProcessContext& ctx) } } - BlockImpl* block = NULL; + BlockImpl* block = nullptr; PortImpl* port = dynamic_cast<PortImpl*>(_object); if (port) { if (key == uris.ingen_broadcast) { diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index f043d7dc..7e38ffe1 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -43,8 +43,8 @@ Disconnect::Disconnect(Engine& engine, const Ingen::Disconnect& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) - , _graph(NULL) - , _impl(NULL) + , _graph(nullptr) + , _impl(nullptr) { } @@ -150,7 +150,7 @@ Disconnect::pre_process(PreProcessContext& ctx) return Event::pre_process_done(Status::NOT_FOUND, _msg.head); } - if (tail_block == NULL || head_block == NULL) { + if (tail_block == nullptr || head_block == nullptr) { return Event::pre_process_done(Status::PARENT_NOT_FOUND, _msg.head); } diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index afb9c8cb..6d018c81 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -43,9 +43,9 @@ DisconnectAll::DisconnectAll(Engine& engine, const Ingen::DisconnectAll& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) - , _parent(NULL) - , _block(NULL) - , _port(NULL) + , _parent(nullptr) + , _block(nullptr) + , _port(nullptr) , _deleting(false) { } diff --git a/src/server/events/Get.cpp b/src/server/events/Get.cpp index 64af9363..e4a5c760 100644 --- a/src/server/events/Get.cpp +++ b/src/server/events/Get.cpp @@ -39,8 +39,8 @@ Get::Get(Engine& engine, const Ingen::Get& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) - , _object(NULL) - , _plugin(NULL) + , _object(nullptr) + , _plugin(nullptr) {} bool @@ -56,9 +56,9 @@ Get::pre_process(PreProcessContext& ctx) return Event::pre_process_done(Status::SUCCESS); } else if (uri_is_path(uri)) { if ((_object = _engine.store()->get(uri_to_path(uri)))) { - const BlockImpl* block = NULL; - const GraphImpl* graph = NULL; - const PortImpl* port = NULL; + const BlockImpl* block = nullptr; + const GraphImpl* graph = nullptr; + const PortImpl* port = nullptr; if ((graph = dynamic_cast<const GraphImpl*>(_object))) { _response.put_graph(graph); } else if ((block = dynamic_cast<const BlockImpl*>(_object))) { diff --git a/src/server/ingen_jack.cpp b/src/server/ingen_jack.cpp index 43d25aa7..38326c20 100644 --- a/src/server/ingen_jack.cpp +++ b/src/server/ingen_jack.cpp @@ -42,7 +42,7 @@ struct IngenJackModule : public Ingen::Module { const std::string server_name = s.is_valid() ? s.ptr<char>() : ""; driver->attach(server_name, world->conf().option("jack-name").ptr<char>(), - NULL); + nullptr); ((Server::Engine*)world->engine().get())->set_driver( SPtr<Server::Driver>(driver)); } diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index b3489d6d..2ad2a1f1 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -106,7 +106,7 @@ public: *this) , _from_ui(ui_ring_size(block_length)) , _to_ui(ui_ring_size(block_length)) - , _root_graph(NULL) + , _root_graph(nullptr) , _notify_capacity(0) , _block_length(block_length) , _seq_size(seq_size) @@ -159,7 +159,7 @@ public: // No copying necessary, host buffers are used directly // Reset graph port buffer pointer to no longer point to the Jack buffer if (graph_port->is_driver_port()) { - graph_port->set_driver_buffer(NULL, 0); + graph_port->set_driver_buffer(nullptr, 0); } } @@ -202,7 +202,7 @@ public: } } - return NULL; + return nullptr; } /** Add a port. Called only during init or restore. */ @@ -217,7 +217,7 @@ public: /** Remove a port. Called only during init or restore. */ virtual void remove_port(RunContext& context, EnginePort* port) { const uint32_t index = port->graph_port()->index(); - _ports[index] = NULL; + _ports[index] = nullptr; } /** Unused since LV2 has no dynamic ports. */ @@ -289,7 +289,7 @@ public: void consume_from_ui() { const uint32_t read_space = _from_ui.read_space(); - void* buf = NULL; + void* buf = nullptr; for (uint32_t read = 0; read < read_space;) { LV2_Atom atom; if (!_from_ui.read(sizeof(LV2_Atom), &atom)) { @@ -423,11 +423,11 @@ ingen_lv2_main(SPtr<Engine> engine, LV2Driver* driver) struct IngenPlugin { IngenPlugin() - : world(NULL) - , main(NULL) - , map(NULL) + : world(nullptr) + , main(nullptr) + , map(nullptr) , argc(0) - , argv(NULL) + , argv(nullptr) {} Ingen::World* world; @@ -464,10 +464,10 @@ ingen_instantiate(const LV2_Descriptor* descriptor, const LV2_Feature*const* features) { // Get features from features array - LV2_URID_Map* map = NULL; - LV2_URID_Unmap* unmap = NULL; - LV2_Log_Log* log = NULL; - const LV2_Options_Option* options = NULL; + LV2_URID_Map* map = nullptr; + LV2_URID_Unmap* unmap = nullptr; + LV2_Log_Log* log = nullptr; + const LV2_Options_Option* options = nullptr; for (int i = 0; features[i]; ++i) { if (!strcmp(features[i]->URI, LV2_URID__map)) { map = (LV2_URID_Map*)features[i]->data; @@ -485,21 +485,21 @@ ingen_instantiate(const LV2_Descriptor* descriptor, if (!map) { lv2_log_error(&logger, "host did not provide URI map feature\n"); - return NULL; + return nullptr; } else if (!unmap) { lv2_log_error(&logger, "host did not provide URI unmap feature\n"); - return NULL; + return nullptr; } set_bundle_path(bundle_path); const std::string manifest_path = Ingen::bundle_file_path("manifest.ttl"); SerdNode manifest_node = serd_node_new_file_uri( - (const uint8_t*)manifest_path.c_str(), NULL, NULL, true); + (const uint8_t*)manifest_path.c_str(), nullptr, nullptr, true); Lib::Graphs graphs = find_graphs((const char*)manifest_node.buf); serd_node_free(&manifest_node); - const LV2Graph* graph = NULL; + const LV2Graph* graph = nullptr; for (const auto& g : graphs) { if (g->uri == descriptor->URI) { graph = g.get(); @@ -509,7 +509,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor, if (!graph) { lv2_log_error(&logger, "could not find graph <%s>\n", descriptor->URI); - return NULL; + return nullptr; } IngenPlugin* plugin = new IngenPlugin(); @@ -642,7 +642,7 @@ ingen_deactivate(LV2_Handle instance) if (me->main) { me->main->join(); delete me->main; - me->main = NULL; + me->main = nullptr; } } @@ -685,8 +685,8 @@ ingen_save(LV2_Handle instance, { IngenPlugin* plugin = (IngenPlugin*)instance; - LV2_State_Map_Path* map_path = NULL; - LV2_State_Make_Path* make_path = NULL; + LV2_State_Map_Path* map_path = nullptr; + LV2_State_Make_Path* make_path = nullptr; get_state_features(features, &map_path, &make_path); if (!map_path || !make_path || !plugin->map) { plugin->world->log().error("Missing state:mapPath, state:makePath, or urid:Map\n"); @@ -731,8 +731,8 @@ ingen_restore(LV2_Handle instance, { IngenPlugin* plugin = (IngenPlugin*)instance; - LV2_State_Map_Path* map_path = NULL; - get_state_features(features, &map_path, NULL); + LV2_State_Map_Path* map_path = nullptr; + get_state_features(features, &map_path, nullptr); if (!map_path) { plugin->world->log().error("Missing state:mapPath\n"); return LV2_STATE_ERR_NO_FEATURE; @@ -788,7 +788,7 @@ ingen_extension_data(const char* uri) if (!strcmp(uri, LV2_STATE__interface)) { return &state; } - return NULL; + return nullptr; } LV2Graph::LV2Graph(const Parser::ResourceRecord& record) @@ -809,7 +809,7 @@ Lib::Lib(const char* bundle_path) Ingen::set_bundle_path(bundle_path); const std::string manifest_path = Ingen::bundle_file_path("manifest.ttl"); SerdNode manifest_node = serd_node_new_file_uri( - (const uint8_t*)manifest_path.c_str(), NULL, NULL, true); + (const uint8_t*)manifest_path.c_str(), nullptr, nullptr, true); graphs = find_graphs((const char*)manifest_node.buf); @@ -827,7 +827,7 @@ static const LV2_Descriptor* lib_get_plugin(LV2_Lib_Handle handle, uint32_t index) { Lib* lib = (Lib*)handle; - return index < lib->graphs.size() ? &lib->graphs[index]->descriptor : NULL; + return index < lib->graphs.size() ? &lib->graphs[index]->descriptor : nullptr; } /** LV2 plugin library entry point */ diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index 754d76f2..9b157d54 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -225,7 +225,7 @@ NoteNode::note_on(RunContext& context, uint8_t note_num, uint8_t velocity, Frame assert(note_num <= 127); Key* key = &_keys[note_num]; - Voice* voice = NULL; + Voice* voice = nullptr; uint32_t voice_num = 0; if (key->state != Key::State::OFF) { @@ -242,7 +242,7 @@ NoteNode::note_on(RunContext& context, uint8_t note_num, uint8_t velocity, Frame } // If we didn't find a free one, steal the oldest - if (voice == NULL) { + if (voice == nullptr) { voice_num = 0; voice = &(*_voices)[0]; FrameTime oldest_time = (*_voices)[0].time; @@ -254,7 +254,7 @@ NoteNode::note_on(RunContext& context, uint8_t note_num, uint8_t velocity, Frame } } } - assert(voice != NULL); + assert(voice != nullptr); assert(voice == &(*_voices)[voice_num]); // Update stolen key, if applicable @@ -325,19 +325,19 @@ NoteNode::free_voice(RunContext& context, uint32_t voice, FrameTime time) assert(time >= context.start() && time <= context.end()); // Find a key to reassign to the freed voice (the newest, if there is one) - Key* replace_key = NULL; + Key* replace_key = nullptr; uint8_t replace_key_num = 0; for (uint8_t i = 0; i <= 127; ++i) { if (_keys[i].state == Key::State::ON_UNASSIGNED) { - if (replace_key == NULL || _keys[i].time > replace_key->time) { + if (replace_key == nullptr || _keys[i].time > replace_key->time) { replace_key = &_keys[i]; replace_key_num = i; } } } - if (replace_key != NULL) { // Found a key to assign to freed voice + if (replace_key != nullptr) { // Found a key to assign to freed voice assert(&_keys[replace_key_num] == replace_key); assert(replace_key->state == Key::State::ON_UNASSIGNED); diff --git a/src/server/mix.cpp b/src/server/mix.cpp index 897a26e6..3e7634fe 100644 --- a/src/server/mix.cpp +++ b/src/server/mix.cpp @@ -71,18 +71,18 @@ mix(const RunContext& context, } else if (dst->is_sequence()) { const LV2_Atom_Event* iters[num_srcs]; for (uint32_t i = 0; i < num_srcs; ++i) { - iters[i] = NULL; + iters[i] = nullptr; if (srcs[i]->is_sequence()) { const LV2_Atom_Sequence* seq = srcs[i]->get<const LV2_Atom_Sequence>(); iters[i] = lv2_atom_sequence_begin(&seq->body); if (is_end(srcs[i], iters[i])) { - iters[i] = NULL; + iters[i] = nullptr; } } } while (true) { - const LV2_Atom_Event* first = NULL; + const LV2_Atom_Event* first = nullptr; uint32_t first_i = 0; for (uint32_t i = 0; i < num_srcs; ++i) { const LV2_Atom_Event* const ev = iters[i]; @@ -99,7 +99,7 @@ mix(const RunContext& context, iters[first_i] = lv2_atom_sequence_next(first); if (is_end(srcs[first_i], iters[first_i])) { - iters[first_i] = NULL; + iters[first_i] = nullptr; } } else { break; |