[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/10: gr-dtv: Clean up minor Coverity Scan
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/10: gr-dtv: Clean up minor Coverity Scan issues. |
Date: |
Sun, 14 Jun 2015 16:34:15 +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 a20b3e9cb0e893aaf2d3fe906b664ec0d8442109
Author: Ron Economos <address@hidden>
Date: Mon Jun 1 04:10:09 2015 -0700
gr-dtv: Clean up minor Coverity Scan issues.
---
gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc | 15 ++----
gr-dtv/lib/dvb/dvb_ldpc_bb_impl.h | 1 -
gr-dtv/lib/dvbt/dvbt_configure.cc | 3 ++
gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.cc | 3 +-
gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc | 4 ++
.../lib/dvbt/dvbt_symbol_inner_interleaver_impl.cc | 3 --
gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.cc | 63 +++++-----------------
gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.h | 3 --
gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.cc | 4 --
gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.cc | 2 +
10 files changed, 28 insertions(+), 73 deletions(-)
diff --git a/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc
b/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc
index e0c80ea..551191c 100644
--- a/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc
+++ b/gr-dtv/lib/dvb/dvb_bbheader_bb_impl.cc
@@ -406,29 +406,24 @@ namespace gr {
m_frame[0] = 0;
m_frame[1] = 1;
m_frame_offset_bits = 2;
- temp = 0;
for (int n = 30; n >= 0; n--) {
- m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0;
+ m_frame[m_frame_offset_bits++] = 0;
}
- temp = 0;
for (int n = 21; n >= 0; n--) {
- m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0;
+ m_frame[m_frame_offset_bits++] = 0;
}
- temp = 0;
for (int n = 1; n >= 0; n--) {
- m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0;
+ m_frame[m_frame_offset_bits++] = 0;
}
- temp = 0;
for (int n = 9; n >= 0; n--) {
- m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0;
+ m_frame[m_frame_offset_bits++] = 0;
}
temp = ts_rate;
for (int n = 26; n >= 0; n--) {
m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0;
}
- temp = 0;
for (int n = 9; n >= 0; n--) {
- m_frame[m_frame_offset_bits++] = temp & (1 << n) ? 1 : 0;
+ m_frame[m_frame_offset_bits++] = 0;
}
}
diff --git a/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.h
b/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.h
index 3510ddf..92c9eb3 100644
--- a/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.h
+++ b/gr-dtv/lib/dvb/dvb_ldpc_bb_impl.h
@@ -42,7 +42,6 @@ namespace gr {
unsigned int nbch;
unsigned int code_rate;
unsigned int q_val;
- unsigned int table_length;
unsigned int dvb_standard;
void ldpc_lookup_generate(void);
ldpc_encode_table ldpc_encode;
diff --git a/gr-dtv/lib/dvbt/dvbt_configure.cc
b/gr-dtv/lib/dvbt/dvbt_configure.cc
index 1cd1b83..a6d1af7 100644
--- a/gr-dtv/lib/dvbt/dvbt_configure.cc
+++ b/gr-dtv/lib/dvbt/dvbt_configure.cc
@@ -101,6 +101,9 @@ namespace gr {
{
d_symbols_per_frame = 68;
d_frames_per_superframe = 4;
+ d_symbol_index = 0;
+ d_frame_index = 0;
+ d_superframe_index = 0;
switch (d_transmission_mode) {
case T2k:
diff --git a/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.cc
b/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.cc
index 9b49719..03dd0ff 100644
--- a/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.cc
+++ b/gr-dtv/lib/dvbt/dvbt_energy_dispersal_impl.cc
@@ -68,7 +68,8 @@ namespace gr {
: gr::block("dvbt_energy_dispersal",
gr::io_signature::make(1, 1, sizeof(unsigned char)),
gr::io_signature::make(1, 1, sizeof(unsigned char) * nblocks *
d_npacks * d_psize)),
- d_nblocks(nblocks)
+ d_nblocks(nblocks),
+ d_reg(0xa9)
{
set_relative_rate(1.0/(double) (d_nblocks * d_npacks * d_psize));
}
diff --git a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
index d64b403..58fc76c 100644
--- a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
+++ b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc
@@ -166,6 +166,10 @@ namespace gr {
d_tps_carriers = d_tps_carriers_2k;
}
+ d_freq_offset = 0;
+ d_carrier_freq_correction = 0.0;
+ d_sampling_freq_correction = 0.0;
+
//allocate PRBS buffer
d_wk = new char[d_Kmax - d_Kmin + 1];
if (d_wk == NULL) {
diff --git a/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.cc
b/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.cc
index 7c2e2f7..64d242d 100644
--- a/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.cc
+++ b/gr-dtv/lib/dvbt/dvbt_symbol_inner_interleaver_impl.cc
@@ -66,9 +66,6 @@ namespace gr {
else if (i == 1) {
reg = 0;
}
- else if (reg == 2) {
- reg = 1;
- }
else {
reg = 1;
for (int k = 3; k <= i; k++) {
diff --git a/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.cc
b/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.cc
index aef610f..0c05285 100644
--- a/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.cc
+++ b/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.cc
@@ -86,9 +86,6 @@ namespace gr {
break;
}
}
- fef_present = FALSE; /* for testing only */
- fef_length = 134144; /* " " " */
- fef_interval = 1; /* " " " */
l1preinit->type = STREAMTYPE_TS;
l1preinit->bwt_ext = carriermode;
fft_size = fftsize;
@@ -100,12 +97,7 @@ namespace gr {
l1preinit->l1_mod = l1constellation;
l1preinit->l1_cod = 0;
l1preinit->l1_fec_type = 0;
- if (fef_present == FALSE) {
- l1preinit->l1_post_info_size = KSIG_POST - 32;
- }
- else {
- l1preinit->l1_post_info_size = KSIG_POST + 34 - 32;
- }
+ l1preinit->l1_post_info_size = KSIG_POST - 32;
l1preinit->pilot_pattern = pilotpattern;
l1preinit->tx_id_availability = 0;
l1preinit->cell_id = 0;
@@ -144,12 +136,7 @@ namespace gr {
l1postinit->ff_flag = 0;
l1postinit->first_rf_idx = 0;
l1postinit->first_frame_idx = 0;
- if (fef_present == FALSE) {
- l1postinit->plp_group_id = 1;
- }
- else {
- l1postinit->plp_group_id = 0;
- }
+ l1postinit->plp_group_id = 1;
switch (rate) {
case C1_3:
l1postinit->plp_cod = 6;
@@ -205,14 +192,8 @@ namespace gr {
else {
l1postinit->plp_mode = inputmode + 1;
}
- if (fef_present == FALSE) {
- l1postinit->static_flag = 0;
- l1postinit->static_padding_flag = 0;
- }
- else {
- l1postinit->static_flag = 1;
- l1postinit->static_padding_flag = 1;
- }
+ l1postinit->static_flag = 0;
+ l1postinit->static_padding_flag = 0;
l1postinit->fef_length_msb = 0;
if (reservedbiasbits == RESERVED_ON && version == VERSION_131) {
l1postinit->reserved_2 = 0x3fffffff;
@@ -351,6 +332,11 @@ namespace gr {
eta_mod = 6;
break;
}
+ N_P2 = 0;
+ C_P2 = 0;
+ N_FC = 0;
+ C_FC = 0;
+ C_DATA = 0;
if ((preamble == PREAMBLE_T2_SISO) || (preamble ==
PREAMBLE_T2_LITE_SISO)) {
switch (fft_size) {
case FFTSIZE_1K:
@@ -904,14 +890,8 @@ namespace gr {
C_FC = 0;
}
}
- if (fef_present == FALSE) {
- N_punc_temp = (6 * (KBCH_1_2 - KSIG_POST)) / 5;
- N_post_temp = KSIG_POST + NBCH_PARITY + 9000 - N_punc_temp;
- }
- else {
- N_punc_temp = (6 * (KBCH_1_2 - (KSIG_POST + 34))) / 5;
- N_post_temp = (KSIG_POST + 34) + NBCH_PARITY + 9000 - N_punc_temp;
- }
+ N_punc_temp = (6 * (KBCH_1_2 - KSIG_POST)) / 5;
+ N_post_temp = KSIG_POST + NBCH_PARITY + 9000 - N_punc_temp;
if (N_P2 == 1) {
N_post = ceil((float)N_post_temp / (2 * (float)eta_mod)) * 2 * eta_mod;
}
@@ -1166,12 +1146,7 @@ namespace gr {
for (int n = 2; n >= 0; n--) {
l1pre[offset_bits++] = temp & (1 << n) ? 1 : 0;
}
- if (fef_present == FALSE) {
- l1pre[offset_bits++] = 0;
- }
- else {
- l1pre[offset_bits++] = 1;
- }
+ l1pre[offset_bits++] = 0;
l1pre[offset_bits++] = l1preinit->l1_repetition_flag;
temp = l1preinit->guard_interval;
for (int n = 2; n >= 0; n--) {
@@ -1356,20 +1331,6 @@ namespace gr {
for (int n = 31; n >= 0; n--) {
l1post[offset_bits++] = temp & (1 << n) ? 1 : 0;
}
- if (fef_present == TRUE) {
- temp = 0;
- for (int n = 3; n >= 0; n--) {
- l1post[offset_bits++] = temp & (1 << n) ? 1 : 0;
- }
- temp = fef_length;
- for (int n = 21; n >= 0; n--) {
- l1post[offset_bits++] = temp & (1 << n) ? 1 : 0;
- }
- temp = fef_interval;
- for (int n = 7; n >= 0; n--) {
- l1post[offset_bits++] = temp & (1 << n) ? 1 : 0;
- }
- }
temp = l1postinit->plp_id;
for (int n = 7; n >= 0; n--) {
l1post[offset_bits++] = temp & (1 << n) ? 1 : 0;
diff --git a/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.h
b/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.h
index 354c684..8d35493 100644
--- a/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.h
+++ b/gr-dtv/lib/dvbt2/dvbt2_framemapper_cc_impl.h
@@ -139,9 +139,6 @@ namespace gr {
int t2_frames;
int t2_frame_num;
int l1_scrambled;
- int fef_present;
- int fef_length;
- int fef_interval;
int N_P2;
int C_P2;
int N_FC;
diff --git a/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.cc
b/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.cc
index c644d49..9a2a41b 100644
--- a/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.cc
+++ b/gr-dtv/lib/dvbt2/dvbt2_p1insertion_cc_impl.cc
@@ -45,7 +45,6 @@ namespace gr {
gr::io_signature::make(1, 1, sizeof(gr_complex)))
{
int s1, s2, index = 0;
- int fef_present = FALSE; /* for testing only */
const gr_complex *in = (const gr_complex *) p1_freq;
gr_complex *out = (gr_complex *) p1_time;
s1 = preamble;
@@ -103,9 +102,6 @@ namespace gr {
}
init_p1_randomizer();
s2 = (fftsize & 0x7) << 1;
- if (fef_present == TRUE) {
- s2 |= 1;
- }
for (int i = 0; i < 8; i++) {
for (int j = 7; j >= 0; j--) {
modulation_sequence[index++] = (s1_modulation_patterns[s1][i] >> j)
& 0x1;
diff --git a/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.cc
b/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.cc
index 45ceeed..b4f1756 100644
--- a/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.cc
+++ b/gr-dtv/lib/dvbt2/dvbt2_paprtr_cc_impl.cc
@@ -500,6 +500,8 @@ namespace gr {
dy = 16;
break;
}
+ shift = 0;
+ papr_map = p2_papr_map;
fft_size = fftsize;
pilot_pattern = pilotpattern;
carrier_mode = carriermode;
- [Commit-gnuradio] [gnuradio] branch master updated (1dc65e1 -> 7ee2f91), git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 06/10: Merge remote-tracking branch 'skoslowski/top_block_wait', git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 09/10: Merge branch 'maint', git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 01/10: runtime: add flag to wrapped top_block to control SIGINT handling in wait(), git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 08/10: Merge remote-tracking branch 'mbr0wn/uhd/gpios', git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 07/10: Merge remote-tracking branch 'drmpeg/dtv-coverity-cleanup', git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 05/10: uhd: Expose GPIO functions through SWIG, git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 10/10: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 03/10: grc: add <flags> to blocks dtd (<throttle> still supported), git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 04/10: grc: Added ability to bypass blocks (Suggested by Chris Headley)., git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 02/10: gr-dtv: Clean up minor Coverity Scan issues.,
git <=