Skip to content

Commit

Permalink
[apps] Fixing build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko authored and rndi committed May 31, 2019
1 parent 27b1301 commit 11feba2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions apps/transmitbase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class Source: public Location
}
};

virtual SRTSOCKET GetSRTSocket() { return SRT_INVALID_SOCK; };
virtual int GetSysSocket() { return -1; };
virtual SRTSOCKET GetSRTSocket() const { return SRT_INVALID_SOCK; };
virtual int GetSysSocket() const { return -1; };
virtual bool AcceptNewClient() { return false; }
};

Expand All @@ -73,8 +73,8 @@ class Target: public Location
static std::unique_ptr<Target> Create(const std::string& url);
virtual ~Target() {}

virtual SRTSOCKET GetSRTSocket() { return SRT_INVALID_SOCK; }
virtual int GetSysSocket() { return -1; }
virtual SRTSOCKET GetSRTSocket() const { return SRT_INVALID_SOCK; }
virtual int GetSysSocket() const { return -1; }
virtual bool AcceptNewClient() { return false; }
};

Expand Down
8 changes: 4 additions & 4 deletions apps/transmitmedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ class ConsoleSource: public Source

bool IsOpen() override { return cin.good(); }
bool End() override { return cin.eof(); }
int GetSysSocket() { return 0; };
int GetSysSocket() const override { return 0; };
};

class ConsoleTarget: public Target
Expand All @@ -859,7 +859,7 @@ class ConsoleTarget: public Target

bool IsOpen() override { return cout.good(); }
bool Broken() override { return cout.eof(); }
int GetSysSocket() { return 0; };
int GetSysSocket() const override { return 0; };
};

template <class Iface> struct Console;
Expand Down Expand Up @@ -1083,7 +1083,7 @@ class UdpSource: public Source, public UdpCommon

sockaddr_in sa;
socklen_t si = sizeof(sockaddr_in);
int stat = recvfrom(m_sock, data.data(), chunk, 0, (sockaddr*)&sa, &si);
int stat = recvfrom(m_sock, data.data(), (int) chunk, 0, (sockaddr*)&sa, &si);
if (stat < 1)
{
if (SysError() != EWOULDBLOCK)
Expand Down Expand Up @@ -1115,7 +1115,7 @@ class UdpTarget: public Target, public UdpCommon

int Write(const char* data, size_t len, ostream &SRT_ATR_UNUSED = cout) override
{
int stat = sendto(m_sock, data, len, 0, (sockaddr*)&sadr, sizeof sadr);
int stat = sendto(m_sock, data, (int) len, 0, (sockaddr*)&sadr, sizeof sadr);
if ( stat == -1 )
{
if ((false))
Expand Down
14 changes: 7 additions & 7 deletions apps/transmitmedia.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class SrtCommon
void StealFrom(SrtCommon& src);
bool AcceptNewClient();

SRTSOCKET Socket() { return m_sock; }
SRTSOCKET Listener() { return m_bindsock; }
SRTSOCKET Socket() const { return m_sock; }
SRTSOCKET Listener() const { return m_bindsock; }

virtual void Close();

Expand Down Expand Up @@ -84,7 +84,6 @@ class SrtCommon

class SrtSource: public Source, public SrtCommon
{
int srt_epoll = -1;
std::string hostport_copy;
public:

Expand Down Expand Up @@ -112,14 +111,15 @@ class SrtSource: public Source, public SrtCommon
bool End() override { return IsBroken(); }
void Close() override { return SrtCommon::Close(); }

SRTSOCKET GetSRTSocket()
SRTSOCKET GetSRTSocket() const override
{
SRTSOCKET socket = SrtCommon::Socket();
if (socket == SRT_INVALID_SOCK)
socket = SrtCommon::Listener();
return socket;
}
bool AcceptNewClient() { return SrtCommon::AcceptNewClient(); }

bool AcceptNewClient() override { return SrtCommon::AcceptNewClient(); }
};

class SrtTarget: public Target, public SrtCommon
Expand Down Expand Up @@ -148,14 +148,14 @@ class SrtTarget: public Target, public SrtCommon
return bytes;
}

SRTSOCKET GetSRTSocket()
SRTSOCKET GetSRTSocket() const override
{
SRTSOCKET socket = SrtCommon::Socket();
if (socket == SRT_INVALID_SOCK)
socket = SrtCommon::Listener();
return socket;
}
bool AcceptNewClient() { return SrtCommon::AcceptNewClient(); }
bool AcceptNewClient() override { return SrtCommon::AcceptNewClient(); }
};


Expand Down

0 comments on commit 11feba2

Please sign in to comment.