Browse Source

ft8: initialize cached statistics members

Initialize mean_, stddev_, and b_ in the Stats constructor so the cached
members are not left indeterminate before finalize() populates them.
The finalized_ state already protects these members from being read before
they are calculated, so this is a defensive initialization rather than a
functional fix.

Detected by cppcheck.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 3 months ago
parent
commit
97db87d3c2
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 3
      ft8/ft8stats.cpp

3
ft8/ft8stats.cpp

@ -28,6 +28,9 @@ namespace FT8 { @@ -28,6 +28,9 @@ namespace FT8 {
Stats::Stats(int how, float log_tail, float log_rate) :
sum_(0),
finalized_(false),
mean_(0),
stddev_(0),
b_(0),
how_(how),
log_tail_(log_tail),
log_rate_(log_rate)

Loading…
Cancel
Save