Skip to content

Commit

Permalink
[core] Fixed some compiler warnings. (#1669)
Browse files Browse the repository at this point in the history
- C4101 - local variable never used (2).
- C4129- 'character' : unrecognized character escape sequence (1).
- C4305 - truncation from 'type1' to 'type2' (1).
- Moved pending_broken unde heavy logging scope.
  • Loading branch information
maxsharabayko authored Nov 24, 2020
1 parent b7eb2d2 commit c2f9316
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ int CUDTUnited::newConnection(const SRTSOCKET listen, const sockaddr_any& peer,
{
ns->m_SocketID = generateSocketID();
}
catch (const CUDTException& e)
catch (const CUDTException&)
{
LOGF(cnlog.Fatal, "newConnection: IPE: all sockets occupied? Last gen=%d", m_SocketIDGenerator);
// generateSocketID throws exception, which can be naturally handled
Expand Down Expand Up @@ -2966,7 +2966,7 @@ void CUDTUnited::updateMux(
s->m_pUDT->m_pRcvQueue = m.m_pRcvQueue;
s->m_iMuxID = m.m_iID;
}
catch (CUDTException& e)
catch (const CUDTException&)
{
m.destroy();
throw;
Expand Down
2 changes: 1 addition & 1 deletion srtcore/congctl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class FileCC : public SrtCongestionControlBase
HLOGC(cclog.Debug, log << "FileCC: LOSS: "
<< "sent=" << CSeqNo::seqlen(m_iLastAck, m_parent->sndSeqNo()) << ", inFlight=" << pktsInFlight
<< ", lost=" << numPktsLost << " ("
<< lost_pcent_x10 / 10 << "." << lost_pcent_x10 % 10 << "\%)");
<< lost_pcent_x10 / 10 << "." << lost_pcent_x10 % 10 << "%)");
if (lost_pcent_x10 < 20) // 2.0%
{
HLOGC(cclog.Debug, log << "FileCC: LOSS: m_dLastDecPeriod=" << m_dLastDecPeriod << "->" << m_dPktSndPeriod);
Expand Down
2 changes: 1 addition & 1 deletion srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11182,9 +11182,9 @@ void CUDT::updateBrokenConnection()
void CUDT::completeBrokenConnectionDependencies(int errorcode)
{
int token = -1;
bool pending_broken = false;

#if ENABLE_EXPERIMENTAL_BONDING
bool pending_broken = false;
{
ScopedLock guard_group_existence (s_UDTUnited.m_GlobControlLock);
if (m_parent->m_IncludedGroup)
Expand Down
2 changes: 1 addition & 1 deletion test/test_listen_callback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int SrtTestListenCallback(void* opaq, SRTSOCKET ns, int hsversion, const struct

static const char stdhdr [] = "#!::";
uint32_t* pattern = (uint32_t*)stdhdr;
bool found = -1;
bool found = false;

if (strlen(streamid) > 4 && *(uint32_t*)streamid == *pattern)
{
Expand Down

0 comments on commit c2f9316

Please sign in to comment.