Skip to content

Commit

Permalink
Quiet cppcheck.. There is no error in these, but it's trivial to quie…
Browse files Browse the repository at this point in the history
…t the false positive cppcheck error.
  • Loading branch information
daniel-kristjansson committed Aug 22, 2011
1 parent 284d962 commit 8dab78c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
20 changes: 7 additions & 13 deletions mythtv/libs/libmythupnp/upnptaskevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,25 @@ void UPnpEventTask::Execute( TaskQueue * /*pQueue*/ )
if (m_pPayload == NULL)
return;

MSocketDevice *pSockDev = new MSocketDevice( MSocketDevice::Stream );
BufferedSocketDevice *pSock = new BufferedSocketDevice( pSockDev );
MSocketDevice sockDev( MSocketDevice::Stream );
BufferedSocketDevice sock ( &sockDev );

pSockDev->setBlocking( true );
sockDev.setBlocking( true );

if (pSock->Connect( m_PeerAddress, m_nPeerPort ))
if (sock.Connect( m_PeerAddress, m_nPeerPort ))
{
// ------------------------------------------------------------------
// Send NOTIFY message
// ------------------------------------------------------------------

if (pSock->WriteBlockDirect( m_pPayload->data(),
if (sock.WriteBlockDirect( m_pPayload->data(),
m_pPayload->size() ) != -1)
{
// --------------------------------------------------------------
// Read first line to determine success/Fail
// --------------------------------------------------------------

QString sResponseLine = pSock->ReadLine( 3000 );
QString sResponseLine = sock.ReadLine( 3000 );

if ( sResponseLine.length() > 0)
{
Expand Down Expand Up @@ -112,19 +112,13 @@ void UPnpEventTask::Execute( TaskQueue * /*pQueue*/ )
QString("UPnpEventTask::Execute - Error sending to %1:%2.")
.arg(m_PeerAddress.toString()) .arg(m_nPeerPort));

pSock->Close();
sock.Close();
}
else
{
LOG(VB_UPNP, LOG_ERR,
QString("UPnpEventTask::Execute - Error sending to %1:%2.")
.arg(m_PeerAddress.toString()) .arg(m_nPeerPort));
}

if ( pSock != NULL )
delete pSock;

if ( pSockDev != NULL )
delete pSockDev;
}

18 changes: 9 additions & 9 deletions mythtv/programs/mythcommflag/ClassicCommDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2101,12 +2101,9 @@ void ClassicCommDetector::BuildSceneChangeCommList(void)
if (section_start >= 0)
sceneCommBreakMap[framesProcessed] = MARK_COMM_END;

frm_dir_map_t::iterator it;
frm_dir_map_t::iterator prev;
frm_dir_map_t deleteMap;

it = sceneCommBreakMap.begin();
prev = it;
frm_dir_map_t::iterator it = sceneCommBreakMap.begin();
frm_dir_map_t::iterator prev = it;
if (it != sceneCommBreakMap.end())
{
it++;
Expand All @@ -2123,14 +2120,17 @@ void ClassicCommDetector::BuildSceneChangeCommList(void)
it++;
}

for (it = deleteMap.begin(); it != deleteMap.end(); ++it)
sceneCommBreakMap.remove(it.key());
frm_dir_map_t::iterator dit;
for (dit = deleteMap.begin(); dit != deleteMap.end(); ++dit)
sceneCommBreakMap.remove(dit.key());
}

LOG(VB_COMMFLAG, LOG_INFO, "Scene-Change Commercial Break Map" );
for(it = sceneCommBreakMap.begin(); it != sceneCommBreakMap.end(); ++it)
for (it = sceneCommBreakMap.begin(); it != sceneCommBreakMap.end(); ++it)
{
LOG(VB_COMMFLAG, LOG_INFO, QString(" %1:%2")
.arg(it.key()).arg(*it));
.arg(it.key()).arg(*it));
}
}


Expand Down

0 comments on commit 8dab78c

Please sign in to comment.