Skip to content

Commit

Permalink
Fix several functions that return a boolean not an integer.
Browse files Browse the repository at this point in the history
One case requires changing the function return type, the others
require adding a test at the end of the function.
  • Loading branch information
linuxdude42 committed Mar 26, 2019
1 parent 23f73a5 commit 5711699
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythmetadata/videoscan.cpp
Expand Up @@ -382,7 +382,7 @@ bool VideoScannerThread::updateDB(const FileCheckList &add, const PurgeList &rem
SendProgressEvent(++counter);
}

return ret;
return ret > 0;
}

bool VideoScannerThread::buildFileList(const QString &directory,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/vbitext/cc.cpp
Expand Up @@ -56,7 +56,7 @@ static int parityok(int n) /* check parity for 2 bytes packed in n */
}


static int decodebit(const unsigned char *data, int threshold, int scale1)
static bool decodebit(const unsigned char *data, int threshold, int scale1)
{
int i, sum = 0;
for (i = 0; i < scale1; i++)
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/remoteencoder.cpp
Expand Up @@ -619,7 +619,7 @@ bool RemoteEncoder::CheckChannel(QString channel)
strlist << channel;

if (SendReceiveStringList(strlist, 1))
return strlist[0].toInt();
return strlist[0].toInt() != 0;

return false;
}
Expand All @@ -643,7 +643,7 @@ bool RemoteEncoder::ShouldSwitchToAnotherCard(QString channelid)
strlist << channelid;

if (SendReceiveStringList(strlist, 1))
return strlist[0].toInt();
return strlist[0].toInt() != 0;

return false;
}
Expand Down Expand Up @@ -671,7 +671,7 @@ bool RemoteEncoder::CheckChannelPrefix(
is_extra_char_useful = strlist[2].toInt();
needed_spacer = (strlist[3] == "X") ? "" : strlist[3];

return strlist[0].toInt();
return strlist[0].toInt() != 0;
}

static QString cleanup(const QString &str)
Expand Down Expand Up @@ -757,7 +757,7 @@ bool RemoteEncoder::SetChannelInfo(const InfoMap &infoMap)
strlist << make_safe(infoMap["XMLTV"]);

if (SendReceiveStringList(strlist, 1))
return strlist[0].toInt();
return strlist[0].toInt() != 0;

return false;
}
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/vbi608extractor.cpp
Expand Up @@ -321,7 +321,7 @@ bool VBI608Extractor::ExtractCC(const VideoFrame *picframe, uint max_lines)
}
}

return found_cnt;
return found_cnt > 0;
}

bool VBI608Extractor::ExtractCC12(const unsigned char *buf, uint width)
Expand Down

0 comments on commit 5711699

Please sign in to comment.