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/complex_to_interleaved_char_impl.cc | |
parent | 78431dc6941e3acc67c858277dfe4a0ed583643c (diff) |
Tree: clang-format without the include sorting
Diffstat (limited to 'gr-blocks/lib/complex_to_interleaved_char_impl.cc')
-rw-r--r-- | gr-blocks/lib/complex_to_interleaved_char_impl.cc | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/gr-blocks/lib/complex_to_interleaved_char_impl.cc b/gr-blocks/lib/complex_to_interleaved_char_impl.cc index f25378e64e..066b48f0ba 100644 --- a/gr-blocks/lib/complex_to_interleaved_char_impl.cc +++ b/gr-blocks/lib/complex_to_interleaved_char_impl.cc @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, -* Boston, MA 02110-1301, USA. + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -28,38 +28,38 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace blocks { +namespace blocks { - complex_to_interleaved_char::sptr complex_to_interleaved_char::make(bool vector) - { - return gnuradio::get_initial_sptr(new complex_to_interleaved_char_impl(vector)); - } - - complex_to_interleaved_char_impl::complex_to_interleaved_char_impl(bool vector) - : sync_interpolator("complex_to_interleaved_char", - io_signature::make (1, 1, sizeof(gr_complex)), - io_signature::make (1, 1, vector?2*sizeof(char):sizeof(char)), - vector?1:2), - d_vector(vector) - { - } +complex_to_interleaved_char::sptr complex_to_interleaved_char::make(bool vector) +{ + return gnuradio::get_initial_sptr(new complex_to_interleaved_char_impl(vector)); +} - int - complex_to_interleaved_char_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *) input_items[0]; - char *out = (char *) output_items[0]; +complex_to_interleaved_char_impl::complex_to_interleaved_char_impl(bool vector) + : sync_interpolator( + "complex_to_interleaved_char", + io_signature::make(1, 1, sizeof(gr_complex)), + io_signature::make(1, 1, vector ? 2 * sizeof(char) : sizeof(char)), + vector ? 1 : 2), + d_vector(vector) +{ +} - int npairs = (d_vector?noutput_items:noutput_items/2); - for (int i = 0; i < npairs; i++){ - *out++ = (char) lrintf(in[i].real()); // FIXME saturate? - *out++ = (char) lrintf(in[i].imag()); - } +int complex_to_interleaved_char_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + char* out = (char*)output_items[0]; - return noutput_items; + int npairs = (d_vector ? noutput_items : noutput_items / 2); + for (int i = 0; i < npairs; i++) { + *out++ = (char)lrintf(in[i].real()); // FIXME saturate? + *out++ = (char)lrintf(in[i].imag()); } - } /* namespace blocks */ -}/* namespace gr */ + return noutput_items; +} + +} /* namespace blocks */ +} /* namespace gr */ |