summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/unpack_k_bits.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/unpack_k_bits.cc
parent78431dc6941e3acc67c858277dfe4a0ed583643c (diff)
Tree: clang-format without the include sorting
Diffstat (limited to 'gr-blocks/lib/unpack_k_bits.cc')
-rw-r--r--gr-blocks/lib/unpack_k_bits.cc67
1 files changed, 31 insertions, 36 deletions
diff --git a/gr-blocks/lib/unpack_k_bits.cc b/gr-blocks/lib/unpack_k_bits.cc
index 967d7e17d9..0865121d02 100644
--- a/gr-blocks/lib/unpack_k_bits.cc
+++ b/gr-blocks/lib/unpack_k_bits.cc
@@ -30,48 +30,43 @@
#include <iostream>
namespace gr {
- namespace blocks {
- namespace kernel {
+namespace blocks {
+namespace kernel {
- unpack_k_bits::unpack_k_bits(unsigned k)
- : d_k(k)
- {
- if(d_k == 0)
- throw std::out_of_range("unpack_k_bits: k must be > 0");
- }
+unpack_k_bits::unpack_k_bits(unsigned k) : d_k(k)
+{
+ if (d_k == 0)
+ throw std::out_of_range("unpack_k_bits: k must be > 0");
+}
- unpack_k_bits::~unpack_k_bits()
- {
- }
+unpack_k_bits::~unpack_k_bits() {}
- void
- unpack_k_bits::unpack(unsigned char *bits, const unsigned char *bytes, int nbytes) const
- {
- int n = 0;
- for(int i = 0; i < nbytes; i++) {
- unsigned int t = bytes[i];
- for(int j = d_k - 1; j >= 0; j--)
+void unpack_k_bits::unpack(unsigned char* bits,
+ const unsigned char* bytes,
+ int nbytes) const
+{
+ int n = 0;
+ for (int i = 0; i < nbytes; i++) {
+ unsigned int t = bytes[i];
+ for (int j = d_k - 1; j >= 0; j--)
bits[n++] = (t >> j) & 0x01;
- }
- }
+ }
+}
- void
- unpack_k_bits::unpack_rev(unsigned char *bits, const unsigned char *bytes, int nbytes) const
- {
- int n = 0;
- for(int i = 0; i < nbytes; i++) {
- unsigned int t = bytes[i];
- for(unsigned int j = 0; j < d_k; j++)
+void unpack_k_bits::unpack_rev(unsigned char* bits,
+ const unsigned char* bytes,
+ int nbytes) const
+{
+ int n = 0;
+ for (int i = 0; i < nbytes; i++) {
+ unsigned int t = bytes[i];
+ for (unsigned int j = 0; j < d_k; j++)
bits[n++] = (t >> j) & 0x01;
- }
- }
+ }
+}
- int
- unpack_k_bits::k() const
- {
- return d_k;
- }
+int unpack_k_bits::k() const { return d_k; }
- } /* namespace kernel */
- } /* namespace blocks */
+} /* namespace kernel */
+} /* namespace blocks */
} /* namespace gr */