From 6bd47c969222ee9e5e89cd00ebea9141c215e55c Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 16 Jan 2019 15:16:05 -0800 Subject: lib: rfnoc: apply clang-format This is a continuation of 967be2a4. $ clang-format -i -style=file host/lib/rfnoc/*.cpp --- host/lib/rfnoc/sink_node_ctrl.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'host/lib/rfnoc/sink_node_ctrl.cpp') diff --git a/host/lib/rfnoc/sink_node_ctrl.cpp b/host/lib/rfnoc/sink_node_ctrl.cpp index 03e259783..53a26d7ed 100644 --- a/host/lib/rfnoc/sink_node_ctrl.cpp +++ b/host/lib/rfnoc/sink_node_ctrl.cpp @@ -5,18 +5,16 @@ // SPDX-License-Identifier: GPL-3.0-or-later // -#include #include #include +#include #include using namespace uhd::rfnoc; size_t sink_node_ctrl::connect_upstream( - node_ctrl_base::sptr upstream_node, - size_t port, - const uhd::device_addr_t &args -) { + node_ctrl_base::sptr upstream_node, size_t port, const uhd::device_addr_t& args) +{ boost::mutex::scoped_lock lock(_input_mutex); port = _request_input_port(port, args); _register_upstream_node(upstream_node, port); @@ -25,7 +23,8 @@ size_t sink_node_ctrl::connect_upstream( void sink_node_ctrl::set_tx_streamer(bool active, const size_t port) { - UHD_RFNOC_BLOCK_TRACE() << "sink_node_ctrl::set_tx_streamer() " << active << " " << port ; + UHD_RFNOC_BLOCK_TRACE() << "sink_node_ctrl::set_tx_streamer() " << active << " " + << port; /* Enable all downstream connections: for(const node_ctrl_base::node_map_pair_t downstream_node: list_downstream_nodes()) { @@ -43,12 +42,11 @@ void sink_node_ctrl::set_tx_streamer(bool active, const size_t port) // Only enable 1:1 if (list_downstream_nodes().count(port)) { sink_node_ctrl::sptr this_downstream_block_ctrl = - boost::dynamic_pointer_cast(list_downstream_nodes().at(port).lock()); + boost::dynamic_pointer_cast( + list_downstream_nodes().at(port).lock()); if (this_downstream_block_ctrl) { this_downstream_block_ctrl->set_tx_streamer( - active, - get_downstream_port(port) - ); + active, get_downstream_port(port)); } } @@ -56,22 +54,22 @@ void sink_node_ctrl::set_tx_streamer(bool active, const size_t port) } size_t sink_node_ctrl::_request_input_port( - const size_t suggested_port, - const uhd::device_addr_t & -) const { + const size_t suggested_port, const uhd::device_addr_t&) const +{ return utils::node_map_find_first_free(_upstream_nodes, suggested_port); } void sink_node_ctrl::_register_upstream_node( - node_ctrl_base::sptr upstream_node, - size_t port -) { + node_ctrl_base::sptr upstream_node, size_t port) +{ // Do all the checks: if (port == ANY_PORT) { throw uhd::type_error("Invalid input port number."); } if (_upstream_nodes.count(port) and not _upstream_nodes[port].expired()) { - throw uhd::runtime_error(str(boost::format("On node %s, input port %d is already connected.") % unique_id() % port)); + throw uhd::runtime_error( + str(boost::format("On node %s, input port %d is already connected.") + % unique_id() % port)); } if (not boost::dynamic_pointer_cast(upstream_node)) { throw uhd::type_error("Attempting to register a non-source block as upstream."); -- cgit v1.2.3