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

Fixed -Wtype-limits warnings

This commit is contained in:
f4exb 2020-11-14 19:18:41 +01:00
parent 7a6636b63a
commit 6285235257
6 changed files with 4 additions and 16 deletions

View File

@ -100,7 +100,7 @@ bool BeamSteeringCWModSettings::deserialize(const QByteArray& data)
m_log2Interp = tmp > 6 ? 6 : tmp;
d.readU32(13, &m_filterChainHash, 0);
d.readS32(14, &stmp, 0);
m_channelOutput = tmp < 0 ? 0 : tmp > 2 ? 2 : tmp;
m_channelOutput = stmp < 0 ? 0 : stmp > 2 ? 2 : stmp;
return true;
}

View File

@ -517,7 +517,7 @@ void ChirpChatDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("udpPort"))
{
uint16_t port = response.getChirpChatDemodSettings()->getUdpPort();
settings.m_udpPort = port < 1024 ? 1024 : port > 65535 ? 65535 : port;
settings.m_udpPort = port < 1024 ? 1024 : port;
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getChirpChatDemodSettings()->getRgbColor();

View File

@ -320,12 +320,6 @@ void NFMDemodSink::applySettings(const NFMDemodSettings& settings, bool force)
void NFMDemodSink::applyAudioSampleRate(unsigned int sampleRate)
{
if (sampleRate < 0)
{
qWarning("NFMDemodSink::applyAudioSampleRate: invalid sample rate: %d", sampleRate);
return;
}
qDebug("NFMDemodSink::applyAudioSampleRate: %u m_channelSampleRate: %d", sampleRate, m_channelSampleRate);
m_filterTaps = (sampleRate / 48) | 1;

View File

@ -364,12 +364,6 @@ void FreeDVModSource::calculateLevel(qint16& sample)
void FreeDVModSource::applyAudioSampleRate(unsigned int sampleRate)
{
if (sampleRate < 0)
{
qWarning("FreeDVModSource::applyAudioSampleRate: invalid sample rate %d", sampleRate);
return;
}
qDebug("FreeDVModSource::applyAudioSampleRate: %d", sampleRate);
// TODO: put up simple IIR interpolator when sampleRate < m_modemSampleRate

View File

@ -104,7 +104,7 @@ void TestMOSyncWorker::setSamplerate(int samplerate)
void TestMOSyncWorker::setLog2Interpolation(unsigned int log2Interpolation)
{
if ((log2Interpolation < 0) || (log2Interpolation > 6)) {
if (log2Interpolation > 6) {
return;
}

View File

@ -349,7 +349,7 @@ void LimeRFEController::settingsToState(const LimeRFESettings& settings)
}
}
m_rfeBoardState.attValue = settings.m_attenuationFactor < 0 ? 0 : settings.m_attenuationFactor > 7 ? 7 : settings.m_attenuationFactor;
m_rfeBoardState.attValue = settings.m_attenuationFactor > 7 ? 7 : settings.m_attenuationFactor;
m_rfeBoardState.notchOnOff = settings.m_amfmNotch;
m_rfeBoardState.enableSWR = settings.m_swrEnable ? RFE_SWR_ENABLE : RFE_SWR_DISABLE;