Skip to content

Commit

Permalink
blocks: fix signedness issues in moving_average
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcorgan committed Oct 5, 2017
1 parent bc9da7e commit a5c1bc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gr-blocks/lib/moving_average_XX_impl.cc.t
Expand Up @@ -104,7 +104,7 @@ namespace gr {
unsigned int num_iter = (unsigned int)((noutput_items>d_max_iter) ? d_max_iter : noutput_items);
if(d_vlen == 1) {
@I_TYPE@ sum = in[0];
for(unsigned int i = 1; i < d_length-1; i++) {
for(int i = 1; i < d_length-1; i++) {
sum += in[i];
}

Expand All @@ -120,7 +120,7 @@ namespace gr {
d_sum[elem] = in[elem];
}

for(unsigned int i = 1; i < d_length - 1; i++) {
for(int i = 1; i < d_length - 1; i++) {
for(unsigned int elem = 0; elem < d_vlen; elem++) {
d_sum[elem] += in[i*d_vlen + elem];
}
Expand Down

0 comments on commit a5c1bc7

Please sign in to comment.