[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 10/43: fec: cleaning up LDPC warnings
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 10/43: fec: cleaning up LDPC warnings |
Date: |
Thu, 2 Apr 2015 19:15:50 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 488d1952d3a4f5084bc9349b7bd3f2c2e9c54226
Author: Tim O'Shea <address@hidden>
Date: Wed Apr 1 10:31:12 2015 -0700
fec: cleaning up LDPC warnings
---
gr-fec/include/gnuradio/fec/cldpc.h | 2 +-
gr-fec/lib/alist.cc | 4 ++--
gr-fec/lib/awgn_bp.cc | 2 +-
gr-fec/lib/cldpc.cc | 8 ++++++--
gr-fec/lib/gf2mat.cc | 1 -
gr-fec/lib/gf2vec.cc | 2 +-
gr-fec/lib/ldpc_encoder.cc | 2 +-
7 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/gr-fec/include/gnuradio/fec/cldpc.h
b/gr-fec/include/gnuradio/fec/cldpc.h
index 58bdc1a..0071fef 100644
--- a/gr-fec/include/gnuradio/fec/cldpc.h
+++ b/gr-fec/include/gnuradio/fec/cldpc.h
@@ -118,7 +118,7 @@ class FEC_API cldpc
int N;
//! The dimension of the code
- int K;
+ size_t K;
};
#endif // ifndef LDPC_H
diff --git a/gr-fec/lib/alist.cc b/gr-fec/lib/alist.cc
index eeeb729..c644023 100644
--- a/gr-fec/lib/alist.cc
+++ b/gr-fec/lib/alist.cc
@@ -149,12 +149,12 @@ void alist::write(const char * fname) const
file << N << " " << M << std::endl;
file << max_num_nlist << " " << max_num_mlist << std::endl;
// Write column weights
- for (int i = 0; i < num_nlist.size() - 1; i++) {
+ for (size_t i = 0; i < num_nlist.size() - 1; i++) {
file << num_nlist[i] << " ";
}
file << num_nlist[num_nlist.size() - 1] << std::endl;
// Write row weights
- for (int i = 0; i < num_mlist.size() - 1; i++) {
+ for (size_t i = 0; i < num_mlist.size() - 1; i++) {
file << num_mlist[i] << " ";
}
file << num_mlist[num_mlist.size() - 1] << std::endl;
diff --git a/gr-fec/lib/awgn_bp.cc b/gr-fec/lib/awgn_bp.cc
index 7e08e7a..eaa0c39 100644
--- a/gr-fec/lib/awgn_bp.cc
+++ b/gr-fec/lib/awgn_bp.cc
@@ -159,7 +159,7 @@ std::vector<char> awgn_bp::get_estimate() {
}
void awgn_bp::compute_init_estimate(std::vector<float> rx_word) {
- for ( int i = 0; i < rx_word.size(); i++ ) {
+ for (size_t i = 0; i < rx_word.size(); i++ ) {
if (rx_word[i] < 0)
estimate[i] = char(1);
else
diff --git a/gr-fec/lib/cldpc.cc b/gr-fec/lib/cldpc.cc
index 0798ff7..90996ab 100644
--- a/gr-fec/lib/cldpc.cc
+++ b/gr-fec/lib/cldpc.cc
@@ -26,6 +26,7 @@
*/
#include <gnuradio/fec/cldpc.h>
+#include <stdexcept>
cldpc::cldpc(const GF2Mat X) {
H = X;
@@ -55,7 +56,7 @@ std::vector<char>
cldpc::get_systematic_bits(std::vector<char> in) {
std::vector<char> data;
data.resize(K);
int index;
- for ( int i = 0; i < K; i++ ) {
+ for (size_t i = 0; i < K; i++ ) {
index = permute[i + rank_H];
data[i] = in[index];
}
@@ -63,7 +64,7 @@ std::vector<char>
cldpc::get_systematic_bits(std::vector<char> in) {
}
void cldpc::print_permute() {
- for ( int i = 0; i < permute.size(); i++ ) {
+ for (size_t i = 0; i < permute.size(); i++ ) {
std::cout << permute[i] << ", ";
}
std::cout << "\n";
@@ -109,6 +110,9 @@ std::vector<char> cldpc::encode(std::vector<char> dataword)
{
y[permute[i]] = x[i];
}
return y.get_vec();
+ } else {
+ throw std::runtime_error("bad vector length!");
+ return std::vector<char>();
}
}
diff --git a/gr-fec/lib/gf2mat.cc b/gr-fec/lib/gf2mat.cc
index 61240c8..5789d71 100644
--- a/gr-fec/lib/gf2mat.cc
+++ b/gr-fec/lib/gf2mat.cc
@@ -53,7 +53,6 @@ GF2Mat::GF2Mat(std::vector <std::vector<char> > X) {
}
GF2Mat::GF2Mat(alist _list) {
- int m, n;
M = _list.get_M();
N = _list.get_N();
H.resize(M);
diff --git a/gr-fec/lib/gf2vec.cc b/gr-fec/lib/gf2vec.cc
index e5c80ad..f8e7c93 100644
--- a/gr-fec/lib/gf2vec.cc
+++ b/gr-fec/lib/gf2vec.cc
@@ -37,7 +37,7 @@ GF2Vec::GF2Vec(int size) {
void GF2Vec::set_vec(const std::vector<char> in) {
resize(in.size());
- for ( int i = 0; i < vec.size(); i++ ) {
+ for (size_t i = 0; i < vec.size(); i++ ) {
vec[i] = in[i];
}
}
diff --git a/gr-fec/lib/ldpc_encoder.cc b/gr-fec/lib/ldpc_encoder.cc
index fa91a3e..2cb38aa 100755
--- a/gr-fec/lib/ldpc_encoder.cc
+++ b/gr-fec/lib/ldpc_encoder.cc
@@ -45,7 +45,7 @@ void ldpc_encoder::generic_work(void *inBuffer, void
*outBuffer) {
std::vector<char> inbuf(inputSize);
memcpy(&inbuf[0], in, inputSize);
std::vector<char> coded(d_code.encode(inbuf));
- for(int i=0; i<coded.size();i++){ out[i] = coded[i]; }
+ for(size_t i=0; i<coded.size();i++){ out[i] = coded[i]; }
}
- [Commit-gnuradio] [gnuradio] 04/43: gnuradio-runtime: added the individual port assignments to the hier_block2 max/min_output_buffer size; if output ports have different size assignments only the block directly connected to the output port is changed otherwise every block within the hier is set to that output buffer size; therefore single output hier blocks will always set every block within to the output buffer size, (continued)
- [Commit-gnuradio] [gnuradio] 04/43: gnuradio-runtime: added the individual port assignments to the hier_block2 max/min_output_buffer size; if output ports have different size assignments only the block directly connected to the output port is changed otherwise every block within the hier is set to that output buffer size; therefore single output hier blocks will always set every block within to the output buffer size, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 17/43: gnuradio-runtume: hier_block2 output buffer lengths - clean up of debug output, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 26/43: grc: no shebang for hier blocks; use python2, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 15/43: fec: ldpc encoder now working in async encoder interface, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 06/43: gnuradio-runtime: (option 1) The hier block can now take a generic min/max output buffer length and assign it to every block within the hier (assumes all output buffers have the same min/max values set); (option 2) sets only the blocks connected to hier output ports and does not set the other internal blocks (requires that each port has different values); for single port output hier blocks only option 1 is possible., git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 07/43: gnuradio-runtime: non-helpful debug outputs removed from hier_block2 and hier_block2_detail, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 27/43: grc: optional thread-safe setters in generated code (#748), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 19/43: gnuradio-runtime: added logger to flat_flowgraph and print out a warning for when the max_output_buffer isn't set to the requested value, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 28/43: grc: don't try to open missing files, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 01/43: gnuradio-runtime: trying to see if this will handle the output buffer size of hier blocks; trying to find the proper casting methods, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 10/43: fec: cleaning up LDPC warnings,
git <=
- [Commit-gnuradio] [gnuradio] 18/43: fec: ldpc works, add iterations meta tag, etc, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 34/43: Merge remote-tracking branch 'saikwolf/logging_flat_flowgraph', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 03/43: gnuradio-runtime:: removed the individual port setting on hier_block2, current operation assuming the buffers are being set for latency and therefore all blocks are being set to a small amount, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 11/43: fec: LDPC cleaning up comments, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 30/43: grc: clean-up 'gnuradio-companion', add mode 'run from source', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 12/43: fec: re-shuffling LDPC make helper, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 31/43: grc: PropsDialog: apply button and hotkey (Ctrl+Enter), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 40/43: fec: Move the definition of yp_kernel from the class into a temp variable in the main code. This variable is used just to find the actual Volk kernel, and its current use is not c++11 complaint. Moving it makes the code c++11 complaint on both GCC / libstdc++ and Clang / libc++., git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 35/43: Merge remote-tracking branch 'osh/ldpc_add', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 20/43: grc: Reworked save confirmation dialog to allow cancel option, git, 2015/04/02