1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-06 10:56:34 -04:00
Commit Graph

6507 Commits

Author SHA1 Message Date
Edouard Griffiths f6ed9b8cb3 Merge pull request #2868 from rgetz/rgetz-fix-copypaste
vorlocalizer: Fix round robin plan sorting comparator
2026-08-02 16:21:00 +02:00
Edouard Griffiths 744bb7e18d Merge pull request #2862 from rgetz/rgetz-fix-remaining-vlas
Remove remaining variable length arrays from demoddatv/ldpctool/generic.h
2026-08-02 05:30:31 +02:00
Edouard Griffiths f72133eee0 Merge pull request #2866 from rgetz/rgetz-fix-memsetClass
leansdr: Properly initialize QPSK hist buffer
2026-08-02 02:17:33 +02:00
Robin Getz d122e69fba ldpctool: Remove VLAs from SumProductAlgorithm
Replace variable length arrays in SumProductAlgorithm::finalp() with a
std::vector buffers.

This removes reliance on compiler VLA extensions while preserving the
existing contiguous temporary buffer layout.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:48:46 -04:00
Robin Getz 85021508f1 ldpctool: Remove VLAs from LambdaMinAlgorithm
Replace variable length arrays in LambdaMinAlgorithm::finalp() with
std::vector storage.

Update nth_element() usage to operate on vector iterators while removing
the non-standard VLA usage.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:48:46 -04:00
Robin Getz e4561aeb77 ldpctool: Remove VLAs from LogDomainSPA
Replace variable length arrays in LogDomainSPA::finalp() with
std::vector buffers.

This removes reliance on compiler VLA extensions while preserving the
existing contiguous temporary buffer layout.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:48:46 -04:00
Robin Getz 7e26f86aa6 ldpctool: Remove VLAs from MinSumCAlgorithm<int8_t, FACTOR>
Replace the variable length temporary array in the int8_t FACTOR
specialization of MinSumCAlgorithm::finalp() with a std::vector buffer.

This removes reliance on compiler VLA extensions and uses standard C++
storage for the temporary reduction buffer.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:48:45 -04:00
Robin Getz 8ac0485e53 ldpctool: Remove VLAs from MinSumCAlgorithm<float, FACTOR>
Replace the variable length temporary array in the float FACTOR
specialization of MinSumCAlgorithm::finalp() with a std::vector buffer.

This removes reliance on compiler VLA extensions and uses standard C++
storage for the temporary reduction buffer.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:48:45 -04:00
Robin Getz 4ccc7a9bfd ldpctool: Remove VLA from MinSumCAlgorithm
Replace the variable length temporary array in MinSumCAlgorithm::finalp()
with a std::vector buffer.

This removes reliance on compiler VLA extensions and uses standard C++
storage for the temporary reduction buffer.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:48:44 -04:00
Robin Getz 4b3bf21418 ldpctool: Remove VLAs from OffsetMinSumAlgorithm<int8_t, FACTOR>
Replace variable length arrays in the int8_t FACTOR specialization of
OffsetMinSumAlgorithm::finalp() with a single std::vector scratch buffer.

This removes reliance on compiler VLA extensions while preserving the
existing contiguous temporary buffer layout.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:48:44 -04:00
Robin Getz 1f62875563 ldpctool: Remove VLAs from OffsetMinSumAlgorithm
Replace variable length arrays in OffsetMinSumAlgorithm::finalp() with a
std::vector buffers.

This removes reliance on compiler VLA extensions while preserving the
existing contiguous temporary buffer layout.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:48:44 -04:00
Robin Getz 6de853d3d1 ldpctool: Remove VLAs from MinSumAlgorithm<int8_t>
Replace variable length arrays in the int8_t specialization of
MinSumAlgorithm::finalp() with a single std::vector scratch buffer.

This removes reliance on compiler VLA extensions while preserving the
existing contiguous temporary buffer layout.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:48:43 -04:00
Robin Getz a1391d52a2 ldpctool: Remove VLAs from MinSumAlgorithm<float>
Replace variable length arrays in the float specialization of
MinSumAlgorithm::finalp() with std::vector storage.

This removes reliance on compiler VLA extensions and keeps the
temporary buffers managed by standard C++ containers.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:48:32 -04:00
Robin Getz bef0b8184e vorlocalizer: Fix round robin plan sorting comparator
The channel count comparison in getChannelsByDevice() accidentally used
the first plan's channel count for both operands. This caused the comparator
to always treat the channel counts as equal and sort only by bandwidth.

Use the second plan's channel count when comparing RRTurnPlans so plans are
ordered correctly by number of channels before applying the bandwidth
tie-breaker.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 19:16:31 -04:00
Robin Getz 1a85082dac ldpctool: Remove VLAs from MinSumAlgorithm
Replace variable length arrays in MinSumAlgorithm::finalp() with a
std::vector buffers.

Variable length arrays are a compiler extension and are not part of
standard C++. The replacement preserves the existing contiguous memory
layout while avoiding non-standard stack allocations.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 18:44:26 -04:00
Robin Getz fe22e92c29 leansdr: Properly initialize QPSK hist buffer
Replace raw memset() initialization of hist with C++ value initialization.
This avoids bypassing std::complex object initialization and ensures the
history buffer contains valid constructed objects when HIST_FLOAT is enabled.

The previous memset() relied on the in-memory representation of
std::complex<float> and could leave non-trivial objects improperly
initialized. While this typically behaved as expected with common
implementations, it was not valid C++ object initialization.

pointed out by cppcheck as:
    Using 'memset' on struct that contains a 'std::complex'

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 17:26:51 -04:00
Robin Getz 5df5469cc2 leansdr : Fix undefined shift behavior in GF(2^N) arithmetic
The gf2n implementation used a left shift on a potentially negative
value when masking field elements:

    (~(Te)0) << N

This can result in undefined behavior for signed integer types and was
reported by static analysis (cppcheck).

Require the field element type to be unsigned and replace the mask
generation with an explicit N-bit mask constructed from the element type.
Also make the overflow check use the element type to avoid implicit
signed integer operations.

Add comments documenting the packed polynomial representation and the
GF(2^N) reduction steps to clarify the intent of the bit operations.

Fixes static analysis warning about shifting negative values.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 14:49:19 -04:00
Edouard Griffiths c9c95398f3 Merge pull request #2861 from rgetz/rgetz-fix-funcArgOrderDifferent
Fix cppcheck-reported function argument order mismatches
2026-08-01 16:02:24 +02:00
Robin Getz 09980d9782 APRSGUI: Fix displayTableSettings argument order
cppcheck reported that the displayTableSettings() declaration argument
order differed from the function definition. The header declared the
arguments as (columnIndexes, columnSizes), while the implementation and
all call sites use (columnSizes, columnIndexes).

Update the declaration to match the implementation and remove ambiguity
between the table column width and ordering arrays.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-31 21:02:23 -04:00
Robin Getz e3cf04b227 Fix RadioAstronomyGUI addToPowerFilter argument order
cppcheck reported that the addToPowerFilter() declaration argument
order differed from the function definition. The header declared the
arguments as (y, x), while the implementation and all call sites use
(x, y).

Update the declaration to match the implementation and callers to avoid
confusion and potential misuse of the function arguments.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-31 20:59:42 -04:00
Jon Beniston 6f732293ec Fix formatting 2026-07-31 01:36:56 +01:00
Jon Beniston 3e986af4bc Fix a few decoding errors and small memory leaks. 2026-07-31 00:55:40 +01:00
Jon Beniston 84e7304d05 Fix encoding of + 2026-07-30 22:59:14 +01:00
Jon Beniston 9dfd11b2f5 Use latest settings when forced. 2026-07-30 22:56:44 +01:00
Jon Beniston 26f18e7402 Support OpenSky OAuth authentication. 2026-07-30 18:59:01 +01:00
Jon Beniston e27d41da1a Use stored mode-S identity. 2026-07-30 18:36:45 +01:00
Jon Beniston 703a1b6a29 Fix MSB of beast timestamp. 2026-07-30 18:30:32 +01:00
Jon Beniston 6287e4ac18 Add support for Mode-S short frames to Beast output 2026-07-30 18:29:54 +01:00
Jon Beniston 0e070d9881 Use latest settings when calculating interpolation filter 2026-07-30 18:29:18 +01:00
Jon Beniston a92c944c2c Fix opensky groundspeed and vertical rate. 2026-07-30 18:17:58 +01:00
Jon Beniston ea7571b31f m_exportServerPort is an int not a bool 2026-07-30 18:10:46 +01:00
Edouard Griffiths db89bd9b64 Merge pull request #2857 from rgetz/rgetz-cleanup-printf-format-specifiers
cleanup printf format specifiers
2026-07-28 13:11:21 +02:00
Edouard Griffiths 82ce7487fb Merge pull request #2855 from rgetz/rgetz-fix-same-expression-on-both-sides
chirpchat: Fix FT8 message type 0.4 reply detection
2026-07-27 18:39:28 +02:00
Edouard Griffiths a7969d1c8a Merge pull request #2852 from rgetz/rgetz-reduce-vlas-dvbs2
continue to reduce (eliminate) VLA usage from leansdr
2026-07-27 12:42:33 +02:00
Edouard Griffiths 6efccde2e3 Merge pull request #2851 from rgetz/rgetz-fix-incorrect-iterator
ADSB Demod: Fix incorrect iterator range when restoring column sizes
2026-07-27 11:56:44 +02:00
Robin Getz 655841008e leansdr: Fix unsigned printf format specifiers
Replace signed %ld format specifiers with unsigned %lu conversions when
printing values stored as unsigned long.

The previous format strings passed unsigned values to signed printf
conversions, which could result in undefined behavior due to variadic
argument type mismatches. These issues were identified by cppcheck
invalidPrintfArgType_sint warnings.

Use format specifiers matching the actual argument types to ensure
correct and portable printf usage.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 18:43:36 -04:00
Robin Getz b6c9ed2057 chirpchat: Fix FT8 message type 0.4 reply detection
Fix a copy/paste error in decodeSymbols() where FT8 message type
0.3 was checked twice, preventing type 0.4 messages from being
recognized as replies.

FT8::Packing supports both 0.3 and 0.4 message types using the same
reply bit location.

Detected by cppcheck as a redundant condition.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 16:46:11 -04:00
Edouard Griffiths 7ade66e467 Merge pull request #2845 from rgetz/rgetz-fix-boolean-bitwise
Fix UDP port validation boolean operations
2026-07-26 21:40:09 +02:00
Robin Getz f57e6d3568 DATV: Replace DVB-S2 pilot VLA buffers with std::vector
Replace variable-length arrays used for DVB-S2 pilot symbol matching with
std::vector allocations.

Use vector::data() when passing buffers to the existing pointer-based
match_ph_amp() function. This removes non-standard VLA usage and improves
C++ portability without changing behavior.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 14:54:12 -04:00
Robin Getz def0a877db DATV: Replace DVB-S2 pilot VLA buffers with std::vector
Replace variable-length arrays used for DVB-S2 pilot symbol matching with
std::vector allocations.

Use vector::data() when passing buffers to the existing pointer-based
match_ph_amp() function. This removes additional non-standard VLA usage and
improves C++ portability without changing behavior.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 14:50:25 -04:00
Robin Getz 1e72e94bb5 DATV: Replace DVB-S2 SOF VLA buffer with std::vector
Replace the variable-length array used for SOF symbol buffering in the
DVB-S2 frame receiver with a std::vector allocation.

Use vector::data() when passing the buffer to the existing pointer-based
conjugate product function. This removes another non-standard VLA usage and
improves C++ portability without changing behavior.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 14:45:38 -04:00
Robin Getz 16ab693062 DATV: Replace DVB-S2 VLA buffers with std::vector
Replace non-standard variable-length arrays used for PLHEADER symbol
processing with std::vector allocations. Update buffer copies and pointer
interfaces accordingly while preserving existing behavior.

This removes VLA compiler/static analysis warnings and improves C++
portability.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 14:38:53 -04:00
Robin Getz 60dbed7fc3 dvbs2.h : remove tabs, replace with spaces
to match style

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 14:33:38 -04:00
Edouard Griffiths 31197025b4 Merge pull request #2844 from rgetz/rgetz-fix-testmi
testmi: Fix missing m_title copy in TestMISettings
2026-07-26 20:21:35 +02:00
Robin Getz 66d28efcc1 ADSB Demod: Fix incorrect iterator range when restoring column sizes
cppcheck reported that the std::copy() call used iterators from different
containers when restoring ADSB demod table column sizes.

The copy operation used settings.m_columnSizes as the source start iterator
but settings.m_columnIndexes as the source end iterator. This was likely a
copy/paste error and resulted in an invalid iterator range.

Use settings.m_columnSizes for both source iterators so column size settings
are restored correctly.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-26 13:44:02 -04:00
Edouard Griffiths e01381996d Merge pull request #2842 from rgetz/rgetz-leansdr-fail-fatal
DATV: Convert leansdr fail and fatal errors into C++ exceptions
2026-07-26 13:30:01 +02:00
Edouard Griffiths 148ca3870e Merge pull request #2841 from rgetz/rgetz-reduce-vla-ldpctool-algorithms
step2 : reduce vlas
2026-07-26 09:59:50 +02:00
Robin Getz 0ee3237db5 Fix UDP port validation boolean operations
cppcheck reported boolean expressions being used in bitwise operations
when validating UDP ports. Replace accidental '&' operators with logical
'&&' operators.

Also replace hard-coded port range limits with UINT16_MAX to make the
valid UDP port range explicit and keep UDP source/sink validation
consistent.

No functional change.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 20:11:59 -04:00
Robin Getz 5c359aa0a4 testmi: Fix missing m_title copy in TestMISettings
cppcheck reported that the TestMISettings copy constructor did not
initialize member variable m_title:
  Member variable 'TestMISettings::m_title' is not assigned in the copy
  constructor. Should it be copied?

m_title is part of the serialized settings state, so ensure copied
TestMISettings instances preserve the configured title value.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 19:51:39 -04:00
Robin Getz e86e95feab DATV: Convert leansdr fail and fatal errors into C++ exceptions
The original leansdr code uses fatal() and fail() for unrecoverable errors by
terminating execution. When integrated into SDRangel, these error paths did
not provide a mechanism for the plugin to handle failures locally, allowing
initialization failures to escape the normal plugin lifecycle.

Convert leansdr fatal() and fail() handling into C++ exceptions so DATV can
detect framework initialization failures, report them, and cleanly return
control to SDRangel instead of allowing the error to terminate the application.
This behavior is desirable because a DATV framework configuration failure
should not bring down the entire application.

Catch initialization exceptions in DATVDemodSink::feed(), report the failure,
clean up the partially initialized framework, and return to the caller.

Add noreturn annotations to the leansdr error functions and include the
leansdr source in exception messages to make failures easier to diagnose.

This does not redesign leansdr error handling or provide recovery from
runtime DSP failures. It only adds an exception boundary between the
leansdr library code and the SDRangel plugin lifecycle.

noticed via cppcheck indicating many Array indexes could go out of bounds
due to fail and fatal returning.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 18:50:40 -04:00