summaryrefslogtreecommitdiff
path: root/gr-error-correcting-codes/src/lib/libecc/mld
diff options
context:
space:
mode:
authormichaelld2006-08-14 02:19:14 +0000
committermichaelld2006-08-14 02:19:14 +0000
commite7d7a023503a193009ea14eaf5ee1eab19e2b60f (patch)
tree9b5b555724c4157bb6d8487454055f577908f3cb /gr-error-correcting-codes/src/lib/libecc/mld
parent7ef9b9bfca4abb3ec5774faa59a26300d4695b39 (diff)
downloadgnuradio-e7d7a023503a193009ea14eaf5ee1eab19e2b60f.tar.gz
gnuradio-e7d7a023503a193009ea14eaf5ee1eab19e2b60f.tar.bz2
gnuradio-e7d7a023503a193009ea14eaf5ee1eab19e2b60f.zip
fixes ticket:25
merged from 3244 to 3270 in michaelld/wip Convolutional encoder now works; all features tested. Re-enabled gr-ecc in the top configure.ac file. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3271 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-error-correcting-codes/src/lib/libecc/mld')
-rw-r--r--gr-error-correcting-codes/src/lib/libecc/mld/n2bs.cc23
1 files changed, 7 insertions, 16 deletions
diff --git a/gr-error-correcting-codes/src/lib/libecc/mld/n2bs.cc b/gr-error-correcting-codes/src/lib/libecc/mld/n2bs.cc
index e9c25794b..64c0cf16e 100644
--- a/gr-error-correcting-codes/src/lib/libecc/mld/n2bs.cc
+++ b/gr-error-correcting-codes/src/lib/libecc/mld/n2bs.cc
@@ -22,9 +22,8 @@
#include <n2bs.h>
#include <iostream>
-#include "../code_types.h"
-const int g_num_bits_per_byte = 8;
+static const int g_num_bits_per_byte = 8;
std::string DoIt (int64_t number, size_t digits)
{
@@ -39,10 +38,10 @@ std::string DoIt (int64_t number, size_t digits)
return (retVal);
}
-std::string n2bs (u_int8_t number, size_t digits)
+std::string n2bs (int8_t number, size_t digits)
{
- if (digits > (sizeof (u_int8_t) * g_num_bits_per_byte))
- digits = sizeof (u_int8_t);
+ if (digits > (sizeof (int8_t) * g_num_bits_per_byte))
+ digits = sizeof (int8_t);
return DoIt ((int64_t) number, digits);
}
std::string n2bs (int16_t number, size_t digits)
@@ -63,12 +62,10 @@ std::string n2bs (int64_t number, size_t digits)
digits = sizeof (int64_t);
return DoIt (number, digits);
}
-
-
-std::string n2bs (int8_t number, size_t digits)
+std::string n2bs (u_int8_t number, size_t digits)
{
- if (digits > (sizeof (int8_t) * g_num_bits_per_byte))
- digits = sizeof (int8_t);
+ if (digits > (sizeof (u_int8_t) * g_num_bits_per_byte))
+ digits = sizeof (u_int8_t);
return DoIt ((int64_t) number, digits);
}
std::string n2bs (u_int16_t number, size_t digits)
@@ -89,9 +86,3 @@ std::string n2bs (u_int64_t number, size_t digits)
digits = sizeof (u_int64_t);
return DoIt ((int64_t) number, digits);
}
-
-void cout_binary (int number, int digits)
-{
- while (digits-- > 0)
- std::cout << ((number >> digits) & 1);
-}