diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2019-08-07 21:45:12 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2019-08-09 23:04:28 +0200 |
commit | f7bbf2c1d8d780294f3e016aff239ca35eb6516e (patch) | |
tree | e09ab6112e02b2215b2d59ac24d3d6ea2edac745 /gr-blocks/lib/head_impl.cc | |
parent | 78431dc6941e3acc67c858277dfe4a0ed583643c (diff) |
Tree: clang-format without the include sorting
Diffstat (limited to 'gr-blocks/lib/head_impl.cc')
-rw-r--r-- | gr-blocks/lib/head_impl.cc | 60 |
1 files changed, 27 insertions, 33 deletions
diff --git a/gr-blocks/lib/head_impl.cc b/gr-blocks/lib/head_impl.cc index 4c33f9f08e..83dc855f55 100644 --- a/gr-blocks/lib/head_impl.cc +++ b/gr-blocks/lib/head_impl.cc @@ -29,47 +29,41 @@ #include <string.h> namespace gr { - namespace blocks { +namespace blocks { - head::sptr - head::make(size_t sizeof_stream_item, uint64_t nitems) - { - return gnuradio::get_initial_sptr - (new head_impl(sizeof_stream_item, nitems)); - } +head::sptr head::make(size_t sizeof_stream_item, uint64_t nitems) +{ + return gnuradio::get_initial_sptr(new head_impl(sizeof_stream_item, nitems)); +} - head_impl::head_impl(size_t sizeof_stream_item, uint64_t nitems) - : sync_block("head", - io_signature::make(1, 1, sizeof_stream_item), - io_signature::make(1, 1, sizeof_stream_item)), - d_nitems(nitems), d_ncopied_items(0) - { - } +head_impl::head_impl(size_t sizeof_stream_item, uint64_t nitems) + : sync_block("head", + io_signature::make(1, 1, sizeof_stream_item), + io_signature::make(1, 1, sizeof_stream_item)), + d_nitems(nitems), + d_ncopied_items(0) +{ +} - head_impl::~head_impl() - { - } +head_impl::~head_impl() {} - int - head_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - if(d_ncopied_items >= d_nitems) - return -1; // Done! +int head_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + if (d_ncopied_items >= d_nitems) + return -1; // Done! - unsigned n = std::min(d_nitems - d_ncopied_items, - (uint64_t)noutput_items); + unsigned n = std::min(d_nitems - d_ncopied_items, (uint64_t)noutput_items); - if(n == 0) + if (n == 0) return 0; - memcpy(output_items[0], input_items[0], - n * input_signature()->sizeof_stream_item (0)); - d_ncopied_items += n; + memcpy(output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(0)); + d_ncopied_items += n; - return n; - } + return n; +} - } /* namespace blocks */ +} /* namespace blocks */ } /* namespace gr */ |