lib: Fix compiler warning in db_dbsrx.cpp

On modern compilers, this file could cause a warning such as:

warning: ‘void operator delete(void*, std::size_t)’ called on pointer
‘<unknown>’ with nonzero offset [8, 9223372036854775800]
[-Wfree-nonheap-object]

A minor refactoring avoids the warning, even though it was unlikely
a real issue in the first place.
This commit is contained in:
Martin Braun 2026-07-28 15:29:01 +02:00 committed by mkoop-ni
parent e416bffa95
commit 2a2ce50abe

View File

@ -267,10 +267,10 @@ double dbsrx::set_lo_freq(double target_freq)
int R = 0, N = 0, r = 0, m = 0;
bool update_filter_settings = false;
// choose refclock
std::vector<double> clock_rates =
this->get_iface()->get_clock_rates(dboard_iface::UNIT_RX);
const double max_clock_rate = uhd::sorted(clock_rates).back();
for (auto ref_clock_it : uhd::reversed(uhd::sorted(clock_rates))) {
const std::vector<double> clock_rates =
uhd::sorted(this->get_iface()->get_clock_rates(dboard_iface::UNIT_RX));
const double max_clock_rate = clock_rates.back();
for (auto ref_clock_it : uhd::reversed(clock_rates)) {
ref_clock = ref_clock_it;
// USRP1 feeds the DBSRX clock from a FPGA GPIO line.
// make sure that this clock does not exceed rate limit.