1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

Merge pull request #1718 from srcejon/fix_1713

Remove comparison of strings and chars
This commit is contained in:
Edouard Griffiths 2023-06-23 18:00:33 +02:00 committed by GitHub
commit a8665ed898
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -517,7 +517,7 @@ void RttyDemodSink::receiveBit(bool bit)
else else
{ {
QString c = m_rttyDecoder.decode((m_bits >> 1) & 0x1f); QString c = m_rttyDecoder.decode((m_bits >> 1) & 0x1f);
if ((c != '\0') && (c != '<') && (c != '>') && (c != '^')) if ((c != "\0") && (c != "<") && (c != ">") && (c != "^"))
{ {
// Calculate average power over received byte // Calculate average power over received byte
float rssi = CalcDb::dbPower(m_rssiMagSqSum / m_rssiMagSqCount); float rssi = CalcDb::dbPower(m_rssiMagSqSum / m_rssiMagSqCount);

View File

@ -166,7 +166,7 @@ QString BaudotDecoder::decode(char bits)
{ {
QString c = m_figure ? m_figures[(int)bits] : m_letters[(int)bits]; QString c = m_figure ? m_figures[(int)bits] : m_letters[(int)bits];
if ((c == '>') || (m_unshiftOnSpace && (c == " "))) if ((c == ">") || (m_unshiftOnSpace && (c == " ")))
{ {
// Switch to letters // Switch to letters
m_figure = false; m_figure = false;
@ -174,17 +174,17 @@ QString BaudotDecoder::decode(char bits)
m_letters = Baudot::m_ita2Letter; m_letters = Baudot::m_ita2Letter;
} }
} }
if (c == '<') if (c == "<")
{ {
// Switch to figures // Switch to figures
m_figure = true; m_figure = true;
} }
if ((m_characterSet == Baudot::RUSSIAN) && (c == '\0')) if ((m_characterSet == Baudot::RUSSIAN) && (c == "\0"))
{ {
// Switch to Cyrillic // Switch to Cyrillic
m_figure = false; m_figure = false;
m_letters = Baudot::m_russianLetter; m_letters = Baudot::m_russianLetter;
c = '^'; c = "^";
} }
return c; return c;