From 9994cdebb60ecffcf81ced46ccfd12968ea3b2da Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 18 Aug 2022 02:04:21 -0400 Subject: Use consistent spacing for line comments --- src/ColorContext.cpp | 2 +- src/Configuration.cpp | 10 +++++----- src/Log.cpp | 2 +- src/Parser.cpp | 4 ++-- src/SocketReader.cpp | 8 ++++---- src/URI.cpp | 2 +- src/client/GraphModel.cpp | 2 +- src/client/PluginModel.cpp | 2 +- src/client/PluginUI.cpp | 2 +- src/gui/GraphCanvas.cpp | 2 +- src/gui/NodeModule.cpp | 2 +- src/gui/Port.cpp | 4 ++-- src/server/BlockImpl.cpp | 2 +- src/server/BlockImpl.hpp | 2 +- src/server/Buffer.cpp | 8 ++++---- src/server/CompiledGraph.hpp | 2 +- src/server/ControlBindings.cpp | 4 ++-- src/server/GraphImpl.hpp | 18 ++++++++++-------- src/server/PortImpl.cpp | 2 +- src/server/PostProcessor.cpp | 2 +- src/server/PreProcessor.cpp | 6 +++--- src/server/PreProcessor.hpp | 10 +++++----- src/server/SocketListener.cpp | 2 +- src/server/SocketServer.hpp | 2 +- src/server/Task.cpp | 2 +- src/server/Task.hpp | 6 +++--- src/server/Worker.cpp | 3 ++- src/server/events/Delta.cpp | 8 ++++---- src/server/ingen_lv2.cpp | 6 +++--- src/server/internals/Note.cpp | 2 +- src/server/internals/Note.hpp | 2 +- src/server/mix.cpp | 6 +++--- 32 files changed, 70 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/ColorContext.cpp b/src/ColorContext.cpp index 827395f2..a4e60ca5 100644 --- a/src/ColorContext.cpp +++ b/src/ColorContext.cpp @@ -41,4 +41,4 @@ ColorContext::~ColorContext() } } -} // namespace ingen +} // namespace ingen diff --git a/src/Configuration.cpp b/src/Configuration.cpp index 794cf193..5af9fea1 100644 --- a/src/Configuration.cpp +++ b/src/Configuration.cpp @@ -193,9 +193,9 @@ Configuration::parse(int argc, char** argv) if (o->second.type == _forge.Bool) { // --flag o->second.value = _forge.make(true); - } else if (equals) { // --opt=val + } else if (equals) { // --opt=val set_value_from_string(o->second, equals + 1); - } else if (++i < argc) { // --opt val + } else if (++i < argc) { // --opt val set_value_from_string(o->second, argv[i]); } else { throw OptionError(fmt("Missing value for `%1%'", name)); @@ -211,15 +211,15 @@ Configuration::parse(int argc, char** argv) } const auto o = _options.find(n->second); - if (j < len - 1) { // Non-final POSIX style flag + if (j < len - 1) { // Non-final POSIX style flag if (o->second.type != _forge.Bool) { throw OptionError( fmt("Missing value for `%1%'", letter)); } o->second.value = _forge.make(true); - } else if (o->second.type == _forge.Bool) { // -f + } else if (o->second.type == _forge.Bool) { // -f o->second.value = _forge.make(true); - } else if (++i < argc) { // -v val + } else if (++i < argc) { // -v val set_value_from_string(o->second, argv[i]); } else { throw OptionError(fmt("Missing value for `%1%'", letter)); diff --git a/src/Log.cpp b/src/Log.cpp index b52f470c..bc11fe3d 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -165,4 +165,4 @@ Log::Feature::feature(World& world, Node* block) return std::shared_ptr(f, &free_log_feature); } -} // namespace ingen +} // namespace ingen diff --git a/src/Parser.cpp b/src/Parser.cpp index dec0e28c..6e0ee7a1 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -195,7 +195,7 @@ get_port(ingen::World& world, const raul::Symbol port_sym(sym); const raul::Path port_path(parent.child(port_sym)); - props.erase(uris.lv2_symbol); // Don't set symbol property in engine + props.erase(uris.lv2_symbol); // Don't set symbol property in engine return make_pair(port_path, props); } @@ -381,7 +381,7 @@ parse_graph(ingen::World& world, } if (ctx != Resource::Graph::INTERNAL) { - return {graph_path}; // Not parsing graph internals, finished now + return {graph_path}; // Not parsing graph internals, finished now } // For each block in this graph diff --git a/src/SocketReader.cpp b/src/SocketReader.cpp index c7b64166..83854bf9 100644 --- a/src/SocketReader.cpp +++ b/src/SocketReader.cpp @@ -166,11 +166,11 @@ SocketReader::run() const int ret = poll(&pfd, 1, -1); if (ret == -1 || (pfd.revents & (POLLERR|POLLHUP|POLLNVAL))) { on_hangup(); - break; // Hangup + break; // Hangup } if (!ret) { - continue; // No data, shouldn't happen + continue; // No data, shouldn't happen } // Lock RDF world @@ -179,7 +179,7 @@ SocketReader::run() // Read until the next '.' SerdStatus st = serd_reader_read_chunk(reader); if (st == SERD_FAILURE || !_msg_node) { - continue; // Read nothing, e.g. just whitespace + continue; // Read nothing, e.g. just whitespace } if (st) { @@ -210,4 +210,4 @@ SocketReader::run() _socket.reset(); } -} // namespace ingen +} // namespace ingen diff --git a/src/URI.cpp b/src/URI.cpp index fb562410..339ca07c 100644 --- a/src/URI.cpp +++ b/src/URI.cpp @@ -128,4 +128,4 @@ URI::make_relative(const URI& base) const return URI(node, uri); } -} // namespace ingen +} // namespace ingen diff --git a/src/client/GraphModel.cpp b/src/client/GraphModel.cpp index 7829a241..2fed1fb3 100644 --- a/src/client/GraphModel.cpp +++ b/src/client/GraphModel.cpp @@ -85,7 +85,7 @@ GraphModel::remove_arcs_on(const std::shared_ptr& p) || arc->head_path().parent() == p->path() || arc->head_path() == p->path()) { _signal_removed_arc.emit(arc); - _arcs.erase(j); // Cuts our reference + _arcs.erase(j); // Cuts our reference } j = next; } diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 2b598e2c..306846ee 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -49,7 +49,7 @@ PluginModel::PluginModel(URIs& uris, if (uri.string().find("ingen-internals") != string::npos) { _type = uris.ingen_Internal.urid_atom(); } else { - _type = uris.lv2_Plugin.urid_atom(); // Assume LV2 and hope for the best... + _type = uris.lv2_Plugin.urid_atom(); // Assume LV2 and hope for the best... } } diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index a0a966a3..031caceb 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -78,7 +78,7 @@ lv2_ui_write(SuilController controller, const float value = *static_cast(buffer); if (port->value().type() == uris.atom_Float && value == port->value().get()) { - return; // Ignore feedback + return; // Ignore feedback } ui->signal_property_changed()( diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp index a14d9971..3acd510d 100644 --- a/src/gui/GraphCanvas.cpp +++ b/src/gui/GraphCanvas.cpp @@ -479,7 +479,7 @@ GraphCanvas::disconnection(const std::shared_ptr& arc) if (arc->head()->is_a(_app.uris().lv2_AudioPort)) { auto* const h = dynamic_cast(head); if (h) { - h->activity(_app.forge().make(0.0f)); // Reset peaks + h->activity(_app.forge().make(0.0f)); // Reset peaks } } } else { diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 6905318a..1b090c4f 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -127,7 +127,7 @@ bool NodeModule::idle_init() { if (_block->ports().empty()) { - return true; // Need to embed GUI, but ports haven't shown up yet + return true; // Need to embed GUI, but ports haven't shown up yet } // Ports have arrived, embed GUI and deregister this callback diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index e4e02aa6..84fbd165 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -223,11 +223,11 @@ Port::on_value_changed(double value) const URIs& uris = _app.uris(); const Atom& current_value = model()->value(); if (current_value.type() != uris.forge.Float) { - return; // Non-float, unsupported + return; // Non-float, unsupported } if (current_value.get() == static_cast(value)) { - return; // No change + return; // No change } const Atom atom = _app.forge().make(float(value)); diff --git a/src/server/BlockImpl.cpp b/src/server/BlockImpl.cpp index ee6b5786..81474126 100644 --- a/src/server/BlockImpl.cpp +++ b/src/server/BlockImpl.cpp @@ -206,7 +206,7 @@ BlockImpl::bypass(RunContext& ctx) PortImpl* in = nth_port_by_type(i, true, t); PortImpl* out = nth_port_by_type(i, false, t); if (!out) { - break; // Finished writing all outputs + break; // Finished writing all outputs } if (in) { diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp index 448ebb99..ed3566aa 100644 --- a/src/server/BlockImpl.hpp +++ b/src/server/BlockImpl.hpp @@ -62,7 +62,7 @@ class Worker; * \ingroup engine */ class BlockImpl : public NodeImpl - , public boost::intrusive::slist_base_hook<> // In GraphImpl + , public boost::intrusive::slist_base_hook<> // In GraphImpl { public: using Ports = raul::Array; diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp index 426cdb27..f561871f 100644 --- a/src/server/Buffer.cpp +++ b/src/server/Buffer.cpp @@ -217,7 +217,7 @@ Buffer::port_data(PortType port_type, SampleCount offset) const static inline __m128 mm_abs_ps(__m128 x) { - const __m128 sign_mask = _mm_set1_ps(-0.0f); // -0.0f = 1 << 31 + const __m128 sign_mask = _mm_set1_ps(-0.0f); // -0.0f = 1 << 31 return _mm_andnot_ps(sign_mask, x); } #endif @@ -299,7 +299,7 @@ Buffer::append_event(int64_t frames, auto* atom = get(); if (atom->type == _factory.uris().atom_Chunk) { - clear(); // Chunk initialized with prepare_output_write(), clear + clear(); // Chunk initialized with prepare_output_write(), clear } if (sizeof(LV2_Atom) + atom->size + lv2_atom_pad_size(size) > _capacity) { @@ -339,14 +339,14 @@ Buffer::append_event_buffer(const Buffer* buf) reinterpret_cast(buf->get()); if (seq->atom.type == _factory.uris().atom_Chunk) { - clear(); // Chunk initialized with prepare_output_write(), clear + clear(); // Chunk initialized with prepare_output_write(), clear } const uint32_t total_size = lv2_atom_total_size(&seq->atom); uint8_t* const end = reinterpret_cast(seq) + total_size; const uint32_t n_bytes = bseq->atom.size - sizeof(bseq->body); if (sizeof(LV2_Atom) + total_size + n_bytes >= _capacity) { - return false; // Not enough space + return false; // Not enough space } memcpy(end, bseq + 1, n_bytes); diff --git a/src/server/CompiledGraph.hpp b/src/server/CompiledGraph.hpp index 8c2bb815..f33941aa 100644 --- a/src/server/CompiledGraph.hpp +++ b/src/server/CompiledGraph.hpp @@ -49,7 +49,7 @@ public: void run(RunContext& ctx); private: - friend class raul::Maid; ///< Allow make_managed to construct + friend class raul::Maid; ///< Allow make_managed to construct CompiledGraph(GraphImpl* graph); diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index ecbdf8cf..aefc8608 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -414,7 +414,7 @@ ControlBindings::pre_process(RunContext& ctx, Buffer* buffer) _feedback->clear(); if ((!_learn_binding && _bindings->empty()) || !buffer->get()) { - return; // Don't bother reading input + return; // Don't bother reading input } auto* seq = buffer->get(); @@ -424,7 +424,7 @@ ControlBindings::pre_process(RunContext& ctx, Buffer* buffer) const Key key = midi_event_key(ev->body.size, buf, value); if (_learn_binding && !!key) { - finish_learn(ctx, key); // Learn new binding + finish_learn(ctx, key); // Learn new binding } // Set all controls bound to this key diff --git a/src/server/GraphImpl.hpp b/src/server/GraphImpl.hpp index 185b858c..3746961a 100644 --- a/src/server/GraphImpl.hpp +++ b/src/server/GraphImpl.hpp @@ -204,14 +204,16 @@ public: Engine& engine() { return _engine; } private: - Engine& _engine; - uint32_t _poly_pre; ///< Pre-process thread only - uint32_t _poly_process; ///< Process thread only - raul::managed_ptr _compiled_graph; ///< Process thread only - PortList _inputs; ///< Pre-process thread only - PortList _outputs; ///< Pre-process thread only - Blocks _blocks; ///< Pre-process thread only - bool _process{false}; ///< True iff graph is enabled + using CompiledGraphPtr = raul::managed_ptr; + + Engine& _engine; + uint32_t _poly_pre; ///< Pre-process thread only + uint32_t _poly_process; ///< Process thread only + CompiledGraphPtr _compiled_graph; ///< Process thread only + PortList _inputs; ///< Pre-process thread only + PortList _outputs; ///< Pre-process thread only + Blocks _blocks; ///< Pre-process thread only + bool _process{false}; ///< True iff graph is enabled }; } // namespace server diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index f5012c81..68613e65 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -42,7 +42,7 @@ namespace ingen { namespace server { -static const uint32_t monitor_rate = 25.0; // Hz +static const uint32_t monitor_rate = 25.0; // Hz /** The length of time between monitor updates in frames */ static inline uint32_t diff --git a/src/server/PostProcessor.cpp b/src/server/PostProcessor.cpp index 88df994c..0e94efea 100644 --- a/src/server/PostProcessor.cpp +++ b/src/server/PostProcessor.cpp @@ -99,7 +99,7 @@ PostProcessor::process() // Post-process event ev->post_process(); - next = ev->next(); // [1] (see below) + next = ev->next(); // [1] (see below) } while (next && next->time() < end_time); /* Reached the tail (as far as we're concerned). There may be successors diff --git a/src/server/PreProcessor.cpp b/src/server/PreProcessor.cpp index beba06e2..7746d1db 100644 --- a/src/server/PreProcessor.cpp +++ b/src/server/PreProcessor.cpp @@ -109,14 +109,14 @@ PreProcessor::process(RunContext& ctx, PostProcessor& dest, size_t limit) } if (_block_state == BlockState::BLOCKED) { - break; // Waiting for PRE_UNBLOCKED + break; // Waiting for PRE_UNBLOCKED } if (ev->time() < ctx.start()) { - ev->set_time(ctx.start()); // Too late, nudge to context start + ev->set_time(ctx.start()); // Too late, nudge to context start } else if (_block_state != BlockState::PROCESSING && ev->time() >= ctx.end()) { - break; // Event is for a future cycle + break; // Event is for a future cycle } // Execute event diff --git a/src/server/PreProcessor.hpp b/src/server/PreProcessor.hpp index 832b545e..ff0b5fff 100644 --- a/src/server/PreProcessor.hpp +++ b/src/server/PreProcessor.hpp @@ -61,11 +61,11 @@ protected: private: enum class BlockState { - UNBLOCKED, ///< Normal, unblocked execution - PRE_BLOCKED, ///< Preprocess thread has enqueued blocking event - BLOCKED, ///< Process thread has reached blocking event - PRE_UNBLOCKED, ///< Preprocess thread has enqueued unblocking event - PROCESSING ///< Process thread is executing all events in-between + UNBLOCKED, ///< Normal, unblocked execution + PRE_BLOCKED, ///< Preprocess thread has enqueued blocking event + BLOCKED, ///< Process thread has reached blocking event + PRE_UNBLOCKED, ///< Preprocess thread has enqueued unblocking event + PROCESSING ///< Process thread is executing all events in-between }; void wait_for_block_state(const BlockState state) { diff --git a/src/server/SocketListener.cpp b/src/server/SocketListener.cpp index 640d575f..0d377732 100644 --- a/src/server/SocketListener.cpp +++ b/src/server/SocketListener.cpp @@ -141,7 +141,7 @@ ingen_listen(Engine* engine, raul::Socket* unix_sock, raul::Socket* net_sock) } if (unix_sock->fd() == -1 && net_sock->fd() == -1) { - return; // No sockets to listen to, exit thread + return; // No sockets to listen to, exit thread } struct pollfd pfds[2]; diff --git a/src/server/SocketServer.hpp b/src/server/SocketServer.hpp index ac8aa611..0531c44c 100644 --- a/src/server/SocketServer.hpp +++ b/src/server/SocketServer.hpp @@ -89,4 +89,4 @@ private: } // namespace server } // namespace ingen -#endif // INGEN_SERVER_SOCKET_SERVER_HPP +#endif // INGEN_SERVER_SOCKET_SERVER_HPP diff --git a/src/server/Task.cpp b/src/server/Task.cpp index ec9568b3..43db78e8 100644 --- a/src/server/Task.cpp +++ b/src/server/Task.cpp @@ -93,7 +93,7 @@ Task::get_task(RunContext& ctx) } if (_done_end >= _children.size()) { - return nullptr; // All child tasks are finished + return nullptr; // All child tasks are finished } // All child tasks claimed, but some are unfinished, steal a task diff --git a/src/server/Task.hpp b/src/server/Task.hpp index 83782098..b4e9848c 100644 --- a/src/server/Task.hpp +++ b/src/server/Task.hpp @@ -36,9 +36,9 @@ class Task { public: enum class Mode { - SINGLE, ///< Single block to run - SEQUENTIAL, ///< Elements must be run sequentially in order - PARALLEL ///< Elements may be run in any order in parallel + SINGLE, ///< Single block to run + SEQUENTIAL, ///< Elements must be run sequentially in order + PARALLEL ///< Elements may be run in any order in parallel }; Task(Mode mode, BlockImpl* block = nullptr) diff --git a/src/server/Worker.cpp b/src/server/Worker.cpp index bb282365..2da96ae6 100644 --- a/src/server/Worker.cpp +++ b/src/server/Worker.cpp @@ -36,8 +36,9 @@ namespace server { /// A message in the Worker::_requests ring struct MessageHeader { - LV2Block* block; ///< Node this message is from + LV2Block* block; ///< Node this message is from uint32_t size; ///< Size of following data + // `size' bytes of data follow here }; diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 67319423..71d4b48f 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -246,7 +246,7 @@ Delta::pre_process(PreProcessContext& ctx) } if (_create_event) { if (_create_event->pre_process(ctx)) { - _object = _engine.store()->get(path); // Get object for setting + _object = _engine.store()->get(path); // Get object for setting } else { return Event::pre_process_done(Status::CREATION_FAILED, _subject); } @@ -358,7 +358,7 @@ Delta::pre_process(PreProcessContext& ctx) } } else if ((block = dynamic_cast(_object))) { if (key == uris.midi_binding && value == uris.patch_wildcard) { - op = SpecialType::CONTROL_BINDING; // Internal block learn + op = SpecialType::CONTROL_BINDING; // Internal block learn } else if (key == uris.ingen_enabled) { if (value.type() == uris.forge.Bool) { op = SpecialType::ENABLE; @@ -599,13 +599,13 @@ Delta::post_process() if (_create_event) { _create_event->post_process(); if (_create_event->status() != Status::SUCCESS) { - return; // Creation failed, nothing else to do + return; // Creation failed, nothing else to do } } for (auto& s : _set_events) { if (s->synthetic() || s->status() != Status::SUCCESS) { - s->post_process(); // Set failed, report error + s->post_process(); // Set failed, report error } } diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 8d8a2b75..851a83fb 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -146,7 +146,7 @@ public: lv2_atom_total_size( static_cast(lv2_buf))); - if (graph_port->symbol() == "control") { // TODO: Safe to use index? + if (graph_port->symbol() == "control") { // TODO: Safe to use index? auto* seq = reinterpret_cast(lv2_buf); bool enqueued = false; @@ -360,14 +360,14 @@ public: if (seq->atom.size + lv2_atom_pad_size( sizeof(LV2_Atom_Event) + atom.size) > _notify_capacity) { - break; // Output port buffer full, resume next time + break; // Output port buffer full, resume next time } auto* ev = reinterpret_cast( reinterpret_cast(seq) + lv2_atom_total_size(&seq->atom)); - ev->time.frames = 0; // TODO: Time? + ev->time.frames = 0; // TODO: Time? ev->body = atom; _to_ui.skip(sizeof(LV2_Atom)); diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index ea5019a8..976e43f9 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -359,7 +359,7 @@ NoteNode::free_voice(RunContext& ctx, uint32_t voice, FrameTime time) } } - if (replace_key != nullptr) { // 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/internals/Note.hpp b/src/server/internals/Note.hpp index 082a852c..3aa3217e 100644 --- a/src/server/internals/Note.hpp +++ b/src/server/internals/Note.hpp @@ -105,7 +105,7 @@ private: raul::managed_ptr _prepared_voices; Key _keys[128]; - bool _sustain{false}; ///< Whether or not hold pedal is depressed + bool _sustain{false}; ///< Whether or not hold pedal is depressed InputPort* _midi_in_port; OutputPort* _freq_port; diff --git a/src/server/mix.cpp b/src/server/mix.cpp index a1e0c276..9c578d11 100644 --- a/src/server/mix.cpp +++ b/src/server/mix.cpp @@ -59,15 +59,15 @@ mix(const RunContext& ctx, const SampleCount end = ctx.nframes(); for (uint32_t i = 1; i < num_srcs; ++i) { const Sample* __restrict const in = srcs[i]->samples(); - if (srcs[i]->is_control()) { // control => audio + if (srcs[i]->is_control()) { // control => audio for (SampleCount j = 0; j < end; ++j) { out[j] += in[0]; } - } else if (srcs[i]->is_audio()) { // audio => audio + } else if (srcs[i]->is_audio()) { // audio => audio for (SampleCount j = 0; j < end; ++j) { out[j] += in[j]; } - } else if (srcs[i]->is_sequence()) { // sequence => audio + } else if (srcs[i]->is_sequence()) { // sequence => audio dst->render_sequence(ctx, srcs[i], true); } } -- cgit v1.2.1