Skip to content

Commit

Permalink
cppcheck: Reduce scope of variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdude42 committed Mar 28, 2021
1 parent 73b8364 commit d987abf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions mythtv/libs/libmythtv/eithelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,6 @@ static uint get_chan_id_from_db_atsc(uint sourceid,
static uint get_chan_id_from_db_dvb(uint sourceid, uint serviceid,
uint networkid, uint transportid)
{
uint chanid = 0;
bool useOnAirGuide = false;
MSqlQuery query(MSqlQuery::InitCon());

// DVB Link to chanid
Expand Down Expand Up @@ -935,8 +933,8 @@ static uint get_chan_id_from_db_dvb(uint sourceid, uint serviceid,

while (query.next())
{
chanid = query.value(0).toUInt();
useOnAirGuide = query.value(1).toBool();
uint chanid = query.value(0).toUInt();
bool useOnAirGuide = query.value(1).toBool();
return useOnAirGuide ? chanid : 0;
}

Expand All @@ -959,8 +957,6 @@ static uint get_chan_id_from_db_dvb(uint sourceid, uint serviceid,
static uint get_chan_id_from_db_dtv(uint sourceid, uint serviceid,
uint tunedchanid)
{
uint chanid = 0;
bool useOnAirGuide = false;
uint db_sourceid = 0;
MSqlQuery query(MSqlQuery::InitCon());

Expand All @@ -987,9 +983,9 @@ static uint get_chan_id_from_db_dtv(uint sourceid, uint serviceid,
while (query.next())
{
// Check to see if we are interested in this channel
chanid = query.value(0).toUInt();
useOnAirGuide = query.value(1).toBool();
db_sourceid = query.value(2).toUInt();
uint chanid = query.value(0).toUInt();
bool useOnAirGuide = query.value(1).toBool();
db_sourceid = query.value(2).toUInt();
if (sourceid == db_sourceid)
return useOnAirGuide ? chanid : 0;
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythlcdserver/lcdprocclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ bool LCDProcClient::connectToHost(const QString &lhostname, unsigned int lport)
// Open communications
// Store the hostname and port in case we need to reconnect.

int timeout = 1000;
m_hostname = lhostname;
m_port = lport;

Expand All @@ -155,6 +154,7 @@ bool LCDProcClient::connectToHost(const QString &lhostname, unsigned int lport)
QTextStream os(m_socket);
m_socket->connectToHost(m_hostname, m_port);

int timeout = 1000;
while (--timeout && m_socket->state() != QAbstractSocket::ConnectedState)
{
qApp->processEvents();
Expand Down

0 comments on commit d987abf

Please sign in to comment.