[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/01: fec: more sign warning cleanup
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/01: fec: more sign warning cleanup |
Date: |
Mon, 6 Apr 2015 15:34:01 +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 9f3427e81df8c8843298fa50f57899a0ca7833de
Author: Tim O'Shea <address@hidden>
Date: Mon Apr 6 11:26:17 2015 -0400
fec: more sign warning cleanup
---
gr-fec/include/gnuradio/fec/tpc_encoder.h | 20 ++++++++++----------
gr-fec/lib/tpc_encoder.cc | 17 +++++++++--------
2 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/gr-fec/include/gnuradio/fec/tpc_encoder.h
b/gr-fec/include/gnuradio/fec/tpc_encoder.h
index 3828640..ab73765 100755
--- a/gr-fec/include/gnuradio/fec/tpc_encoder.h
+++ b/gr-fec/include/gnuradio/fec/tpc_encoder.h
@@ -43,14 +43,14 @@ class FEC_API tpc_encoder : public generic_encoder {
int get_output_size();
int get_input_size();
- unsigned int d_krow;
- unsigned int d_kcol;
-
std::vector<int> d_rowpolys;
std::vector<int> d_colpolys;
- int d_bval;
- int d_qval;
+ unsigned int d_krow;
+ unsigned int d_kcol;
+
+ unsigned int d_bval;
+ unsigned int d_qval;
// store the state transitions & outputs
int rowNumStates;
@@ -64,10 +64,10 @@ class FEC_API tpc_encoder : public generic_encoder {
std::vector<int> colTail;
int rowEncoder_K;
- int rowEncoder_n;
+ size_t rowEncoder_n;
int rowEncoder_m;
int colEncoder_K;
- int colEncoder_n;
+ size_t colEncoder_n;
int colEncoder_m;
int outputSize;
int inputSize;
@@ -78,7 +78,7 @@ class FEC_API tpc_encoder : public generic_encoder {
std::vector< std::vector<uint8_t> > rowEncodedBits;
std::vector<unsigned char> rowToEncode;
- int numRowsToEncode;
+ size_t numRowsToEncode;
std::vector<uint8_t> rowEncoded_block;
std::vector< std::vector<uint8_t> > colEncodedBits;
@@ -91,8 +91,8 @@ class FEC_API tpc_encoder : public generic_encoder {
std::vector< std::vector<int> > transOutputVec,
std::vector< std::vector<int> >
transNextStateVec,
std::vector<int> tail,
- int KK,
- int nn);
+ size_t KK,
+ size_t nn);
FILE *fp;
diff --git a/gr-fec/lib/tpc_encoder.cc b/gr-fec/lib/tpc_encoder.cc
index 5973218..941bd7b 100755
--- a/gr-fec/lib/tpc_encoder.cc
+++ b/gr-fec/lib/tpc_encoder.cc
@@ -116,12 +116,12 @@ void tpc_encoder::block_conv_encode( std::vector<uint8_t>
&output,
std::vector< std::vector<int> > transOutputVec,
std::vector< std::vector<int> >
transNextStateVec,
std::vector<int> tail,
- int KK,
- int nn)
+ size_t KK,
+ size_t nn)
{
- int outsym, ii, jj;
+ size_t outsym, ii, jj;
int state = 0;
- int LL = input.size();
+ size_t LL = input.size();
std::vector<int> binVec(nn,0);
@@ -164,7 +164,7 @@ void tpc_encoder::generic_work(void *inBuffer, void
*outBuffer) {
const uint8_t *in = (const uint8_t *) inBuffer;
uint8_t *out = (uint8_t *) outBuffer;
- int ii, jj; // indexing var
+ size_t ii, jj; // indexing var
//DEBUG_PRINT_UCHAR_ARRAY(in, inputSize);
@@ -209,8 +209,8 @@ void tpc_encoder::generic_work(void *inBuffer, void
*outBuffer) {
}
// encode the column data
- int numDataColsToEncode = d_krow;
- int numCheckColsToEncode = numColsToEncode-numDataColsToEncode;
+ size_t numDataColsToEncode = d_krow;
+ size_t numCheckColsToEncode = numColsToEncode-numDataColsToEncode;
for(ii=0; ii<numDataColsToEncode; ii++) {
// populate colToEncode
for(jj=0; jj<d_kcol; jj++) {
@@ -288,7 +288,8 @@ void tpc_encoder::generic_work(void *inBuffer, void
*outBuffer) {
// skip B zeros & do the first row
inputDataPtr = &inputWithPad[d_bval];
- int firstRowRemainingBits = d_krow-d_bval;
+ if(d_bval > d_krow){ throw std::runtime_error("bval must be < krow"); }
+ size_t firstRowRemainingBits = d_krow-d_bval;
for(ii=0; ii<firstRowRemainingBits; ii++) {
*outputDataPtr++ = (uint8_t)(*inputDataPtr++);
}