[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/03: filter: compare as integers to make
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/03: filter: compare as integers to make sure we're within the right bounds. |
Date: |
Mon, 3 Mar 2014 21:54:13 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit f31b149575bfa85b9abd7e8fe37d44afc8bb3ceb
Author: Tom Rondeau <address@hidden>
Date: Mon Mar 3 16:28:11 2014 -0500
filter: compare as integers to make sure we're within the right bounds.
Fixes CID 1189413: Unsigned compared against 0 (NO_EFFECT)
---
gr-filter/lib/pfb_synthesizer_ccf_impl.cc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gr-filter/lib/pfb_synthesizer_ccf_impl.cc
b/gr-filter/lib/pfb_synthesizer_ccf_impl.cc
index bdfc158..88c3fce 100644
--- a/gr-filter/lib/pfb_synthesizer_ccf_impl.cc
+++ b/gr-filter/lib/pfb_synthesizer_ccf_impl.cc
@@ -220,15 +220,15 @@ namespace gr {
gr::thread::scoped_lock guard(d_mutex);
if(map.size() > 0) {
- unsigned int max = (unsigned int)*std::max_element(map.begin(),
map.end());
- unsigned int min = (unsigned int)*std::min_element(map.begin(),
map.end());
- if((max >= d_twox*d_numchans) || (min < 0)) {
+ int max = *std::max_element(map.begin(), map.end());
+ int min = *std::min_element(map.begin(), map.end());
+ if((max >= static_cast<int>(d_twox*d_numchans)) || (min < 0)) {
throw
std::invalid_argument("pfb_synthesizer_ccf_impl::set_channel_map: map range out
of bounds.\n");
}
d_channel_map = map;
// Zero out fft buffer so that unused channels are always 0
- memset(d_fft->get_inbuf(), 0,d_twox*d_numchans*sizeof(gr_complex));
+ memset(d_fft->get_inbuf(), 0, d_twox*d_numchans*sizeof(gr_complex));
}
}