resolve compiler warning:
warning[-Wunused-but-set-variable=]: variable ‘dOfs’ set but not used
by removing it.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Check the return value from avformat_write_header() and stop TS generation
when writing the header fails.
Use a common cleanup path for codec and format resources on setup failures.
This resolves the -Wunused-result compiler warning while ensuring failures
do not continue into TS packet generation.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Use value-initialization for the AVPacket so all packet fields are initialized
without triggering -Wmissing-field-initializers from modern compilers.
This replaces the partial initializer while preserving the existing packet
handling behavior.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Replace the deprecated av_init_packet() API with av_packet_alloc() and free
the allocated packet through the existing cleanup path.
This gives the packet explicit ownership and ensures it is released on both
successful and error paths.
This resolves the deprecated API warning reported by the compiler.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Move m_nrziBit initialization to match its declaration order in AISModSource.
The initializer list previously initialized m_nrziBit after m_state even though
m_nrziBit is declared earlier in the class, producing a -Wreorder compiler
warning.
This removes the initializer-order warning without changing behavior.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_spectrumVis to nullptr so the SSB baseband has a defined
spectrum sink state before a spectrum visualizer is attached.
The pointer was previously left uninitialized until setSpectrumSink() was
called.
This resolves the uninitialized member finding reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_levelMeter to nullptr so the SSB modulator has a defined level
meter state before a level meter is attached.
The pointer was previously left uninitialized, allowing an indeterminate
value to remain until setLevelMeter() was called.
This resolves the uninitialized member finding reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_repeatCount from the constructor argument so the dialog state is
defined when the dialog is created.
The member was previously left uninitialized despite the constructor receiving
the value used to initialize the corresponding UI control.
This resolves the uninitialized member finding reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_repeatCount from the constructor argument so the dialog state is
defined when the dialog is created.
The member was previously left uninitialized despite the constructor receiving
the value used to initialize the corresponding UI control.
This resolves the uninitialized member finding reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the packet TX settings dialog members from their corresponding
constructor arguments so the dialog state is defined when the dialog is
created.
These members were previously left uninitialized despite the constructor
receiving the values used to initialize the corresponding UI controls.
This resolves the uninitialized member findings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_repeatDelay and m_repeatCount from the corresponding constructor
arguments so the dialog state is defined when the dialog is created.
These members were previously left uninitialized despite the constructor
receiving the values used to initialize the corresponding UI controls.
This resolves the uninitialized member findings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the packet BPF dialog members from their corresponding constructor
arguments so the dialog state is defined when the dialog is created.
These members were previously left uninitialized despite the constructor
receiving the values used to initialize the corresponding UI controls.
This resolves the uninitialized member findings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
The final bytesToHex() call in toHexCharArray() returns the advanced buffer
pointer, but the pointer is not used after the call. Discard the return value
explicitly while retaining the function call that writes the payload into the
output buffer.
This removes the ineffective parameter assignment reported by cppcheck without
changing the generated frame data.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the NFM modulator thread and baseband source pointers to null so
their state is defined before the corresponding runtime components are created.
These members were previously left uninitialized, allowing indeterminate pointer
values to exist during the initial object state.
This resolves the uninitialized pointer findings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize t1 to zero so the modulator produces a defined sample when no
carrier is present.
t1 was previously only assigned when carrier was true but was used
unconditionally when writing to the modulation buffer, allowing an
uninitialized value to be used.
This resolves the uninitialized scalar finding reported by Coverity
(UNINIT).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the M17 LICH segment array and position insertion toggle so their
state is defined when the processor is constructed.
The LICH array and insertion toggle were previously left uninitialized, which
could result in indeterminate state when they were accessed before being
explicitly assigned.
This resolves the uninitialized member findings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_fifoEmpty to true in both M17ModFIFO constructors so a newly
created FIFO has a defined empty state before any samples are written.
The parameterized constructor previously left m_fifoEmpty uninitialized,
allowing FIFO state to depend on an indeterminate value.
This resolves the uninitialized member finding reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the decimator configuration, kernel state, and cursor before the
object can be used. These members were previously left uninitialized until
initialize() was called, leaving the object with indeterminate state between
construction and initialization.
This resolves the uninitialized member findings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the payload symbol count, modulation efficiency, and configuration
update state before they can be accessed by DVB-S2 processing.
These members were previously left uninitialized, allowing indeterminate values
to be used before the corresponding configuration state had been established.
This resolves the uninitialized member findings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the DVB-S2 frame format and LDPC encoding state so their members
start with defined values before configuration and encoding operations use them.
The members were previously left uninitialized, allowing indeterminate state
to persist until individual fields were assigned.
This resolves the uninitialized member findings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
The modulation and FEC switches in getDVBSDataBitrate() did not define values
for unsupported settings, allowing execution to continue with uninitialized
bitrate calculation inputs. Return an invalid bitrate for unsupported settings
and check the result before using it.
Avoid passing an invalid bitrate to still-image TS generation, and keep
modulateSample() running so the existing null transport-stream packet handling
can continue to produce samples when generation cannot proceed.
Coverity identified these paths as uninitialized scalar variables
(UNINIT).
Initialize the AM modulator thread, running state, and baseband source
pointers in the constructor.
These members were previously left uninitialized, which could result in
undefined values when the object state was accessed before the corresponding
runtime components were created.
This resolves the uninitialized member warnings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the AIS TX settings dialog members from their corresponding
constructor arguments so the dialog state is valid when the dialog is
created.
These members were previously left uninitialized despite the constructor
receiving the values used to initialize the dialog controls.
This resolves the uninitialized member warnings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_repeatDelay and m_repeatCount from the corresponding constructor
arguments so the dialog state is valid when the dialog is created.
These members were previously left uninitialized despite the constructor
receiving the values used to initialize the dialog controls.
This resolves the uninitialized member warnings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the TX settings dialog members from their corresponding constructor
arguments so the dialog state is valid when the dialog is created.
These members were previously left uninitialized despite the constructor
receiving the values used to populate the dialog controls.
This resolves the uninitialized member warnings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_repeatDelay and m_repeatCount from the corresponding constructor
arguments so the dialog state is valid when the dialog is created.
These members were previously left uninitialized until the dialog was accepted,
despite representing the initial repeat settings passed to the constructor.
This resolves the uninitialized member warnings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize previously uninitialized UDPSourceSource magnitude and level members
to safe default values to eliminate cppcheck UNINIT_CTOR warnings. This ensures
input magnitude and level tracking start in a defined state and avoids undefined
behavior from reading uninitialized data.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize previously uninitialized RttyModSource members to safe default values
to eliminate cppcheck UNINIT_CTOR warnings. This ensures bit and level state,
sample and bit counters, and the GUI message queue start in a defined state
and avoids undefined behavior from reading uninitialized data.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previously uninitialized m_writeToFile member to false to
eliminate the cppcheck UNINIT_CTOR warning and ensure the file-writing option
starts in a defined state.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize previously uninitialized PSK31Source members to safe default values
to eliminate cppcheck UNINIT_CTOR warnings. This ensures symbol state, level
tracking, sample indexing, and the GUI message queue start in a defined state
and avoids undefined behavior from reading uninitialized data.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize previously uninitialized PacketModSource members to safe default
values to eliminate cppcheck UNINIT_CTOR warnings. This ensures modulation
state, level tracking, counters, and the transmit bit buffer start in a
defined state and avoids undefined behavior from reading uninitialized data.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previously uninitialized DCS word, polarity, and bit-per-step
members to defined values to eliminate cppcheck UNINIT_CTOR warnings. This
ensures the DCS modulator starts with a defined state before reset() and
subsequent modulation operations.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previously uninitialized RMS and peak output level members to
zero to eliminate cppcheck UNINIT_CTOR warnings. Also correct the indentation
of the existing level member initializers for consistent formatting and
readability.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previously uninitialized spread factor and deinterleaving bit
members to zero to eliminate cppcheck UNINIT_CTOR warnings. This ensures
the encoder starts with a defined configuration state before its settings
are applied.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previously uninitialized RMS and peak output level members to
zero to eliminate cppcheck UNINIT_CTOR warnings. Also correct the indentation
of the existing level member initializers for consistent formatting and
readability.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previously uninitialized spread factor and deinterleaving bit
members to zero to eliminate cppcheck UNINIT_CTOR warnings. This ensures
the encoder starts with a defined configuration state before its settings
are applied.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the MPEG transport stream, IQ symbol, and UDP buffers to zero to
eliminate cppcheck UNINIT_CTOR warnings. This ensures the buffers have a
defined initial state before they are accessed during DATV modulation and
avoids undefined behavior from reading uninitialized data.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize previously uninitialized DVBS members to safe default values to
eliminate cppcheck UNINIT_CTOR warnings and prevent undefined behavior from
reading uninitialized state.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize previously uninitialized DATVModSource members to safe default
values to eliminate cppcheck UNINIT_CTOR warnings and prevent undefined
behavior from reading uninitialized state.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previously uninitialized RMS and peak level members to
safe default values to eliminate cppcheck UNINIT_CTOR warnings and
prevent undefined behavior from reading uninitialized state.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previously uninitialized message type to MessageNone to
eliminate the cppcheck UNINIT_CTOR warning and ensure the member has a
defined value before resetToDefaults() is called.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize previously uninitialized ChirpChatModEncoder members to safe
default values to eliminate cppcheck UNINIT_CTOR warnings and prevent
undefined behavior from reading uninitialized state.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize previously uninitialized ATVModSource members to safe default
values to eliminate cppcheck UNINIT_CTOR warnings and uninitialized member
warnings reported by Coverity (UNINIT_CTOR). and prevent undefined behavior
from reading uninitialized state.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize previously uninitialized LocalSourceSource members to safe
default values to eliminate cppcheck UNINIT_CTOR warnings and prevent
undefined behavior from reading uninitialized state.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
The same fix as da31464dd for the plugins whose applySettings takes the key list first, which
that sweep missed: 35 channels, modulators, sinks, sources and one MIMO device copied the
whole settings struct on every message, so a GUI message with no keys arriving just after an
API patch put the old values back. The DSD demodulator lost the deviation set at creation
this way.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A number of settings keys existed in the spec and in the SWG classes but
were missing from the plugin's webapi handlers, so setting them over the
API silently did nothing: dnrScheme on the SSB demodulator, aprsData on
the M17 modulator, pulseShaping on the packet, PSK31 and RTTY modulators,
audioDeviceName on Simple PTT, period, autosave, autoload, autosavePeriod
and filename on SID, and several on Star Tracker, XTRX and the Android SDR
driver input.
Three more were spelled so that they could never match. The channel
analyzer tested for "rationalDownSample " with a trailing space, radio
astronomy tested for "sweep12Start" and "sweep12Stop" rather than
"sweep2Start" and "sweep2Stop", and AFC read "hasTargetFrequency" into
m_transverterTarget rather than "transverterTarget". The channel analyzer
also now accepts the shorter "frequency", "downSample" and
"downSamplerRate" spellings alongside the existing ones.
MapSettings::applySettings ignored rgbColor and mapType, so a patch
carrying them was accepted and then dropped.
Registers MCPServer.yaml in the web API resources so it is served with the
rest of the documentation, and drops a redundant nested guard in the Sky
Map report left by the QString leak fix.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The generated SWG setters overwrite the string pointer without deleting
what is already there, and every webapiSettingsGet and webapiReportGet
calls init() first, which has allocated one. Each call therefore leaked a
QString per string field. Measured at 117 bytes per settings GET for the
Satellite Tracker, over 20,000 requests.
Assign in place when the pointer is already set, which is what these same
functions have always done for title and reverseAPIAddress. 394 sites
across webapiFormatChannelSettings, webapiFormatDeviceSettings,
webapiFormatFeatureSettings and the three report equivalents.
The webapiReverseSend* functions are deliberately left alone: they build a
fresh SWG object whose constructor leaves the pointers null, so passing a
new QString is correct there.
After the change the same measurement is flat, at 7 bytes per GET.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Use the validated bandwidth index when accessing bandwidth tables in the
ChirpChat, MeshCore, and Meshtastic channel GUIs. The previous code used the
raw UI value after clamping it into m_bandwidthIndex, allowing negative or
out-of-range array accesses.
Found by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>