Skip to content

Commit

Permalink
Merge pull request f4exb#1718 from srcejon/fix_1713
Browse files Browse the repository at this point in the history
Remove comparison of strings and chars
  • Loading branch information
f4exb committed Jun 23, 2023
2 parents b4847f1 + b092a01 commit a8665ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugins/channelrx/demodrtty/rttydemodsink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ void RttyDemodSink::receiveBit(bool bit)
else
{
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
float rssi = CalcDb::dbPower(m_rssiMagSqSum / m_rssiMagSqCount);
Expand Down
8 changes: 4 additions & 4 deletions sdrbase/util/baudot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,25 +166,25 @@ QString BaudotDecoder::decode(char 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
m_figure = false;
if (m_characterSet == Baudot::RUSSIAN) {
m_letters = Baudot::m_ita2Letter;
}
}
if (c == '<')
if (c == "<")
{
// Switch to figures
m_figure = true;
}
if ((m_characterSet == Baudot::RUSSIAN) && (c == '\0'))
if ((m_characterSet == Baudot::RUSSIAN) && (c == "\0"))
{
// Switch to Cyrillic
m_figure = false;
m_letters = Baudot::m_russianLetter;
c = '^';
c = "^";
}

return c;
Expand Down

0 comments on commit a8665ed

Please sign in to comment.