summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/mute_impl.cc
diff options
context:
space:
mode:
authorMarcus Müller <mmueller@gnuradio.org>2019-08-07 21:45:12 +0200
committerMarcus Müller <marcus@hostalia.de>2019-08-09 23:04:28 +0200
commitf7bbf2c1d8d780294f3e016aff239ca35eb6516e (patch)
treee09ab6112e02b2215b2d59ac24d3d6ea2edac745 /gr-blocks/lib/mute_impl.cc
parent78431dc6941e3acc67c858277dfe4a0ed583643c (diff)
Tree: clang-format without the include sorting
Diffstat (limited to 'gr-blocks/lib/mute_impl.cc')
-rw-r--r--gr-blocks/lib/mute_impl.cc94
1 files changed, 45 insertions, 49 deletions
diff --git a/gr-blocks/lib/mute_impl.cc b/gr-blocks/lib/mute_impl.cc
index 081dd81b35..34c0d4094e 100644
--- a/gr-blocks/lib/mute_impl.cc
+++ b/gr-blocks/lib/mute_impl.cc
@@ -30,70 +30,66 @@
#include <string.h>
namespace gr {
- namespace blocks {
+namespace blocks {
- template <class T>
- typename mute_blk<T>::sptr
- mute_blk<T>::make(bool mute)
- {
- return gnuradio::get_initial_sptr
- (new mute_impl<T> (mute));
- }
+template <class T>
+typename mute_blk<T>::sptr mute_blk<T>::make(bool mute)
+{
+ return gnuradio::get_initial_sptr(new mute_impl<T>(mute));
+}
- template <class T>
- mute_impl<T> ::mute_impl(bool mute)
+template <class T>
+mute_impl<T>::mute_impl(bool mute)
: sync_block("mute",
- io_signature::make(1, 1, sizeof(T)),
- io_signature::make(1, 1, sizeof(T))),
+ io_signature::make(1, 1, sizeof(T)),
+ io_signature::make(1, 1, sizeof(T))),
d_mute(mute)
- {
- this->message_port_register_in(pmt::intern("set_mute"));
- this->set_msg_handler(pmt::intern("set_mute"),
- boost::bind(&mute_impl<T> ::set_mute_pmt, this, _1));
- }
+{
+ this->message_port_register_in(pmt::intern("set_mute"));
+ this->set_msg_handler(pmt::intern("set_mute"),
+ boost::bind(&mute_impl<T>::set_mute_pmt, this, _1));
+}
- template <class T>
- mute_impl<T> ::~mute_impl()
- {
- }
+template <class T>
+mute_impl<T>::~mute_impl()
+{
+}
- template <class T>
- int
- mute_impl<T> ::work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
- {
- T *iptr = (T *)input_items[0];
- T *optr = (T *)output_items[0];
+template <class T>
+int mute_impl<T>::work(int noutput_items,
+ gr_vector_const_void_star& input_items,
+ gr_vector_void_star& output_items)
+{
+ T* iptr = (T*)input_items[0];
+ T* optr = (T*)output_items[0];
- int size = noutput_items;
+ int size = noutput_items;
- if(d_mute) {
+ if (d_mute) {
memset(optr, 0, noutput_items * sizeof(T));
- }
- else {
- while(size >= 8) {
- *optr++ = *iptr++;
- *optr++ = *iptr++;
- *optr++ = *iptr++;
- *optr++ = *iptr++;
- *optr++ = *iptr++;
- *optr++ = *iptr++;
- *optr++ = *iptr++;
- *optr++ = *iptr++;
- size -= 8;
+ } else {
+ while (size >= 8) {
+ *optr++ = *iptr++;
+ *optr++ = *iptr++;
+ *optr++ = *iptr++;
+ *optr++ = *iptr++;
+ *optr++ = *iptr++;
+ *optr++ = *iptr++;
+ *optr++ = *iptr++;
+ *optr++ = *iptr++;
+ size -= 8;
}
- while(size-- > 0)
- *optr++ = *iptr++;
- }
-
- return noutput_items;
+ while (size-- > 0)
+ *optr++ = *iptr++;
}
+ return noutput_items;
+}
+
template class mute_blk<std::int16_t>;
template class mute_blk<std::int32_t>;
template class mute_blk<float>;
template class mute_blk<gr_complex>;
- } /* namespace blocks */
+} /* namespace blocks */
} /* namespace gr */