1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-05-24 03:02:29 -04: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; m_log2Interp = tmp > 6 ? 6 : tmp;
d.readU32(13, &m_filterChainHash, 0); d.readU32(13, &m_filterChainHash, 0);
d.readS32(14, &stmp, 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; return true;
} }

View File

@ -517,7 +517,7 @@ void ChirpChatDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("udpPort")) if (channelSettingsKeys.contains("udpPort"))
{ {
uint16_t port = response.getChirpChatDemodSettings()->getUdpPort(); 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")) { if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getChirpChatDemodSettings()->getRgbColor(); 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) 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); qDebug("NFMDemodSink::applyAudioSampleRate: %u m_channelSampleRate: %d", sampleRate, m_channelSampleRate);
m_filterTaps = (sampleRate / 48) | 1; m_filterTaps = (sampleRate / 48) | 1;

View File

@ -364,12 +364,6 @@ void FreeDVModSource::calculateLevel(qint16& sample)
void FreeDVModSource::applyAudioSampleRate(unsigned int sampleRate) void FreeDVModSource::applyAudioSampleRate(unsigned int sampleRate)
{ {
if (sampleRate < 0)
{
qWarning("FreeDVModSource::applyAudioSampleRate: invalid sample rate %d", sampleRate);
return;
}
qDebug("FreeDVModSource::applyAudioSampleRate: %d", sampleRate); qDebug("FreeDVModSource::applyAudioSampleRate: %d", sampleRate);
// TODO: put up simple IIR interpolator when sampleRate < m_modemSampleRate // 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) void TestMOSyncWorker::setLog2Interpolation(unsigned int log2Interpolation)
{ {
if ((log2Interpolation < 0) || (log2Interpolation > 6)) { if (log2Interpolation > 6) {
return; 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.notchOnOff = settings.m_amfmNotch;
m_rfeBoardState.enableSWR = settings.m_swrEnable ? RFE_SWR_ENABLE : RFE_SWR_DISABLE; m_rfeBoardState.enableSWR = settings.m_swrEnable ? RFE_SWR_ENABLE : RFE_SWR_DISABLE;