1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Fixed -Wunused-variable warnings

This commit is contained in:
f4exb 2020-11-14 18:45:05 +01:00
parent 55eb6cc951
commit 7a6636b63a
39 changed files with 7 additions and 85 deletions

View File

@ -849,7 +849,6 @@ void ADSBDemodGUI::handleADSB(
step = 5.0f;
adjust = 109;
}
float speed = base + (movement - adjust) * step;
aircraft->m_speedType = Aircraft::GS;
aircraft->m_speedValid = true;
aircraft->m_speedItem->setData(Qt::DisplayRole, m_settings.m_siUnits ? knotsToKPHInt(aircraft->m_speed) : (int)std::round(aircraft->m_speed));
@ -872,8 +871,6 @@ void ADSBDemodGUI::handleADSB(
else if (((tc >= 9) && (tc <= 18)) || ((tc >= 20) && (tc <= 22)))
{
// Airbourne position (9-18 baro, 20-22 GNSS)
int ss = (data[4] >> 1) & 0x3; // Surveillance status
int nicsb = data[4] & 1; // NIC supplement-B - Or single antenna flag
int alt = ((data[5] & 0xff) << 4) | ((data[6] >> 4) & 0xf); // Altitude
int n = ((alt >> 1) & 0x7f0) | (alt & 0xf);
int alt_ft = n * ((alt & 0x10) ? 25 : 100) - 1000;
@ -884,7 +881,6 @@ void ADSBDemodGUI::handleADSB(
aircraft->m_altitudeItem->setData(Qt::DisplayRole, m_settings.m_siUnits ? feetToMetresInt(aircraft->m_altitude) : aircraft->m_altitude);
}
int t = (data[6] >> 3) & 1; // Time synchronisation to UTC
int f = (data[6] >> 2) & 1; // CPR odd/even frame - should alternate every 0.2s
int lat_cpr = ((data[6] & 3) << 15) | ((data[7] & 0xff) << 7) | ((data[8] >> 1) & 0x7f);
int lon_cpr = ((data[8] & 1) << 16) | ((data[9] & 0xff) << 8) | (data[10] & 0xff);
@ -1013,8 +1009,6 @@ void ADSBDemodGUI::handleADSB(
{
// Airbourne velocity
int st = data[4] & 0x7; // Subtype
int ic = (data[5] >> 7) & 1; // Intent change flag
int nac = (data[5] >> 3) & 0x3; // Velocity uncertainty
if ((st == 1) || (st == 2))
{
// Ground speed
@ -1069,7 +1063,6 @@ void ADSBDemodGUI::handleADSB(
aircraft->m_speedValid = true;
aircraft->m_speedItem->setData(Qt::DisplayRole, m_settings.m_siUnits ? knotsToKPHInt(aircraft->m_speed) : aircraft->m_speed);
}
int vrsrc = (data[8] >> 4) & 1; // Vertical rate source
int s_vr = (data[8] >> 3) & 1; // Vertical rate sign
int vr = ((data[8] & 0x7) << 6) | ((data[9] >> 2) & 0x3f); // Vertical rate
aircraft->m_verticalRate = (vr-1)*64*(s_vr?-1:1);
@ -1078,8 +1071,6 @@ void ADSBDemodGUI::handleADSB(
aircraft->m_verticalRateItem->setData(Qt::DisplayRole, feetPerMinToMetresPerSecondInt(aircraft->m_verticalRate));
else
aircraft->m_verticalRateItem->setData(Qt::DisplayRole, aircraft->m_verticalRate);
int s_dif = (data[10] >> 7) & 1; // Diff from baro alt, sign
int dif = data[10] & 0x7f; // Diff from baro alt
}
else if (tc == 28)
{
@ -1587,8 +1578,6 @@ void ADSBDemodGUI::updateDeviceSetList()
for (; it != deviceUISets.end(); ++it, deviceIndex++)
{
DSPDeviceSourceEngine *deviceSourceEngine = (*it)->m_deviceSourceEngine;
DSPDeviceSinkEngine *deviceSinkEngine = (*it)->m_deviceSinkEngine;
DSPDeviceMIMOEngine *deviceMIMOEngine = (*it)->m_deviceMIMOEngine;
if (deviceSourceEngine) {
ui->device->addItem(QString("R%1").arg(deviceIndex), deviceIndex);

View File

@ -62,8 +62,6 @@ void ADSBDemodSinkWorker::run()
int readIdx = m_sink->m_samplesPerFrame - 1;
int cnt = 0;
while (true)
{
int startIdx = readIdx;

View File

@ -132,7 +132,6 @@ void ATVDemodSink::demod(Complex& c)
//********** demodulation **********
float fftScale = 1.0f;
const float& fltI = m_settings.m_fftFiltering ? m_DSBFilterBuffer[m_DSBFilterBufferIndex].real() : c.real();
const float& fltQ = m_settings.m_fftFiltering ? m_DSBFilterBuffer[m_DSBFilterBufferIndex].imag() : c.imag();
double magSq;

View File

@ -38,9 +38,6 @@ void ChirpChatDemodDecoderLoRa::decodeHeader(
// Actual header is always represented with 5 8-bit codewords : static headerCodewords = 5
// These 8-bit codewords are encoded with Hamming(4,8) FEC : static headerParityBits = 4
const unsigned int numSymbols = roundUp(inSymbols.size(), 4 + nbParityBits);
const unsigned int numCodewords = (numSymbols / (4 + nbParityBits))*nbSymbolBits;
std::vector<uint16_t> symbols(headerSymbols);
std::copy(inSymbols.begin(), inSymbols.begin() + headerSymbols, symbols.begin());
@ -364,4 +361,4 @@ void ChirpChatDemodDecoderLoRa::getCodingMetrics(
{
numCodewords = roundUp((packetLength + (hasCRC ? 2 : 0))*2 + (hasHeader ? headerCodewords : 0), nbSymbolBits); // uses payload + CRC for encoding size
numSymbols = headerSymbols + (numCodewords / nbSymbolBits - 1) * (4 + nbParityBits); // header is always coded with 8 bits and yields exactly 8 symbols (headerSymbols)
}
}

View File

@ -132,7 +132,6 @@ void ChirpChatDemodSink::initSF(unsigned int sf, unsigned int deBits, FFTWindow:
void ChirpChatDemodSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end)
{
int newangle;
Complex ci;
for (SampleVector::const_iterator it = begin; it < end; ++it)

View File

@ -969,8 +969,6 @@ void DATVDemodSink::InitDATVS2Framework()
**/
// FILTERING
int decim = 1;
//******** -> if ( m_objCfg.resample )

View File

@ -919,7 +919,6 @@ struct s2_frame_receiver : runnable
if (psymbols)
*psymbols++ = p * scale_symbols;
#endif
uint8_t symb = track_symbol(&ss, p, qpsk, 1);
if (psampled_pls)
*psampled_pls++ = p;
int bit = (p.im < 0); // suboptimal
@ -1173,7 +1172,6 @@ struct s2_frame_receiver : runnable
for (int i = c->nsymbols; i--;)
{
complex<int8_t> p = c->symbols[i];
float re = p.re * cosf(angle) - p.im * sinf(angle);
float im = p.re * sinf(angle) + p.im * cosf(angle);
int bit;
if (im > 1)
@ -1424,7 +1422,6 @@ struct s2_interleaver : runnable
// so we need tos split bytes at boundaries.
for (; nslots; nslots -= 4)
{
const hard_sb *pi;
hard_sb accs[BPS]; // One accumulator per column
hard_ss *ps;
// Slot 0 (mod 4): 88+2
@ -1506,8 +1503,6 @@ struct s2_interleaver : runnable
static void interleave4050(const hard_sb *pin, int nslots,
plslot<hard_ss> *pout)
{
const hard_sb *pin0 = pin;
int rows = 4050;
hard_sb accs[4]; // One accumulator per column
int nacc = 0; // Bits in each column accumulator
for (; nslots; --nslots, ++pout)
@ -2048,8 +2043,6 @@ struct s2_fecenc : runnable
{
while (in.readable() >= 1 && out.writable() >= 1)
{
bbframe *pin = in.rd();
fecframe<hard_sb> *pout = out.wr();
run_frame(in.rd(), out.wr());
in.read(1);
out.written(1);
@ -2066,7 +2059,6 @@ struct s2_fecenc : runnable
bbscrambling.transform(pin->bytes, fi->Kbch / 8, pbytes);
{ // BCH
size_t msgbytes = fi->Kbch / 8;
size_t cwbytes = fi->kldpc / 8;
bch_interface *bch = s2bch.bchs[pin->pls.sf][mcinfo->rate];
bch->encode(pbytes, msgbytes, pbytes + msgbytes);
}
@ -2120,7 +2112,6 @@ struct s2_fecdec : runnable
// LDPC decode
size_t cwbits = pin->pls.framebits();
size_t msgbits = fi->kldpc;
size_t chkbits = cwbits - msgbits;
s2_ldpc_engine *ldpc = s2ldpc.ldpcs[pin->pls.sf][mcinfo->rate];
int ncorr = ldpc->decode_bitflip(fi->ldpc, pin->bytes, msgbits, cwbits, bitflips);
if (sch->debug2)
@ -2131,8 +2122,6 @@ struct s2_fecdec : runnable
{
// BCH decode
size_t cwbytes = fi->kldpc / 8;
size_t msgbytes = fi->Kbch / 8;
size_t chkbytes = cwbytes - msgbytes;
// Decode with suitable BCH decoder for this MODCOD
bch_interface *bch = s2bch.bchs[pin->pls.sf][mcinfo->rate];
int ncorr = bch->decode(hardbytes, cwbytes);

View File

@ -185,11 +185,6 @@ void FreeDVDemodSink::feed(const SampleVector::const_iterator& begin, const Samp
}
Complex ci;
fftfilt::cmplx *sideband;
int n_out;
int decim = 1<<(m_spanLog2 - 1);
unsigned char decim_mask = decim - 1; // counter LSB bit mask for decimation by 2^(m_scaleLog2 - 1)
for(SampleVector::const_iterator it = begin; it < end; ++it)
{

View File

@ -191,8 +191,6 @@ void FreqTracker::applySettings(const FreqTrackerSettings& settings, bool force)
}
QList<QString> reverseAPIKeys;
bool updateChannelizer = false;
bool updateInterpolator = false;
if ((m_settings.m_inputFrequencyOffset != settings.m_inputFrequencyOffset) || force) {
reverseAPIKeys.append("inputFrequencyOffset");

View File

@ -561,7 +561,6 @@ void IEEE_802_15_4_ModSource::addTXFrame(QString data)
uint8_t *pLength;
crc16itut crc;
uint16_t crcValue;
int len;
// Create PHY frame
p = m_bits;

View File

@ -200,6 +200,7 @@ bool ATVMod::handleMessage(const Message& cmd)
ATVModBaseband::MsgConfigureCameraData *rep = ATVModBaseband::MsgConfigureCameraData::create(
cfg.getIndex(), cfg.getManualFPS(), cfg.getManualFPSEnable()
);
m_basebandSource->getInputMessageQueue()->push(rep);
return true;
}

View File

@ -54,7 +54,6 @@ void ChirpChatModSource::initSF(unsigned int sf)
float halfAngle = M_PI/ChirpChatModSettings::oversampling;
float phase = -halfAngle;
double accumulator = 0;
if (m_phaseIncrements) {
delete[] m_phaseIncrements;

View File

@ -114,7 +114,6 @@ void PacketModSource::modulateSample()
{
Real audioMod;
Real linearRampGain;
Real emphasis;
if ((m_state == idle) || (m_state == wait))
{

View File

@ -168,7 +168,6 @@ void RemoteSource::applySettings(const RemoteSourceSettings& settings, bool forc
<< " m_reverseAPIPort: " << settings.m_reverseAPIPort
<< " force: " << force;
bool change = false;
QList<QString> reverseAPIKeys;
if ((m_settings.m_dataAddress != settings.m_dataAddress) || force) {

View File

@ -82,7 +82,6 @@ bool AFCGUI::handleMessage(const Message& message)
else if (AFCReport::MsgUpdateTarget::match(message))
{
const AFCReport::MsgUpdateTarget& cfg = (AFCReport::MsgUpdateTarget&) message;
bool frequencyChanged = cfg.getFrequencyChanged();
if (cfg.getFrequencyChanged()) {
ui->statusIndicator->setStyleSheet("QLabel { background-color: rgb(232, 85, 85); border-radius: 8px; }"); // red

View File

@ -80,7 +80,6 @@ bool AFCSettings::deserialize(const QByteArray& data)
if(d.getVersion() == 1)
{
QByteArray bytetmp;
qint32 tmp;
uint32_t utmp;
QString strtmp;

View File

@ -212,8 +212,6 @@ void GS232ControllerGUI::updateDeviceSetList()
for (; it != deviceUISets.end(); ++it, deviceIndex++)
{
DSPDeviceSourceEngine *deviceSourceEngine = (*it)->m_deviceSourceEngine;
DSPDeviceSinkEngine *deviceSinkEngine = (*it)->m_deviceSinkEngine;
DSPDeviceMIMOEngine *deviceMIMOEngine = (*it)->m_deviceMIMOEngine;
if (deviceSourceEngine) {
ui->device->addItem(QString("R%1").arg(deviceIndex), deviceIndex);

View File

@ -83,7 +83,6 @@ bool GS232ControllerSettings::deserialize(const QByteArray& data)
if (d.getVersion() == 1)
{
QByteArray bytetmp;
qint32 tmp;
uint32_t utmp;
QString strtmp;

View File

@ -177,8 +177,6 @@ void RigCtlServerGUI::updateDeviceSetList()
for (; it != deviceSets.end(); ++it, deviceIndex++)
{
DSPDeviceSourceEngine *deviceSourceEngine = (*it)->m_deviceSourceEngine;
DSPDeviceSinkEngine *deviceSinkEngine = (*it)->m_deviceSinkEngine;
DSPDeviceMIMOEngine *deviceMIMOEngine = (*it)->m_deviceMIMOEngine;
if (deviceSourceEngine) {
ui->device->addItem(QString("R%1").arg(deviceIndex), deviceIndex);

View File

@ -77,7 +77,6 @@ bool RigCtlServerSettings::deserialize(const QByteArray& data)
if (d.getVersion() == 1)
{
QByteArray bytetmp;
qint32 tmp;
uint32_t utmp;
QString strtmp;

View File

@ -647,11 +647,6 @@ bool RigCtlServerWorker::changeModem(const char *newMode, const char *newModemId
channelSettingsKeys.append("inputFrequencyOffset");
QString jsonSettingsStr = tr("\"inputFrequencyOffset\":%1").arg(currentOffset);
if (!strncmp(newMode, "LSB", 3))
{
int bw = newModemBw < 0 ? -3000 : -newModemBw;
}
if (lsb || (newModemBw >= 0))
{
int bw = lsb ? (newModemBw < 0 ? -3000 : -newModemBw) : newModemBw;

View File

@ -74,7 +74,6 @@ bool SimplePTTSettings::deserialize(const QByteArray& data)
if(d.getVersion() == 1)
{
QByteArray bytetmp;
qint32 tmp;
uint32_t utmp;
QString strtmp;

View File

@ -128,7 +128,6 @@ bool MetisMISOSettings::deserialize(const QByteArray& data)
if (d.getVersion() == 1)
{
int intval;
uint32_t utmp;
d.readU32(1, &m_nbReceivers, 1);
@ -184,4 +183,4 @@ int MetisMISOSettings::getSampleRateFromIndex(unsigned int index)
} else {
return 48000;
}
}
}

View File

@ -388,7 +388,7 @@ void MetisMISOUDPHandler::fillBuffer(unsigned char *buffer, int& bufferIndex, in
int MetisMISOUDPHandler::getCommandValue(int commandIndex)
{
int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
int c1 = 0, c3 = 0, c4 = 0;
if (commandIndex == 0)
{
@ -483,7 +483,6 @@ bool MetisMISOUDPHandler::getRxIQInversion(int index)
void MetisMISOUDPHandler::processIQBuffer(unsigned char* buffer)
{
int b = 0;
int b_max;
int r;
int sampleI, sampleQ, sampleMic;
@ -656,4 +655,4 @@ void MetisMISOUDPHandler::processIQBuffer(unsigned char* buffer)
}
m_rxFrame++;
}
}

View File

@ -433,8 +433,6 @@ bool XTRXMIMO::handleMessage(const Message& message)
bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
{
QList<QString> reverseAPIKeys;
bool rxThreadWasRunning = false;
bool txThreadWasRunning = false;
bool doRxLPCalibration = false;
bool doRxChangeSampleRate = false;
bool doRxChangeFreq = false;
@ -1077,7 +1075,7 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
if (m_deviceShared.m_dev->getDevice())
{
qint64 deviceCenterFrequency = DeviceSampleSink::calculateDeviceCenterFrequency(
settings.m_txCenterFrequency,
txXlatedDeviceCenterFrequency,
0,
settings.m_log2SoftInterp,
DeviceSampleSink::FC_POS_CENTER,

View File

@ -616,7 +616,6 @@ bool USRPOutput::applySettings(const USRPOutputSettings& settings, bool preGetSt
bool forwardChangeTxDSP = false;
bool forwardChangeAllDSP = false;
bool forwardClockSource = false;
bool ownThreadWasRunning = false;
bool checkRates = false;
QList<QString> reverseAPIKeys;

View File

@ -77,7 +77,6 @@ bool USRPOutputSettings::deserialize(const QByteArray& data)
if (d.getVersion() == 1)
{
int intval;
uint32_t uintval;
d.readS32(1, &m_devSampleRate, 5000000);

View File

@ -747,7 +747,6 @@ bool XTRXOutput::applySettings(const XTRXOutputSettings& settings, bool force, b
bool forwardChangeTxDSP = false;
bool forwardChangeAllDSP = false;
bool forwardClockSource = false;
bool txThreadWasRunning = false;
bool doLPCalibration = false;
bool doChangeSampleRate = false;
bool doChangeFreq = false;

View File

@ -651,7 +651,6 @@ bool USRPInput::applySettings(const USRPInputSettings& settings, bool preGetStre
bool forwardChangeRxDSP = false;
bool forwardChangeAllDSP = false;
bool forwardClockSource = false;
bool ownThreadWasRunning = false;
bool reapplySomeSettings = false;
bool checkRates = false;
QList<QString> reverseAPIKeys;
@ -1156,7 +1155,6 @@ int USRPInput::webapiRun(
void USRPInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)
{
bool success = false;
double temp = 0.0;
bool active = false;
quint32 overflows = 0;
quint32 timeouts = 0;

View File

@ -819,7 +819,6 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
bool forwardChangeRxDSP = false;
bool forwardChangeAllDSP = false;
bool forwardClockSource = false;
bool rxThreadWasRunning = false;
bool doLPCalibration = false;
bool doChangeSampleRate = false;
bool doChangeFreq = false;

View File

@ -110,7 +110,6 @@ void AudioCompressorSnd::CompressorState::sf_advancecomp(
float dry = 1.0f - wet;
// metering values (not used in core algorithm, but used to output a meter if desired)
float metergain = 1.0f; // gets overwritten immediately because gain will always be negative
float meterfalloff = 0.325f; // seconds
float meterrelease = 1.0f - expf(-1.0f / ((float)rate * meterfalloff));

View File

@ -43,7 +43,6 @@ AudioOpus::~AudioOpus()
void AudioOpus::setEncoder(int32_t fs, int nChannels)
{
int error;
bool newInstance = true;
QMutexLocker mutexLocker(&m_mutex);
if (m_encoderState) {

View File

@ -40,7 +40,6 @@ void DeviceEnumerator::addNonDiscoverableDevices(PluginManager *pluginManager, c
QList<DeviceUserArgs::Args>::const_iterator argsIt = args.begin();
unsigned int rxIndex = m_rxEnumeration.size();
unsigned int txIndex = m_txEnumeration.size();
unsigned int mimoIndex = m_mimoEnumeration.size();
for (; argsIt != args.end(); ++argsIt)
{

View File

@ -66,9 +66,6 @@ bool FeatureSetPreset::deserialize(const QByteArray& data)
if (d.getVersion() == 1)
{
bool tmpBool;
int tmp;
d.readString(1, &m_group, "default");
d.readString(2, &m_description, "no name");

View File

@ -118,7 +118,7 @@ void AzEl::calcAzimuth()
double aCos = std::cos(aLat);
double aSin = std::sin(aLat);
double bx = (bRot.m_cart.m_x * aCos) - (bRot.m_cart.m_z * aSin);
//double bx = (bRot.m_cart.m_x * aCos) - (bRot.m_cart.m_z * aSin);
double by = bRot.m_cart.m_y;
double bz = (bRot.m_cart.m_x * aSin) + (bRot.m_cart.m_z * aCos);

View File

@ -2844,8 +2844,6 @@ int WebAPIAdapter::featuresetFeaturePost(
{
if ((featureSetIndex >= 0) && (featureSetIndex < (int) m_mainCore->m_featureSets.size()))
{
FeatureSet *featureSet = m_mainCore->m_featureSets[featureSetIndex];
PluginAPI::FeatureRegistrations *featureRegistrations = m_mainCore->m_pluginManager->getFeatureRegistrations();
int nbRegistrations = featureRegistrations->size();
int index = 0;

View File

@ -169,7 +169,6 @@ void WSSpectrum::newSpectrum(
qint64 elapsed = m_timer.restart();
uint64_t nowMs = TimeUtil::nowms();
QWebSocket *pSender = qobject_cast<QWebSocket *>(sender());
QByteArray payload;
buildPayload(

View File

@ -1978,8 +1978,6 @@ void GLSpectrum::mouseMoveEvent(QMouseEvent* event)
void GLSpectrum::mousePressEvent(QMouseEvent* event)
{
const QPointF& ep = event->localPos();
float waterfallShiftY = m_topMargin + m_frequencyScaleHeight + (m_waterfallHeight == 0 ? 0 : m_waterfallHeight + m_bottomMargin);
float histogramShiftY = m_topMargin + m_frequencyScaleHeight + (m_histogramHeight == 0 ? 0 : m_histogramHeight + m_bottomMargin);
if (event->button() == Qt::RightButton)
{

View File

@ -1066,7 +1066,6 @@ bool MainWindow::handleMessage(const Message& cmd)
{
MainCore::MsgSetDevice& notif = (MainCore::MsgSetDevice&) cmd;
ui->tabInputsView->setCurrentIndex(notif.getDeviceSetIndex());
DeviceUISet *deviceUI = m_deviceUIs[notif.getDeviceSetIndex()];
ui->inputViewDock->setSelectedDeviceIndex(notif.getDeviceSetIndex(), notif.getDeviceIndex());
samplingDeviceChanged(notif.getDeviceType(), notif.getDeviceSetIndex(), notif.getDeviceIndex());
@ -1752,7 +1751,6 @@ void MainWindow::samplingDeviceChanged(int deviceType, int tabIndex, int newDevi
{
qDebug("MainWindow::samplingDeviceChanged: deviceType: %d tabIndex: %d newDeviceIndex: %d",
deviceType, tabIndex, newDeviceIndex);
const PluginInterface::SamplingDevice *samplingDevice;
if (deviceType == 0) {
sampleSourceChanged(tabIndex, newDeviceIndex);