commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/09: Fixing memset(..,0xCCCC,...)


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/09: Fixing memset(..,0xCCCC,...)
Date: Mon, 6 Apr 2015 14:30:33 +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 1c659dbbe25565c3db90d8dac4be84d514db9874
Author: Marcus Müller <address@hidden>
Date:   Mon Apr 6 09:52:56 2015 +0200

    Fixing memset(..,0xCCCC,...)
    
    Not really an issue, but coverity is right in this case:
    
https://scan6.coverity.com:8443/reports.htm#v31371/p10336/fileInstanceId=27864390&defectInstanceId=9318152&mergedDefectId=746150
---
 gr-fec/lib/tpc_decoder.cc | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/gr-fec/lib/tpc_decoder.cc b/gr-fec/lib/tpc_decoder.cc
index ded12fe..3805f31 100644
--- a/gr-fec/lib/tpc_decoder.cc
+++ b/gr-fec/lib/tpc_decoder.cc
@@ -213,11 +213,11 @@ void tpc_decoder::siso_decode_row() {
     // this initialization is saying that the likelihood that the reverse sweep
     // starts at state=0 is 100%, b/c state 1, 2, 3's likelihood's are 
basically -inf
     // this implies that the forward trellis terminated at the 0 state
-//    for(state=1; state<max_states_row; state++) {
-//             beta_row[LL+rowEncoder_K-1][state] = -MAXLOG;
-//     }
-    // filling w/ 0xCCCC yields a value close to -MAXLOG, and memset is faster 
than for loops
-    memset(&beta_row[LL+rowEncoder_K-1][1], 0xCCCC, 
sizeof(float)*(max_states_row-1));
+    //    for(state=1; state<max_states_row; state++) {
+    //         beta_row[LL+rowEncoder_K-1][state] = -MAXLOG;
+    // }
+    // filling w/ 0xCC yields a value close to -MAXLOG, and memset is faster 
than for loops
+    memset(&beta_row[LL+rowEncoder_K-1][1], 0xCC, 
sizeof(float)*(max_states_row-1));
     
     // initialize alpha_prime_row (current time instant), alpha_prime_row then 
gets updated
     // by shifting in alpha_row at the end of each time instant of processing
@@ -226,10 +226,10 @@ void tpc_decoder::siso_decode_row() {
     // the initialization below is saying that the likelihood of starting at 
state=0 is
     // 100%, b/c state 1, 2, 3's likelihoods are basically -inf
     // as with the beta_row array, this implies that the forward trellis 
started at state=0
-//    for (state=1;state<max_states_row;state++) {
-//             alpha_prime_row[state] = -MAXLOG;
-//     }
-    memset(&alpha_prime_row[1], 0xCCCC, sizeof(float)*(max_states_row-1));
+    //    for (state=1;state<max_states_row;state++) {
+    //         alpha_prime_row[state] = -MAXLOG;
+    // }
+    memset(&alpha_prime_row[1], 0xCC, sizeof(float)*(max_states_row-1));
     
     // compute the beta_row matrix first, which is the reverse sweep (hence we 
start at the last
     // time instant-1 and work our way back to t=0).  we start at last time 
instant-1 b/c
@@ -304,7 +304,7 @@ void tpc_decoder::siso_decode_row() {
 //        for (state=0;state<max_states_row;state++) {
 //                     alpha_row[state] = -MAXLOG;
 //             }
-        memset(&alpha_row[0], 0xCCCC, max_states_row*sizeof(float));
+        memset(&alpha_row[0], 0xCC, max_states_row*sizeof(float));
 
         // assign inputs
         if (k-1 < LL)
@@ -426,7 +426,7 @@ void tpc_decoder::siso_decode_col() {
 //    for(state=1; state<max_states_col; state++) {
 //             beta_col[LL+colEncoder_K-1][state] = -MAXLOG;
 //     }
-    memset(&beta_col[LL+colEncoder_K-1][1], 0xCCCC, 
sizeof(float)*(max_states_col-1));
+    memset(&beta_col[LL+colEncoder_K-1][1], 0xCC, 
sizeof(float)*(max_states_col-1));
 
     // initialize alpha_prime_col (current time instant), alpha_prime_col then 
gets updated
     // by shifting in alpha_col at the end of each time instant of processing
@@ -438,7 +438,7 @@ void tpc_decoder::siso_decode_col() {
 //    for (state=1;state<max_states_col;state++) {
 //             alpha_prime_col[state] = -MAXLOG;
 //     }
-    memset(&alpha_prime_col[1], 0xCCCC, sizeof(float)*(max_states_col-1));
+    memset(&alpha_prime_col[1], 0xCC, sizeof(float)*(max_states_col-1));
 
     // compute the beta_col matrix first, which is the reverse sweep (hence we 
start at the last
     // time instant-1 and work our way back to t=0).  we start at last time 
instant-1 b/c
@@ -513,7 +513,7 @@ void tpc_decoder::siso_decode_col() {
 //        for (state=0;state<max_states_col;state++) {
 //                     alpha_col[state] = -MAXLOG;
 //             }
-        memset(&alpha_col[0], 0xCCCC, max_states_col*sizeof(float));
+        memset(&alpha_col[0], 0xCC, max_states_col*sizeof(float));
 
         // assign inputs
         if (k-1 < LL)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]