1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-22 17:45:48 -05:00

Fixed -Wsign-compare warnings

This commit is contained in:
f4exb 2020-11-14 22:08:06 +01:00
parent 6285235257
commit 9bd8e9c34e
46 changed files with 137 additions and 138 deletions

View File

@ -24,11 +24,11 @@ void DeviceMetisScan::scan()
{
m_scans.clear();
if (m_udpSocket.bind(QHostAddress::AnyIPv4, 10001, QUdpSocket::ShareAddress))
if (m_udpSocket.bind(QHostAddress::AnyIPv4, 10001, QUdpSocket::ShareAddress))
{
connect(&m_udpSocket, SIGNAL(readyRead()), this, SLOT(readyRead()));
}
else
}
else
{
qDebug() << "DeviceMetisScan::scan: cannot bind socket";
return;
@ -40,7 +40,7 @@ void DeviceMetisScan::scan()
buffer[2] = (unsigned char) 0x02;
std::fill(&buffer[3], &buffer[63], 0);
if (m_udpSocket.writeDatagram((const char*) buffer, sizeof(buffer), QHostAddress::Broadcast, 1024) < 0)
if (m_udpSocket.writeDatagram((const char*) buffer, sizeof(buffer), QHostAddress::Broadcast, 1024) < 0)
{
qDebug() << "DeviceMetisScan::scan: discovery writeDatagram failed " << m_udpSocket.errorString();
return;
@ -59,7 +59,7 @@ void DeviceMetisScan::scan()
qDebug() << "DeviceMetisScan::scan: start 0.5 second timeout loop";
// Execute the event loop here and wait for the timeout to trigger
// which in turn will trigger event loop quit.
loop.exec();
loop.exec();
disconnect(&m_udpSocket, SIGNAL(readyRead()), this, SLOT(readyRead()));
m_udpSocket.close();
@ -81,11 +81,11 @@ void DeviceMetisScan::enumOriginDevices(const QString& hardwareId, PluginInterfa
i, // sequence
8, // Nb Rx
1 // Nb Tx
));
));
}
}
const DeviceMetisScan::DeviceScan* DeviceMetisScan::getDeviceAt(unsigned int index) const
const DeviceMetisScan::DeviceScan* DeviceMetisScan::getDeviceAt(int index) const
{
if (index < m_scans.size()) {
return &m_scans.at(index);
@ -97,7 +97,7 @@ const DeviceMetisScan::DeviceScan* DeviceMetisScan::getDeviceAt(unsigned int ind
void DeviceMetisScan::getSerials(QList<QString>& serials) const
{
for (int i = 0; i < m_scans.size(); i++) {
serials.append(m_scans.at(i).m_serial);
serials.append(m_scans.at(i).m_serial);
}
}
@ -107,17 +107,17 @@ void DeviceMetisScan::readyRead()
quint16 metisPort;
unsigned char buffer[1024];
if (m_udpSocket.readDatagram((char*) &buffer, (qint64) sizeof(buffer), &metisAddress, &metisPort) < 0)
if (m_udpSocket.readDatagram((char*) &buffer, (qint64) sizeof(buffer), &metisAddress, &metisPort) < 0)
{
qDebug() << "DeviceMetisScan::readyRead: readDatagram failed " << m_udpSocket.errorString();
return;
}
QString metisIP = QString("%1:%2").arg(metisAddress.toString()).arg(metisPort);
QString metisIP = QString("%1:%2").arg(metisAddress.toString()).arg(metisPort);
if (buffer[0] == 0xEF && buffer[1] == 0xFE)
if (buffer[0] == 0xEF && buffer[1] == 0xFE)
{
switch(buffer[2])
switch(buffer[2])
{
case 3: // reply
// should not happen on this port
@ -138,9 +138,9 @@ void DeviceMetisScan::readyRead()
case 1: // a data packet
break;
}
}
else
}
else
{
qDebug() << "DeviceMetisScan::readyRead: received invalid response to discovery";
}
}
}

View File

@ -54,7 +54,7 @@ public:
void scan();
int getNbDevices() const { return m_scans.size(); }
const DeviceScan* getDeviceAt(unsigned int index) const;
const DeviceScan* getDeviceAt(int index) const;
void getSerials(QList<QString>& serials) const;
void enumOriginDevices(const QString& hardwareId, PluginInterface::OriginDevices& originDevices);

View File

@ -160,9 +160,9 @@ InterferometerCorrelator::~InterferometerCorrelator()
bool InterferometerCorrelator::performCorr(
const SampleVector& data0,
int size0,
unsigned int size0,
const SampleVector& data1,
int size1
unsigned int size1
)
{
bool results = false;
@ -308,9 +308,9 @@ bool InterferometerCorrelator::performCorr(
bool InterferometerCorrelator::performOpCorr(
const SampleVector& data0,
int size0,
unsigned int size0,
const SampleVector& data1,
int size1,
unsigned int size1,
Sample sampleOp(const Sample& a, const Sample& b)
)
{
@ -333,9 +333,9 @@ bool InterferometerCorrelator::performOpCorr(
bool InterferometerCorrelator::performIFFTCorr(
const SampleVector& data0,
int size0,
unsigned int size0,
const SampleVector& data1,
int size1,
unsigned int size1,
bool star
)
{
@ -457,9 +457,9 @@ bool InterferometerCorrelator::performIFFTCorr(
bool InterferometerCorrelator::performIFFT2Corr(
const SampleVector& data0,
int size0,
unsigned int size0,
const SampleVector& data1,
int size1
unsigned int size1
)
{
unsigned int size = std::min(size0, size1);
@ -566,9 +566,9 @@ bool InterferometerCorrelator::performIFFT2Corr(
bool InterferometerCorrelator::performFFTProd(
const SampleVector& data0,
int size0,
unsigned int size0,
const SampleVector& data1,
int size1
unsigned int size1
)
{
unsigned int size = std::min(size0, size1);

View File

@ -39,9 +39,9 @@ public:
InterferometerSettings::CorrelationType getCorrType() const { return m_corrType; }
bool performCorr( //!< Returns true if results were produced
const SampleVector& data0,
int size0,
unsigned int size0,
const SampleVector& data1,
int size1
unsigned int size1
);
int getFullFFTSize() const { return 2*m_fftSize; }
void setPhase(int phase);
@ -57,35 +57,35 @@ signals:
private:
bool performOpCorr( //!< Returns true if results were produced
const SampleVector& data0,
int size0,
unsigned int size0,
const SampleVector& data1,
int size1,
unsigned int size1,
Sample sampleOp(const Sample& a, const Sample& b)
);
bool performIFFTCorr( //!< Returns true if results were produced
const SampleVector& data0,
int size0,
unsigned int size0,
const SampleVector& data1,
int size1,
unsigned int size1,
bool star = false
);
bool performIFFT2Corr( //!< Returns true if results were produced
const SampleVector& data0,
int size0,
unsigned int size0,
const SampleVector& data1,
int size1
unsigned int size1
);
bool performFFTProd( //!< Returns true if results were produced
const SampleVector& data0,
int size0,
unsigned int size0,
const SampleVector& data1,
int size1
unsigned int size1
);
void adjustSCorrSize(int size);
void adjustTCorrSize(int size);
InterferometerSettings::CorrelationType m_corrType;
int m_fftSize; //!< FFT length
unsigned int m_fftSize; //!< FFT length
FFTEngine *m_fft[2]; //!< FFT engines (double FFT)
FFTEngine *m_invFFT; //!< Inverse FFT engine (double FFT)
FFTEngine *m_fft2[2]; //!< FFT engines

View File

@ -186,7 +186,7 @@ void ADSBDemodSinkWorker::run()
if ((df == 17) || (df == 18))
{
m_crc.init();
int parity = (data[11] << 16) | (data[12] << 8) | data[13]; // Parity / CRC
unsigned int parity = (data[11] << 16) | (data[12] << 8) | data[13]; // Parity / CRC
m_crc.calculate(data, ADS_B_ES_BYTES-3);
if (parity == m_crc.get())

View File

@ -95,7 +95,7 @@ private:
Real m_interpolatorDistanceRemain;
Real m_squelchLevel;
uint32_t m_squelchCount;
int m_squelchCount;
bool m_squelchOpen;
DoubleBufferFIFO<Real> m_squelchDelayLine;
double m_magsq;
@ -123,4 +123,4 @@ private:
void processOneSample(Complex &ci);
};
#endif // INCLUDE_AMDEMODSINK_H
#endif // INCLUDE_AMDEMODSINK_H

View File

@ -111,12 +111,12 @@ QByteArray ChirpChatDemodSettings::serialize() const
s.writeS32(8, m_codingScheme);
s.writeBool(9, m_decodeActive);
s.writeS32(10, m_eomSquelchTenths);
s.writeS32(11, m_nbSymbolsMax);
s.writeU32(11, m_nbSymbolsMax);
s.writeS32(12, m_packetLength);
s.writeS32(13, m_nbParityBits);
s.writeBool(14, m_hasCRC);
s.writeBool(15, m_hasHeader);
s.writeS32(17, m_preambleChirps);
s.writeU32(17, m_preambleChirps);
s.writeS32(18, (int) m_fftWindow);
s.writeBool(20, m_useReverseAPI);
s.writeString(21, m_reverseAPIAddress);
@ -167,12 +167,12 @@ bool ChirpChatDemodSettings::deserialize(const QByteArray& data)
m_codingScheme = (CodingScheme) tmp;
d.readBool(9, &m_decodeActive, true);
d.readS32(10, &m_eomSquelchTenths, 60);
d.readS32(11, &m_nbSymbolsMax, 255);
d.readU32(11, &m_nbSymbolsMax, 255);
d.readS32(12, &m_packetLength, 32);
d.readS32(13, &m_nbParityBits, 1);
d.readBool(14, &m_hasCRC, true);
d.readBool(15, &m_hasHeader, true);
d.readS32(17, &m_preambleChirps, 8);
d.readU32(17, &m_preambleChirps, 8);
d.readS32(18, &tmp, (int) FFTWindow::Rectangle);
m_fftWindow = (FFTWindow::Function) tmp;
d.readBool(20, &m_useReverseAPI, false);
@ -223,4 +223,4 @@ unsigned int ChirpChatDemodSettings::getNbSFDFourths() const
bool ChirpChatDemodSettings::hasSyncWord() const
{
return m_codingScheme == CodingLoRa;
}
}

View File

@ -44,17 +44,17 @@ struct ChirpChatDemodSettings
FFTWindow::Function m_fftWindow;
CodingScheme m_codingScheme;
bool m_decodeActive;
int m_eomSquelchTenths; //!< Squelch factor to trigger end of message (/10)
int m_nbSymbolsMax; //!< Maximum number of symbols in a payload
bool m_autoNbSymbolsMax; //!< Set maximum number of symbols in a payload automatically using last messag value
int m_preambleChirps; //!< Number of expected preamble chirps
int m_nbParityBits; //!< Hamming parity bits (LoRa)
int m_packetLength; //!< Payload packet length in bytes or characters (LoRa)
bool m_hasCRC; //!< Payload has CRC (LoRa)
bool m_hasHeader; //!< Header present before actual payload (LoRa)
bool m_sendViaUDP; //!< Send decoded message via UDP
QString m_udpAddress; //!< UDP address where to send message
uint16_t m_udpPort; //!< UDP port where to send message
int m_eomSquelchTenths; //!< Squelch factor to trigger end of message (/10)
unsigned int m_nbSymbolsMax; //!< Maximum number of symbols in a payload
bool m_autoNbSymbolsMax; //!< Set maximum number of symbols in a payload automatically using last messag value
unsigned int m_preambleChirps; //!< Number of expected preamble chirps
int m_nbParityBits; //!< Hamming parity bits (LoRa)
int m_packetLength; //!< Payload packet length in bytes or characters (LoRa)
bool m_hasCRC; //!< Payload has CRC (LoRa)
bool m_hasHeader; //!< Header present before actual payload (LoRa)
bool m_sendViaUDP; //!< Send decoded message via UDP
QString m_udpAddress; //!< UDP address where to send message
uint16_t m_udpPort; //!< UDP port where to send message
uint32_t m_rgbColor;
QString m_title;
int m_streamIndex;

View File

@ -117,7 +117,7 @@ void ChirpChatDemodSink::initSF(unsigned int sf, unsigned int deBits, FFTWindow:
float phase = -halfAngle;
double accumulator = 0;
for (int i = 0; i < m_fftLength; i++)
for (unsigned int i = 0; i < m_fftLength; i++)
{
accumulator = fmod(accumulator + phase, 2*M_PI);
m_downChirps[i] = Complex(std::conj(std::polar(1.0, accumulator)));
@ -191,7 +191,7 @@ void ChirpChatDemodSink::processSample(const Complex& ci)
m_argMaxHistoryCounter = 0;
bool preambleFound = true;
for (int i = 1; i < m_requiredPreambleChirps; i++)
for (unsigned int i = 1; i < m_requiredPreambleChirps; i++)
{
int delta = m_argMaxHistory[i] - m_argMaxHistory[i-1];
// qDebug("ChirpChatDemodSink::processSample: search: delta: %d / %d", delta, m_deLength);
@ -314,7 +314,7 @@ void ChirpChatDemodSink::processSample(const Complex& ci)
int zadj;
int sfdSkip = m_sfdSkip;
for (int i = 0; i < m_chirpCount - 1 - (m_settings.hasSyncWord() ? 2 : 0); i++)
for (unsigned int i = 0; i < m_chirpCount - 1 - (m_settings.hasSyncWord() ? 2 : 0); i++)
{
sadj += m_preambleHistory[i] > m_nbSymbols/2 ? m_preambleHistory[i] - m_nbSymbols : m_preambleHistory[i];
nadj++;

View File

@ -72,8 +72,8 @@ private:
int m_bandwidth;
int m_channelSampleRate;
int m_channelFrequencyOffset;
int m_chirp;
int m_chirp0;
unsigned int m_chirp;
unsigned int m_chirp0;
static const unsigned int m_requiredPreambleChirps = 4; //!< Number of chirps required to estimate preamble
static const unsigned int m_maxSFDSearchChirps = 8; //!< Maximum number of chirps when looking for SFD after preamble detection
@ -143,4 +143,4 @@ private:
unsigned int evalSymbol(unsigned int rawSymbol);
};
#endif // INCLUDE_CHIRPCHATDEMODSINK_H
#endif // INCLUDE_CHIRPCHATDEMODSINK_H

View File

@ -40,7 +40,7 @@ struct bitvect
bitvect(T val)
{
v[0] = val;
for (int i = 1; i < NW; ++i)
for (unsigned int i = 1; i < NW; ++i)
v[i] = 0;
}
@ -139,7 +139,7 @@ bitvect<T, N> shiftdivmod(const Tm *m, size_t nm, const bitvect<T, N> &p,
T init = 0)
{
bitvect<T, N> res;
for (int i = 0; i < res.NW; ++i)
for (unsigned int i = 0; i < res.NW; ++i)
res.v[i] = init;
const Tm bitmask = (Tm)1 << (sizeof(Tm) * 8 - 1);
for (; nm--; ++m)

View File

@ -171,7 +171,7 @@ struct s2_bbscrambling
s2_bbscrambling()
{
uint16_t st = 0x00a9; // 000 0000 1010 1001 (Fig 5 reversed)
for (int i = 0; i < sizeof(pattern); ++i)
for (unsigned int i = 0; i < sizeof(pattern); ++i)
{
uint8_t out = 0;
for (int n = 8; n--;)

View File

@ -197,7 +197,7 @@ void SSBDemodGUI::on_audioMute_toggled(bool checked)
void SSBDemodGUI::on_spanLog2_valueChanged(int value)
{
unsigned int s2max = spanLog2Max();
int s2max = spanLog2Max();
if ((value < 0) || (value > s2max-1)) {
return;

View File

@ -385,7 +385,7 @@ void FreqTrackerSink::tick()
{
if ((m_settings.m_tracking) && getSquelchOpen())
{
uint32_t decayDivider = 200.0 * m_settings.m_alphaEMA;
int decayDivider = 200.0 * m_settings.m_alphaEMA;
int decayAmount = m_sinkSampleRate < decayDivider ? 1 : m_sinkSampleRate / decayDivider;
int trim = m_sinkSampleRate / 1000;

View File

@ -98,7 +98,7 @@ private:
int m_channelSampleRate;
int m_inputFrequencyOffset;
uint32_t m_sinkSampleRate;
int m_sinkSampleRate;
SpectrumVis* m_spectrumSink;
SampleVector m_sampleBuffer;

View File

@ -44,12 +44,12 @@ signals:
private:
std::vector<RemoteDataBlock> m_data;
int m_size;
unsigned int m_readHead; //!< index of last data block processed
unsigned int m_servedHead; //!< index of last data block served
unsigned int m_writeHead; //!< index of next data block to serve
int m_readHead; //!< index of last data block processed
int m_servedHead; //!< index of last data block served
int m_writeHead; //!< index of next data block to serve
QMutex m_mutex;
unsigned int calculateRemainder();
};
#endif // REMOTESINK_REMOTESINKFIFO_H_
#endif // REMOTESINK_REMOTESINKFIFO_H_

View File

@ -1088,7 +1088,7 @@ void ATVModSource::reportVideoFileSourceStreamTiming()
}
}
void ATVModSource::configureCameraIndex(int index)
void ATVModSource::configureCameraIndex(unsigned int index)
{
if (index < m_cameras.size())
{

View File

@ -68,7 +68,7 @@ public:
void openVideo(const QString& fileName);
void seekVideoFileStream(int seekPercentage);
void reportVideoFileSourceStreamTiming();
void configureCameraIndex(int index);
void configureCameraIndex(unsigned int index);
void configureCameraData(uint32_t index, float mnaualFPS, bool manualFPSEnable);
static void getBaseValues(int outputSampleRate, int linesPerSecond, int& sampleRateUnits, uint32_t& nbPointsPerRateUnit);
@ -164,7 +164,7 @@ private:
int m_nbLines2; //!< same number as above (non interlaced) or Euclidean half the number above (interlaced)
int m_nbLinesField1; //!< In interlaced mode: number of lines in field1 transition included
uint32_t m_nbImageLines2; //!< half the number of effective image lines
uint32_t m_nbImageLines; //!< number of effective image lines
int m_nbImageLines; //!< number of effective image lines
uint32_t m_imageLineStart1; //!< start index of line for field 1
uint32_t m_imageLineStart2; //!< start index of line for field 2
int m_nbHorizPoints; //!< number of line points per horizontal line

View File

@ -157,7 +157,7 @@ QByteArray ChirpChatModSettings::serialize() const
s.writeS32(7, m_deBits);
s.writeBool(8, m_channelMute);
s.writeU32(9, m_syncWord);
s.writeS32(10, m_preambleChirps);
s.writeU32(10, m_preambleChirps);
s.writeS32(11, m_quietMillis);
s.writeBool(12, m_useReverseAPI);
s.writeString(13, m_reverseAPIAddress);
@ -226,7 +226,7 @@ bool ChirpChatModSettings::deserialize(const QByteArray& data)
d.readBool(8, &m_channelMute, false);
d.readU32(9, &utmp, 0x34);
m_syncWord = utmp > 255 ? 0 : utmp;
d.readS32(10, &m_preambleChirps, 8);
d.readU32(10, &m_preambleChirps, 8);
d.readS32(11, &m_quietMillis, 1000);
d.readBool(11, &m_useReverseAPI, false);
d.readString(12, &m_reverseAPIAddress, "127.0.0.1");

View File

@ -52,12 +52,12 @@ struct ChirpChatModSettings
int m_inputFrequencyOffset;
int m_bandwidthIndex;
int m_spreadFactor;
int m_deBits; //!< Low data rate optmize (DE) bits
int m_preambleChirps; //!< Number of preamble chirps
int m_quietMillis; //!< Number of milliseconds to pause between transmissions
int m_nbParityBits; //!< Hamming parity bits (LoRa)
bool m_hasCRC; //!< Payload has CRC (LoRa)
bool m_hasHeader; //!< Header present before actual payload (LoRa)
int m_deBits; //!< Low data rate optmize (DE) bits
unsigned int m_preambleChirps; //!< Number of preamble chirps
int m_quietMillis; //!< Number of milliseconds to pause between transmissions
int m_nbParityBits; //!< Hamming parity bits (LoRa)
bool m_hasCRC; //!< Payload has CRC (LoRa)
bool m_hasHeader; //!< Header present before actual payload (LoRa)
unsigned char m_syncWord;
bool m_channelMute;
CodingScheme m_codingScheme;

View File

@ -62,7 +62,7 @@ void ChirpChatModSource::initSF(unsigned int sf)
m_phaseIncrements = new double[2*m_fftLength*ChirpChatModSettings::oversampling];
phase = -halfAngle;
for (int i = 0; i < m_fftLength*ChirpChatModSettings::oversampling; i++)
for (unsigned int i = 0; i < m_fftLength*ChirpChatModSettings::oversampling; i++)
{
m_phaseIncrements[i] = phase;
phase += (2*halfAngle) / (m_fftLength*ChirpChatModSettings::oversampling);

View File

@ -78,7 +78,7 @@ bool RemoteSourceGUI::handleMessage(const Message& message)
{
const RemoteSource::MsgReportStreamData& report = (RemoteSource::MsgReportStreamData&) message;
uint32_t remoteSampleRate = report.get_sampleRate();
int remoteSampleRate = report.get_sampleRate();
if (remoteSampleRate != m_remoteSampleRate)
{

View File

@ -263,8 +263,7 @@ void MetisMISOUDPHandler::dataReadyRead()
quint16 metisPort;
unsigned char receiveBuffer[1032];
qint64 length;
long sequence;
unsigned long sequence;
if ((length = m_socket.readDatagram((char*) &receiveBuffer, (qint64) sizeof(receiveBuffer), &metisAddress, &metisPort)) != 1032)
{
@ -483,7 +482,7 @@ bool MetisMISOUDPHandler::getRxIQInversion(int index)
void MetisMISOUDPHandler::processIQBuffer(unsigned char* buffer)
{
int b = 0;
int r;
unsigned int r;
int sampleI, sampleQ, sampleMic;

View File

@ -78,7 +78,7 @@ PluginInterface::SamplingDevices LimeSDROutputPlugin::enumSampleSinks(const Orig
{
if (it->hardwareId == m_hardwareID)
{
for (unsigned int j = 0; j < it->nbTxStreams; j++)
for (int j = 0; j < it->nbTxStreams; j++)
{
qDebug("LimeSDROutputPlugin::enumSampleSinks: device #%d channel %u: %s", it->sequence, j, qPrintable(it->serial));
QString displayedName = it->displayableName;

View File

@ -44,12 +44,12 @@ signals:
private:
std::vector<RemoteDataBlock> m_data;
int m_size;
unsigned int m_readHead; //!< index of last data block processed
unsigned int m_servedHead; //!< index of last data block served
unsigned int m_writeHead; //!< index of next data block to serve
int m_readHead; //!< index of last data block processed
int m_servedHead; //!< index of last data block served
int m_writeHead; //!< index of next data block to serve
QMutex m_mutex;
unsigned int calculateRemainder();
};
#endif // REMOTESINK_REMOTEOUTPUTFIFO_H_
#endif // REMOTESINK_REMOTEOUTPUTFIFO_H_

View File

@ -78,7 +78,7 @@ PluginInterface::SamplingDevices USRPOutputPlugin::enumSampleSinks(const OriginD
{
if (it->hardwareId == m_hardwareID)
{
for (unsigned int j = 0; j < it->nbTxStreams; j++)
for (int j = 0; j < it->nbTxStreams; j++)
{
qDebug("USRPOutputPlugin::enumSampleSinks: device #%d channel %u: %s", it->sequence, j, qPrintable(it->serial));
QString displayedName = it->displayableName;

View File

@ -79,7 +79,7 @@ PluginInterface::SamplingDevices XTRXOutputPlugin::enumSampleSinks(const OriginD
{
if (it->hardwareId == m_hardwareID)
{
for (unsigned int j = 0; j < it->nbTxStreams; j++)
for (int j = 0; j < it->nbTxStreams; j++)
{
qDebug("XTRXInputPlugin::enumSampleSinks: device #%d channel %u: %s", it->sequence, j, qPrintable(it->serial));
QString displayedName = it->displayableName;

View File

@ -83,7 +83,7 @@ PluginInterface::SamplingDevices AudioInputPlugin::enumSampleSources(const Origi
{
if (it->hardwareId == m_hardwareID)
{
for (unsigned int j = 0; j < it->nbRxStreams; j++)
for (int j = 0; j < it->nbRxStreams; j++)
{
result.append(SamplingDevice(
it->displayableName,

View File

@ -78,7 +78,7 @@ PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources(const Ori
{
if (it->hardwareId == m_hardwareID)
{
for (unsigned int j = 0; j < it->nbRxStreams; j++)
for (int j = 0; j < it->nbRxStreams; j++)
{
qDebug("LimeSDRInputPlugin::enumSampleSources: device #%d channel %u: %s", it->sequence, j, qPrintable(it->serial));
QString displayedName = it->displayableName;

View File

@ -78,7 +78,7 @@ PluginInterface::SamplingDevices USRPInputPlugin::enumSampleSources(const Origin
{
if (it->hardwareId == m_hardwareID)
{
for (unsigned int j = 0; j < it->nbRxStreams; j++)
for (int j = 0; j < it->nbRxStreams; j++)
{
qDebug("USRPInputPlugin::enumSampleSources: device #%d channel %u: %s", it->sequence, j, qPrintable(it->serial));
QString displayedName = it->displayableName;

View File

@ -81,7 +81,7 @@ PluginInterface::SamplingDevices XTRXInputPlugin::enumSampleSources(const Origin
{
if (it->hardwareId == m_hardwareID)
{
for (unsigned int j = 0; j < it->nbRxStreams; j++)
for (int j = 0; j < it->nbRxStreams; j++)
{
qDebug("XTRXInputPlugin::enumSampleSources: device #%d channel %u: %s", it->sequence, j, qPrintable(it->serial));
QString displayedName = it->displayableName;

View File

@ -35,7 +35,7 @@
#include "webapi/webapiadapterinterface.h"
#include "webapi/webapiutils.h"
bool ChannelWebAPIUtils::getCenterFrequency(int deviceIndex, double &frequencyInHz)
bool ChannelWebAPIUtils::getCenterFrequency(unsigned int deviceIndex, double &frequencyInHz)
{
SWGSDRangel::SWGDeviceSettings deviceSettingsResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
@ -44,7 +44,7 @@ bool ChannelWebAPIUtils::getCenterFrequency(int deviceIndex, double &frequencyIn
// Get current device settings
std::vector<DeviceSet*> deviceSets = MainCore::instance()->getDeviceSets();
if ((deviceIndex >= 0) && (deviceIndex < deviceSets.size()))
if (deviceIndex < deviceSets.size())
{
deviceSet = deviceSets[deviceIndex];
if (deviceSet->m_deviceSourceEngine)
@ -91,7 +91,7 @@ bool ChannelWebAPIUtils::getCenterFrequency(int deviceIndex, double &frequencyIn
return WebAPIUtils::getSubObjectDouble(*jsonObj, "centerFrequency", frequencyInHz);
}
bool ChannelWebAPIUtils::setCenterFrequency(int deviceIndex, double frequencyInHz)
bool ChannelWebAPIUtils::setCenterFrequency(unsigned int deviceIndex, double frequencyInHz)
{
SWGSDRangel::SWGDeviceSettings deviceSettingsResponse;
SWGSDRangel::SWGErrorResponse errorResponse;
@ -100,7 +100,7 @@ bool ChannelWebAPIUtils::setCenterFrequency(int deviceIndex, double frequencyInH
// Get current device settings
std::vector<DeviceSet*> deviceSets = MainCore::instance()->getDeviceSets();
if ((deviceIndex >= 0) && (deviceIndex < deviceSets.size()))
if (deviceIndex < deviceSets.size())
{
deviceSet = deviceSets[deviceIndex];
if (deviceSet->m_deviceSourceEngine)

View File

@ -23,8 +23,8 @@
class SDRBASE_API ChannelWebAPIUtils
{
public:
static bool getCenterFrequency(int deviceIndex, double &frequencyInHz);
static bool setCenterFrequency(int deviceIndex, double frequencyInHz);
static bool getCenterFrequency(unsigned int deviceIndex, double &frequencyInHz);
static bool setCenterFrequency(unsigned int deviceIndex, double frequencyInHz);
};
#endif // SDRBASE_CHANNEL_CHANNELWEBAPIUTILS_H_

View File

@ -811,13 +811,13 @@ void DSPDeviceMIMOEngine::handleSetMIMO(DeviceSampleMIMO* mimo)
return;
}
for (int i = 0; i < m_deviceSampleMIMO->getNbSinkFifos(); i++)
for (unsigned int i = 0; i < m_deviceSampleMIMO->getNbSinkFifos(); i++)
{
m_basebandSampleSinks.push_back(BasebandSampleSinks());
m_sourcesCorrections.push_back(SourceCorrection());
}
for (int i = 0; i < m_deviceSampleMIMO->getNbSourceFifos(); i++)
for (unsigned int i = 0; i < m_deviceSampleMIMO->getNbSourceFifos(); i++)
{
m_basebandSampleSources.push_back(BasebandSampleSources());
m_sourceSampleBuffers.push_back(IncrementalVector<Sample>());
@ -1018,7 +1018,7 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages()
MIMOChannel *channel = msg->getChannel();
m_mimoChannels.push_back(channel);
for (int isource = 0; isource < m_deviceSampleMIMO->getNbSourceStreams(); isource++)
for (unsigned int isource = 0; isource < m_deviceSampleMIMO->getNbSourceStreams(); isource++)
{
DSPMIMOSignalNotification notif(
m_deviceSampleMIMO->getSourceSampleRate(isource),
@ -1029,7 +1029,7 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages()
channel->handleMessage(notif);
}
for (int isink = 0; isink < m_deviceSampleMIMO->getNbSinkStreams(); isink++)
for (unsigned int isink = 0; isink < m_deviceSampleMIMO->getNbSinkStreams(); isink++)
{
DSPMIMOSignalNotification notif(
m_deviceSampleMIMO->getSinkSampleRate(isink),

View File

@ -35,14 +35,14 @@ public:
Type filter(Type sample)
{
Type acc = 0;
int n_samples = m_samples.size();
int n_taps = m_taps.size() - 1;
int a = m_ptr;
int b = a == 0 ? n_samples - 1 : a - 1;
unsigned int n_samples = m_samples.size();
unsigned int n_taps = m_taps.size() - 1;
unsigned int a = m_ptr;
unsigned int b = a == 0 ? n_samples - 1 : a - 1;
m_samples[m_ptr] = sample;
for (int i = 0; i < n_taps; ++i)
for (unsigned int i = 0; i < n_taps; ++i)
{
acc += (m_samples[a] + m_samples[b]) * m_taps[i];

View File

@ -135,7 +135,7 @@ bool GLScopeSettings::deserialize(const QByteArray& data)
m_tracesData.clear();
float r, g, b;
for (int iTrace = 0; iTrace < nbTracesSaved; iTrace++)
for (unsigned int iTrace = 0; iTrace < nbTracesSaved; iTrace++)
{
if (20 + 16*iTrace > 200) {
break;
@ -171,7 +171,7 @@ bool GLScopeSettings::deserialize(const QByteArray& data)
d.readU32(200, &nbTriggersSaved, 1);
m_triggersData.clear();
for (int iTrigger = 0; iTrigger < nbTriggersSaved; iTrigger++)
for (unsigned int iTrigger = 0; iTrigger < nbTriggersSaved; iTrigger++)
{
m_triggersData.push_back(TriggerData());

View File

@ -60,7 +60,7 @@ QByteArray GLSpectrumSettings::serialize() const
{
SimpleSerializer s(1);
s.writeS32(1, m_fftSize);
s.writeU32(1, m_fftSize);
s.writeS32(2, m_fftOverlap);
s.writeS32(3, (int) m_fftWindow);
s.writeReal(4, m_refLevel);
@ -102,7 +102,7 @@ bool GLSpectrumSettings::deserialize(const QByteArray& data)
if (d.getVersion() == 1)
{
d.readS32(1, &m_fftSize, 1024);
d.readU32(1, &m_fftSize, 1024);
d.readS32(2, &m_fftOverlap, 0);
d.readS32(3, &tmp, (int) FFTWindow::Hanning);
m_fftWindow = (FFTWindow::Function) tmp;

View File

@ -36,7 +36,7 @@ public:
AvgModeMax
};
int m_fftSize;
unsigned int m_fftSize;
int m_fftOverlap;
FFTWindow::Function m_fftWindow;
Real m_refLevel;

View File

@ -296,7 +296,7 @@ void SampleMIFifo::writeAsync(const SampleVector::const_iterator& begin, unsigne
}
QMutexLocker mutexLocker(&m_mutex);
int spaceLeft = m_size - m_vFill[stream];
unsigned int spaceLeft = m_size < m_vFill[stream] ? 0 : m_size - m_vFill[stream];
if (size > m_size)
{
@ -376,4 +376,4 @@ void SampleMIFifo::readAsync(
}
m_vHead[stream] = m_vFill[stream];
}
}

View File

@ -690,7 +690,7 @@ void SpectrumVis::applySettings(const GLSpectrumSettings& settings, bool force)
{
QMutexLocker mutexLocker(&m_mutex);
int fftSize = settings.m_fftSize > MAX_FFT_SIZE ?
unsigned int fftSize = settings.m_fftSize > MAX_FFT_SIZE ?
MAX_FFT_SIZE :
settings.m_fftSize < 64 ?
64 :

View File

@ -110,18 +110,18 @@ void MainCore::setLoggingOptions()
}
}
ChannelAPI *MainCore::getChannel(int deviceSetIndex, int channelIndex)
ChannelAPI *MainCore::getChannel(unsigned int deviceSetIndex, int channelIndex)
{
if ((deviceSetIndex >= 0) && (deviceSetIndex < m_deviceSets.size())) {
if (deviceSetIndex < m_deviceSets.size()) {
return m_deviceSets[deviceSetIndex]->getChannelAt(channelIndex);
} else {
return nullptr;
}
}
Feature *MainCore::getFeature(int featureSetIndex, int featureIndex)
Feature *MainCore::getFeature(unsigned int featureSetIndex, int featureIndex)
{
if ((featureSetIndex >= 0) && (featureSetIndex < m_featureSets.size())) {
if (featureSetIndex < m_featureSets.size()) {
return m_featureSets[featureSetIndex]->getFeatureAt(featureIndex);
} else {
return nullptr;
@ -136,7 +136,7 @@ void MainCore::appendFeatureSet()
m_featureSetsMap.insert(featureSet, newIndex);
}
void MainCore::removeFeatureSet(int index)
void MainCore::removeFeatureSet(unsigned int index)
{
if (index < m_featureSets.size())
{

View File

@ -413,13 +413,13 @@ public:
std::vector<DeviceSet*>& getDeviceSets() { return m_deviceSets; }
std::vector<FeatureSet*>& getFeatureeSets() { return m_featureSets; }
void setLoggingOptions();
ChannelAPI *getChannel(int deviceSetIndex, int channelIndex);
Feature *getFeature(int featureSetIndex, int featureIndex);
ChannelAPI *getChannel(unsigned int deviceSetIndex, int channelIndex);
Feature *getFeature(unsigned int featureSetIndex, int featureIndex);
bool existsChannel(ChannelAPI *channel) const { return m_channelsMap.contains(channel); }
bool existsFeature(Feature *feature) const { return m_featuresMap.contains(feature); }
// slave mode
void appendFeatureSet();
void removeFeatureSet(int index);
void removeFeatureSet(unsigned int index);
void removeLastFeatureSet();
void appendDeviceSet(int deviceType);
void removeLastDeviceSet();

View File

@ -134,9 +134,9 @@ void GLSpectrumGUI::displaySettings()
ui->fftWindow->setCurrentIndex(m_settings.m_fftWindow);
for (int i = 0; i < 6; i++)
for (unsigned int i = 0; i < 6; i++)
{
if (m_settings.m_fftSize == (1 << (i + 7)))
if (m_settings.m_fftSize == (1U << (i + 7)))
{
ui->fftSize->setCurrentIndex(i);
break;

View File

@ -651,9 +651,9 @@ void LimeRFEUSBDialog::syncRxTx()
void LimeRFEUSBDialog::stopStartRx(bool start)
{
int rxDeviceSetSequence = ui->deviceSetRx->currentIndex();
unsigned int rxDeviceSetSequence = ui->deviceSetRx->currentIndex();
if ((rxDeviceSetSequence < 0) || (rxDeviceSetSequence >= m_sourceEngines.size())) {
if (rxDeviceSetSequence >= m_sourceEngines.size()) {
return;
}
@ -677,9 +677,9 @@ void LimeRFEUSBDialog::stopStartRx(bool start)
void LimeRFEUSBDialog::stopStartTx(bool start)
{
int txDeviceSetSequence = ui->deviceSetTx->currentIndex();
unsigned int txDeviceSetSequence = ui->deviceSetTx->currentIndex();
if ((txDeviceSetSequence < 0) || (txDeviceSetSequence >= m_sinkEngines.size())) {
if (txDeviceSetSequence >= m_sinkEngines.size()) {
return;
}

View File

@ -638,7 +638,7 @@ void MainWindow::addFeatureSet()
ui->tabFeatures->addTab(m_featureUIs.back()->m_featureWindow, QString("F%1").arg(tabIndex));
}
void MainWindow::removeFeatureSet(int tabIndex)
void MainWindow::removeFeatureSet(unsigned int tabIndex)
{
if (tabIndex < m_featureUIs.size())
{

View File

@ -138,7 +138,7 @@ private:
void addMIMODevice();
void removeLastDevice();
void addFeatureSet();
void removeFeatureSet(int tabIndex);
void removeFeatureSet(unsigned int tabIndex);
void removeAllFeatureSets();
void deleteChannel(int deviceSetIndex, int channelIndex);
void sampleSourceChanged(int tabIndex, int newDeviceIndex);