Skip to content

Commit

Permalink
[core] Fixed a few warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko authored and rndi committed Aug 12, 2019
1 parent cf86388 commit e7d9e99
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions srtcore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and internally by the library, this directory also contains:

- common files: usually header files, which can be used also by other projects,
even if they don't link against SRT

- public and protected header files - header files for the library, which will
be picked up from here

Expand Down
4 changes: 2 additions & 2 deletions srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ void CUDTUnited::updateMux(
{
m.m_pChannel->close();
delete m.m_pChannel;
throw e;
throw;
}

// XXX Simplify this. Use sockaddr_any.
Expand Down Expand Up @@ -2740,7 +2740,7 @@ SRT_SOCKSTATUS CUDT::getsockstate(SRTSOCKET u)
{
return s_UDTUnited.getStatus(u);
}
catch (CUDTException e)
catch (CUDTException &e)
{
s_UDTUnited.setError(new CUDTException(e));
return SRTS_NONEXIST;
Expand Down
10 changes: 8 additions & 2 deletions srtcore/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,13 @@ bool CRcvBuffer::getRcvReadyMsg(ref_t<uint64_t> tsbpdtime, ref_t<int32_t> curpkt
int rmpkts = 0;
int rmbytes = 0;

string reason = "NOT RECEIVED";
#if ENABLE_HEAVY_LOGGING
const char* reason = "NOT RECEIVED";
#define IF_HEAVY_LOGGING(instr) instr
#else
#define IF_HEAVY_LOGGING(instr) (void)0
#endif

for (int i = m_iStartPos, n = m_iLastAckPos; i != n; i = (i + 1) % m_iSize)
{
bool freeunit = false;
Expand Down Expand Up @@ -1054,7 +1060,7 @@ bool CRcvBuffer::getRcvReadyMsg(ref_t<uint64_t> tsbpdtime, ref_t<int32_t> curpkt

if (m_pUnit[i]->m_Packet.getMsgCryptoFlags() != EK_NOENC)
{
reason = "DECRYPTION FAILED";
IF_HEAVY_LOGGING(reason = "DECRYPTION FAILED");
freeunit = true; /* packet not decrypted */
}
else
Expand Down
3 changes: 2 additions & 1 deletion srtcore/handshake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ string CHandShake::show()
<< " cookie=" << hex << m_iCookie << dec
<< " srcIP=";

const unsigned char* p = (const unsigned char*)m_piPeerIP, * pe = p + 4*(sizeof (uint32_t));
const unsigned char* p = (const unsigned char*)m_piPeerIP;
const unsigned char* pe = p + 4 * (sizeof(uint32_t));

copy(p, pe, ostream_iterator<unsigned>(so, "."));

Expand Down
3 changes: 2 additions & 1 deletion testing/testmedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,8 @@ extern unique_ptr<Base> CreateMedium(const string& uri)

}

ptr->uri = move(u);
if (ptr)
ptr->uri = move(u);
return ptr;
}

Expand Down

0 comments on commit e7d9e99

Please sign in to comment.