Add a terminating LF to tracked text files that were missing a
newline at end of file. This avoids Codacy whitespace failures and
ensures text files conform to the repository line-ending policy.
Affected files were identified and fixed with the following script.
It checks all tracked files against .gitattributes, skips files marked
as binary or -text, and reports the final 32 bytes of any non-empty text
file that does not end with LF before adding the missing newline.
git ls-files -z |
while IFS= read -r -d '' f; do
attr=$(git check-attr text -- "$f")
case "$attr" in
"$f: text: unset"|"$f: text: unspecified")
continue
;;
esac
[ -f "$f" ] || continue
[ -s "$f" ] || continue
[ "$(tail -c 1 -- "$f" | od -An -t x1 | tr -d ' \n')" = "0a" ] || {
printf '%s\n' "$f"
tail -c 32 -- "$f" | hexdump -C
printf '\n' >> "$f"
}
done
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Normalize existing text files to LF to conform to the repository-wide
line-ending policy defined by .gitattributes by:
git add --renormalize .
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Normalize text files to LF and explicitly identify binary assets,
generated, and vendor files so so Git does not apply line-ending
conversion to them.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
MessageQueue::pop() transfers ownership of the popped message to the
caller, but many handleInputMessages() implementations only deleted
the message when handleMessage() returned true. When a message was not
handled, ownership had already been transferred from the queue and the
message was leaked.
This was identified while investigating an ASAN leak in the audio
subsystem.
Update the applicable handleInputMessages() implementations to always
delete messages after handleMessage() returns. Unhandled messages are
also logged with the component and message identifier so unexpected
message routing is visible during debugging.
This change:
- Ensures every message popped from a queue has its ownership resolved.
- Prevents leaks when handleMessage() returns false.
- Makes unhandled messages visible instead of silently discarding them.
- Preserves the existing message handling logic and does not require
components to handle message types that are legitimately irrelevant
to them.
The changes are intentionally mechanical and limited to the common
message queue ownership and diagnostic pattern.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the destination ID so AIS single-slot binary messages have a
defined value when no destination is indicated.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the heading availability flag and heading value so SAR aircraft
position reports have defined heading state before the decoded message data
is used. This avoids undefined behavior from reading uninitialized members.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize APRS packet fields and telemetry buffers so a default-constructed
packet has defined values for decoded position, weather, station, telemetry,
and other optional data. This prevents undefined behavior when optional
fields are accessed before their corresponding presence flags are set.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize all AudioCompressorSnd data members in the constructor so
the compressor state and audio buffers have defined values before use.
This prevents undefined behavior from reading uninitialized member
variables.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the filter state buffers in the constructor so filter processing
starts from a defined state rather than reading uninitialized values. This
avoids undefined behavior and makes the initial filter output deterministic.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the manager message queue pointer so AudioInputDevice instances
do not retain an indeterminate pointer before a manager queue is assigned.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the indices and object pointer with safe default values so
default-constructed AvailableChannelOrFeature instances have defined state
before their members are accessed. This prevents undefined behavior from
using uninitialized data.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the reversed polynomial so crc instances have a defined value
before the non-MSB-first configuration calculates it.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the MIMO type so DeviceSampleMIMO starts with a defined mode
before a derived device configures its specific synchronization behavior.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the spectrum visualizer pointer before the device type determines
whether a SpectrumVis instance is created. This ensures unsupported or
unexpected device types leave the member in a defined state.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the noise reduction configuration members in all fftfilt
constructors so they have defined values before noise reduction processing
uses them. This prevents undefined behavior and ensures consistent default
configuration regardless of which constructor is used.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize FFTNoiseReduction magnitude state and ExponentialFilter previous
value so noise reduction calculations start from defined values. This
prevents undefined behavior from using uninitialized state during filtering.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the feature state and workspace and feature-set indices so a newly
constructed Feature has defined values before its state or indices are queried.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the sample shift member so file recording starts with a defined
shift value before it is used. This prevents undefined behavior from
accessing an uninitialized member.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the GUI message queue pointer so FileRecordInterface starts with
a defined value before the GUI queue is assigned.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize FITS scalar members so partially parsed or invalid resources leave
the object with defined dimensions, scaling, coordinate, and data offset
values.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the Golay correction tables so the decoder starts with defined
table contents before they are populated and used. This avoids undefined
behavior from accessing uninitialized member storage.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the default kissfft constructor members so a default-constructed
instance has a defined FFT size and direction before they are accessed.
This prevents undefined behavior from using uninitialized member variables.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize KiwiSDR parsing state and log previously unhandled keys once per
process. This gives newly parsed records defined member values while making
unexpected fields in the KiwiSDR data visible without repeatedly flooding
the debug log.
Found by cppcheck (uninitMemberVar) and Coverity
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize MorseDemod state and message queue members so a newly constructed
demodulator has defined values before identification and bit timing
processing begins. This prevents undefined behavior from accessing
uninitialized member variables.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the moving average sample buffer so a newly constructed instance
has defined storage before samples are accumulated or accessed.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the NCO phase, increment, LFSR, and dithering state so the
oscillator begins from defined values before generating samples. This
avoids undefined behavior from reading uninitialized member variables.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the country index so a newly constructed OpenAIP instance starts
with a defined value.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the PNG image dimensions so a newly constructed instance starts
with defined width and height values before they are accessed.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
The previous implementation shifted a signed 32-bit value by up to 31 bits,
which is implementation-defined behavior. It also had a fixed 32-bit limit
and different semantics from the compiler built-ins.
Use unsigned integer semantics and Brian Kernighan's method for the portable
popcount implementation. This avoids implementation-defined signed right
shifts and counts all bits in the unsigned integer type, matching the
semantics of the compiler built-ins and C++20 std::popcount, and should have
a minor speed improvement for random samples.
Found by cppcheck (shiftTooManyBitsSigned)
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the selected device sequence and item index so default-constructed
device selections contain defined index values before they are used. This
avoids undefined behavior from accessing uninitialized members.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previous projected value so the first calculation has a
defined starting state rather than depending on whatever value happens to
be in the member.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the RS41 pressure, temperature, and humidity measurements so
decoded frames have defined sensor values before calibration or other
processing uses them.
Initialize the RS41 frame number and navigation fields so frames without
corresponding status or GPS data leave these values defined.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Explicitly mark the serial parameter as unused to avoid a compiler warning
while retaining the parameter in the constructor interface.
Found by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the replay loop flag so a newly created buffer has a defined
playback mode before the buffer is used. This avoids undefined behavior
from evaluating an uninitialized member.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the FIFO sizing, guard, position, and read/write tracking members
so the default constructor establishes a complete and predictable state.
This avoids undefined behavior if the FIFO is accessed before being fully
configured.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the FIFO sizing, guard, midpoint, and read/write tracking
members so the default constructor leaves the object in a defined state.
This ensures FIFO state is valid even if the object is accessed before
explicit configuration.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the conversion buffer size so a default-constructed
ConvertBuffers instance has a defined size before the value is used.
This avoids undefined behavior from reading an uninitialized member.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the deserializer version so invalid or incomplete data leaves the
version field with a defined value.
Found by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Add parentheses around the nested ternary expressions used when clamping
histogram and waterfall marker counts. This makes the intended evaluation
order explicit and avoids ambiguity in static analysis of the conditional
expressions.
Found by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the VISA debug I/O flag so the interface starts with a defined
debug state before any VISA operations check or update it.
Found by cppcheck (uninitMemberVar).
Signed-off-by: Robin Getz <rgetz503@gmail.com>