1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-06-16 05:22:54 -04:00

Fixed narrowing warning when Rx sample size is 16 bits

This commit is contained in:
f4exb 2020-11-24 00:02:44 +01:00
parent 4059a0be27
commit ce2aad5a7a
4 changed files with 14 additions and 14 deletions

View File

@ -48,7 +48,7 @@ void ChirpChatDemodDecoderTTY::decodeSymbols(const std::vector<unsigned short>&
} }
else else
{ {
char asciiChar = -1; signed char asciiChar = -1;
if (ttyState == TTYLetters) { if (ttyState == TTYLetters) {
asciiChar = ttyLetters[(int) ttyChar]; asciiChar = ttyLetters[(int) ttyChar];

View File

@ -583,7 +583,9 @@ void MetisMISOUDPHandler::processIQBuffer(unsigned char* buffer)
{ {
if (m_settings.m_log2Decim == 0) // no decimation - direct conversion if (m_settings.m_log2Decim == 0) // no decimation - direct conversion
{ {
m_convertBuffer[r][m_sampleCount] = getRxIQInversion(r) ? Sample{sampleQ, sampleI} : Sample{sampleI, sampleQ}; m_convertBuffer[r][m_sampleCount] = getRxIQInversion(r)
? Sample{(FixReal) sampleQ, (FixReal) sampleI}
: Sample{(FixReal) sampleI, (FixReal) sampleQ};
samplesAdded = 1; samplesAdded = 1;
} }
else else

View File

@ -453,12 +453,11 @@ void DSPDeviceMIMOEngine::workSamplesSource(SampleVector& data, unsigned int iBe
begin, begin,
begin, begin,
[this](Sample& a, const Sample& b) -> Sample { [this](Sample& a, const Sample& b) -> Sample {
int den = m_sumIndex + 1; // at each stage scale sum by n/n+1 and input by 1/n+1 FixReal den = m_sumIndex + 1; // at each stage scale sum by n/n+1 and input by 1/n+1
int nom = m_sumIndex; // so that final sum is scaled by N (number of channels) FixReal nom = m_sumIndex; // so that final sum is scaled by N (number of channels)
return Sample{ FixReal x = a.real()/den + nom*(b.real()/den);
a.real()/den + nom*(b.real()/den), FixReal y = a.imag()/den + nom*(b.imag()/den);
a.imag()/den + nom*(b.imag()/den) return Sample{x, y};
};
} }
); );
} }

View File

@ -222,12 +222,11 @@ void DSPDeviceSinkEngine::workSamples(SampleVector& data, unsigned int iBegin, u
data.begin() + iBegin, data.begin() + iBegin,
data.begin() + iBegin, data.begin() + iBegin,
[this](Sample& a, const Sample& b) -> Sample { [this](Sample& a, const Sample& b) -> Sample {
int den = m_sumIndex + 1; // at each stage scale sum by n/n+1 and input by 1/n+1 FixReal den = m_sumIndex + 1; // at each stage scale sum by n/n+1 and input by 1/n+1
int nom = m_sumIndex; // so that final sum is scaled by N (number of channels) FixReal nom = m_sumIndex; // so that final sum is scaled by N (number of channels)
return Sample{ FixReal x = a.real()/den + nom*(b.real()/den);
a.real()/den + nom*(b.real()/den), FixReal y = a.imag()/den + nom*(b.imag()/den);
a.imag()/den + nom*(b.imag()/den) return Sample{x, y};
};
} }
); );
} }