[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 04/08: dtv: use numeric_limits for min/max
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 04/08: dtv: use numeric_limits for min/max values |
Date: |
Mon, 30 Jan 2017 13:38:40 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 26a882e5ae12ee26ba9c2788ed27164896993f3d
Author: Bastian Bloessl <address@hidden>
Date: Sun Jan 29 13:54:20 2017 +0100
dtv: use numeric_limits for min/max values
---
gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc
b/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc
index 135d622..1a347d3 100644
--- a/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc
+++ b/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc
@@ -25,6 +25,7 @@
#include <gnuradio/io_signature.h>
#include "dvbt_ofdm_sym_acquisition_impl.h"
#include <complex>
+#include <limits>
#include <gnuradio/math.h>
#include <gnuradio/expj.h>
#include <volk/volk.h>
@@ -37,8 +38,8 @@ namespace gr {
{
d_avg_alpha = alpha;
d_threshold_factor_rise = threshold_factor_rise;
- d_avg_max = - (float)INFINITY;
- d_avg_min = (float)INFINITY;
+ d_avg_max = std::numeric_limits<float>::min();
+ d_avg_min = std::numeric_limits<float>::max();
return (0);
}
@@ -54,7 +55,7 @@ namespace gr {
peak_pos_length = 1;
if (datain_length >= d_fft_length) {
float min = datain[(peak_index + d_fft_length / 2) % d_fft_length];
- if (d_avg_min == (float)INFINITY) {
+ if (d_avg_min == std::numeric_limits<float>::max()) {
d_avg_min = min;
}
else {
@@ -62,7 +63,7 @@ namespace gr {
}
}
- if (d_avg_max == -(float)INFINITY) {
+ if (d_avg_max == std::numeric_limits<float>::min()) {
// Initialize d_avg_max with the first value.
d_avg_max = datain[peak_index];
}
- [Commit-gnuradio] [gnuradio] branch maint updated (034a7d4 -> 884eddf), git, 2017/01/30
- [Commit-gnuradio] [gnuradio] 05/08: Merge remote-tracking branch 'nowls/tpc-includes' into maint, git, 2017/01/30
- [Commit-gnuradio] [gnuradio] 01/08: fec: install TPC header files, git, 2017/01/30
- [Commit-gnuradio] [gnuradio] 03/08: blocks: peak detector fix initial value, git, 2017/01/30
- [Commit-gnuradio] [gnuradio] 04/08: dtv: use numeric_limits for min/max values,
git <=
- [Commit-gnuradio] [gnuradio] 07/08: Merge remote-tracking branch 'kartikp/time_sink_grc_syntax' into maint, git, 2017/01/30
- [Commit-gnuradio] [gnuradio] 08/08: Merge remote-tracking branch 'bastibl/peak-detector-init' into maint, git, 2017/01/30
- [Commit-gnuradio] [gnuradio] 02/08: qtgui: Time Sink: redundant config options removed, git, 2017/01/30
- [Commit-gnuradio] [gnuradio] 06/08: fix typo on descriptor, git, 2017/01/30