Skip to content

Commit

Permalink
[core] Fixed C4267 warning on MSVC (#2675).
Browse files Browse the repository at this point in the history
Also apps and tests.
  • Loading branch information
ethouris committed Sep 19, 2023
1 parent 83d91af commit 0f6ddbb
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion srtcore/epoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ static ostream& PrintEpollEvent(ostream& os, int events, int et_events)
make_pair(SRT_EPOLL_UPDATE, "U")
};

int N = Size(namemap);
const int N = (int)Size(namemap);

for (int i = 0; i < N; ++i)
{
Expand Down
4 changes: 2 additions & 2 deletions srtcore/fec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ void FECFilterBuiltin::ConfigureColumns(Container& which, int32_t isn)
if (col % numberRows() == numberRows() - 1)
{
offset = col + 1; // +1 because we want it for the next column
HLOGC(pflog.Debug, log << "ConfigureColumns: [" << (col+1) << "]... (resetting to row 0: +"
HLOGC(pflog.Debug, log << "ConfigureColumns: [" << (int(col)+1) << "]... (resetting to row 0: +"
<< offset << " %" << CSeqNo::incseq(isn, (int32_t)offset) << ")");
}
else
{
offset += 1 + sizeRow();
HLOGC(pflog.Debug, log << "ConfigureColumns: [" << (col+1) << "] ... (continue +"
HLOGC(pflog.Debug, log << "ConfigureColumns: [" << (int(col)+1) << "] ... (continue +"
<< offset << " %" << CSeqNo::incseq(isn, (int32_t)offset) << ")");
}
}
Expand Down
32 changes: 16 additions & 16 deletions test/test_buffer_rcv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class CRcvBufferReadMsg
{
const bool pb_first = (i == 0);
const bool pb_last = (i == (msg_len_pkts - 1));
const int res = addPacket(start_seqno + i, msgno, pb_first, pb_last, out_of_order, ts);
const int res = addPacket(start_seqno + int(i), msgno, pb_first, pb_last, out_of_order, ts);

if (res != 0)
return res;
Expand Down Expand Up @@ -113,7 +113,7 @@ class CRcvBufferReadMsg

int getAvailBufferSize()
{
return m_rcv_buffer->getAvailSize(m_first_unack_seqno);
return int(m_rcv_buffer->getAvailSize(m_first_unack_seqno));
}

int readMessage(char* data, size_t len)
Expand Down Expand Up @@ -180,7 +180,7 @@ TEST_F(CRcvBufferReadMsg, FullBuffer)
array<char, m_payload_sz> buff;
for (int i = 0; i < m_buff_size_pkts - 1; ++i)
{
const int res = rcv_buffer.readBuffer(buff.data(), buff.size());
const int res = rcv_buffer.readBuffer(buff.data(), int(buff.size()));
EXPECT_TRUE(size_t(res) == m_payload_sz);
EXPECT_TRUE(verifyPayload(buff.data(), res, CSeqNo::incseq(m_init_seqno, i)));
}
Expand Down Expand Up @@ -220,7 +220,7 @@ TEST_F(CRcvBufferReadMsg, OnePacketGap)

EXPECT_EQ(getAvailBufferSize(), m_buff_size_pkts - 2);
// The buffer will return 0 as reading is not available.
res = rcv_buffer.readBuffer(buff.data(), buff.size());
res = rcv_buffer.readBuffer(buff.data(), int(buff.size()));
EXPECT_EQ(res, 0);

res = readMessage(buff.data(), buff.size());
Expand Down Expand Up @@ -305,7 +305,7 @@ TEST_F(CRcvBufferReadMsg, PacketDropByMsgNoSeqNo)

const bool pb_first = (i == 0);
const bool pb_last = false; // Do not put the whole message in the buffer.
EXPECT_EQ(addPacket(m_init_seqno + i, msgno, pb_first, pb_last, false), 0);
EXPECT_EQ(addPacket(m_init_seqno + int(i), msgno, pb_first, pb_last, false), 0);
}

auto& rcv_buffer = *m_rcv_buffer.get();
Expand Down Expand Up @@ -420,7 +420,7 @@ TEST_F(CRcvBufferReadMsg, MsgAcked)
for (size_t i = 0; i < msg_pkts; ++i)
{
const ptrdiff_t offset = i * m_payload_sz;
EXPECT_TRUE(verifyPayload(buff.data() + offset, m_payload_sz, CSeqNo::incseq(m_init_seqno, i)));
EXPECT_TRUE(verifyPayload(buff.data() + offset, m_payload_sz, CSeqNo::incseq(m_init_seqno, int(i))));
}
EXPECT_EQ(m_unit_queue->size(), m_unit_queue->capacity());
}
Expand Down Expand Up @@ -479,7 +479,7 @@ TEST_F(CRcvBufferReadMsg, MsgHalfAck)
for (size_t i = 0; i < msg_pkts; ++i)
{
const ptrdiff_t offset = i * m_payload_sz;
EXPECT_TRUE(verifyPayload(buff.data() + offset, m_payload_sz, CSeqNo::incseq(m_init_seqno, i)));
EXPECT_TRUE(verifyPayload(buff.data() + offset, m_payload_sz, CSeqNo::incseq(m_init_seqno, int(i))));
}
EXPECT_EQ(m_unit_queue->size(), m_unit_queue->capacity());
}
Expand All @@ -503,7 +503,7 @@ TEST_F(CRcvBufferReadMsg, OutOfOrderMsgNoACK)
for (size_t i = 0; i < msg_pkts; ++i)
{
const ptrdiff_t offset = i * m_payload_sz;
EXPECT_TRUE(verifyPayload(buff.data() + offset, m_payload_sz, CSeqNo::incseq(m_init_seqno, i)));
EXPECT_TRUE(verifyPayload(buff.data() + offset, m_payload_sz, CSeqNo::incseq(m_init_seqno, int(i))));
}

EXPECT_FALSE(m_rcv_buffer->isRcvDataReady());
Expand All @@ -530,7 +530,7 @@ TEST_F(CRcvBufferReadMsg, OutOfOrderMsgGap)
for (size_t i = 0; i < msg_pkts; ++i)
{
const ptrdiff_t offset = i * m_payload_sz;
EXPECT_TRUE(verifyPayload(buff.data() + offset, m_payload_sz, CSeqNo::incseq(m_init_seqno, 1 + i)));
EXPECT_TRUE(verifyPayload(buff.data() + offset, m_payload_sz, CSeqNo::incseq(m_init_seqno, int(i)+1)));
}

EXPECT_FALSE(m_rcv_buffer->isRcvDataReady());
Expand Down Expand Up @@ -580,7 +580,7 @@ TEST_F(CRcvBufferReadMsg, LongMsgReadReady)
// int addPacket(int seqno, bool pb_first = true, bool pb_last = true, bool out_of_order = false, int ts = 0)
const bool pb_first = (i == 0);
const bool pb_last = (i == (msg_pkts - 1));
EXPECT_EQ(addPacket(CSeqNo::incseq(m_init_seqno, i), msgno, pb_first, pb_last), 0);
EXPECT_EQ(addPacket(CSeqNo::incseq(m_init_seqno, int(i)), msgno, pb_first, pb_last), 0);
ackPackets(1);
if (!pb_last)
{
Expand All @@ -599,7 +599,7 @@ TEST_F(CRcvBufferReadMsg, LongMsgReadReady)
for (size_t i = 0; i < msg_pkts; ++i)
{
const ptrdiff_t offset = i * m_payload_sz;
EXPECT_TRUE(verifyPayload(buff.data() + offset, m_payload_sz, CSeqNo::incseq(m_init_seqno, i)));
EXPECT_TRUE(verifyPayload(buff.data() + offset, m_payload_sz, CSeqNo::incseq(m_init_seqno, int(i))));
}
EXPECT_EQ(m_unit_queue->size(), m_unit_queue->capacity());
}
Expand All @@ -621,7 +621,7 @@ TEST_F(CRcvBufferReadMsg, MsgOutOfOrderDrop)
EXPECT_EQ(res, msg_bytelen);
for (size_t i = 0; i < msg_pkts; ++i)
{
EXPECT_TRUE(verifyPayload(buff.data() + i * m_payload_sz, m_payload_sz, msg_seqno + i));
EXPECT_TRUE(verifyPayload(buff.data() + i * m_payload_sz, m_payload_sz, msg_seqno + int(i)));
}

EXPECT_FALSE(m_rcv_buffer->isRcvDataReady());
Expand Down Expand Up @@ -660,7 +660,7 @@ TEST_F(CRcvBufferReadMsg, MsgOutOfOrderAfterInOrder)
EXPECT_EQ(m_rcv_buffer->readMessage(buff.data(), buff.size()), msg_bytelen);
for (size_t i = 0; i < msg_pkts; ++i)
{
EXPECT_TRUE(verifyPayload(buff.data() + i * m_payload_sz, m_payload_sz, m_init_seqno + msg_i * msg_pkts + i));
EXPECT_TRUE(verifyPayload(buff.data() + i * m_payload_sz, m_payload_sz, int(m_init_seqno + msg_i * msg_pkts + i)));
}
}

Expand Down Expand Up @@ -809,7 +809,7 @@ TEST_F(CRcvBufferReadStream, ReadSinglePackets)
std::array<char, m_payload_sz> buff;
for (int i = 0; i < ack_pkts; ++i)
{
const size_t res = m_rcv_buffer->readBuffer(buff.data(), buff.size());
const size_t res = m_rcv_buffer->readBuffer(buff.data(), int(buff.size()));
EXPECT_TRUE(size_t(res) == m_payload_sz);
EXPECT_EQ(getAvailBufferSize(), m_buff_size_pkts - ack_pkts + i);
EXPECT_TRUE(verifyPayload(buff.data(), res, CSeqNo::incseq(m_init_seqno, i)));
Expand All @@ -826,7 +826,7 @@ TEST_F(CRcvBufferReadStream, ReadSinglePackets)
ackPackets(num_pkts_left);
for (int i = 0; i < num_pkts_left; ++i)
{
const int res = m_rcv_buffer->readBuffer(buff.data(), buff.size());
const int res = m_rcv_buffer->readBuffer(buff.data(), int(buff.size()));
EXPECT_TRUE(size_t(res) == m_payload_sz);
EXPECT_EQ(getAvailBufferSize(), m_buff_size_pkts - num_pkts_left + i);
EXPECT_TRUE(verifyPayload(buff.data(), res, CSeqNo::incseq(m_init_seqno, ack_pkts + i)));
Expand Down Expand Up @@ -863,7 +863,7 @@ TEST_F(CRcvBufferReadStream, ReadFractional)

const size_t num_bytes2 = m_payload_sz * (num_pkts - nfull_pkts - 1) + m_payload_sz / 2;

const int res2 = m_rcv_buffer->readBuffer(buff.data() + num_bytes1, buff.size() - num_bytes1);
const int res2 = m_rcv_buffer->readBuffer(buff.data() + num_bytes1, int(buff.size() - num_bytes1));
EXPECT_TRUE(size_t(res2) == num_bytes2);
EXPECT_EQ(getAvailBufferSize(), m_buff_size_pkts - 1);
EXPECT_FALSE(hasAvailablePackets());
Expand Down
4 changes: 2 additions & 2 deletions test/test_cryspr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ void test_kmwrap(
cryspr_cb,
wrap,
tv->sek,
tv->seklen);
uint32_t(tv->seklen));

ASSERT_EQ(rc1, 0);
ASSERT_EQ(rc2, 0);
Expand Down Expand Up @@ -447,7 +447,7 @@ void test_kmunwrap(
cryspr_cb,
sek,
tv->wrap,
wraplen);
uint32_t(wraplen));

ASSERT_EQ(rc1, 0);
ASSERT_EQ(rc2, 0);
Expand Down
2 changes: 1 addition & 1 deletion test/test_enforced_encryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static std::ostream& PrintEpollEvent(std::ostream& os, int events, int et_events
make_pair(SRT_EPOLL_UPDATE, "U")
};

int N = Size(namemap);
const int N = (int)Size(namemap);

for (int i = 0; i < N; ++i)
{
Expand Down
4 changes: 2 additions & 2 deletions test/test_fec_rebuilding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class TestFECRebuilding: public srt::Test
// Randomly chose the size

int minsize = 732;
int divergence = plsize - minsize - 1;
int divergence = int(plsize) - minsize - 1;
size_t length = minsize + rand() % divergence;

p.setLength(length);
Expand Down Expand Up @@ -257,7 +257,7 @@ TEST(TestFEC, ConfigExchangeFaux)

for (auto badconfig: fec_config_wrong)
{
ASSERT_EQ(srt_setsockflag(sid1, SRTO_PACKETFILTER, badconfig, strlen(badconfig)), -1);
ASSERT_EQ(srt_setsockflag(sid1, SRTO_PACKETFILTER, badconfig, (int)strlen(badconfig)), -1);
}

TestMockCUDT m1;
Expand Down
2 changes: 1 addition & 1 deletion test/test_file_transmission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ TEST(Transmission, FileUpload)
size_t shift = 0;
while (n > 0)
{
const int st = srt_send(sock_clr, buf.data()+shift, n);
const int st = srt_send(sock_clr, buf.data()+shift, int(n));
ASSERT_GT(st, 0) << srt_getlasterror_str();

n -= st;
Expand Down
18 changes: 9 additions & 9 deletions test/test_listen_callback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ int SrtTestListenCallback(void* opaq, SRTSOCKET ns, int hsversion, const struct

#if SRT_ENABLE_ENCRYPTION
cerr << "TEST: Setting password '" << exp_pw << "' as per user '" << username << "'\n";
EXPECT_EQ(srt_setsockflag(ns, SRTO_PASSPHRASE, exp_pw.c_str(), exp_pw.size()), SRT_SUCCESS);
EXPECT_EQ(srt_setsockflag(ns, SRTO_PASSPHRASE, exp_pw.c_str(), (int)exp_pw.size()), SRT_SUCCESS);
#endif

// Checking that SRTO_RCVLATENCY (PRE option) can be altered in the listener callback.
Expand Down Expand Up @@ -244,9 +244,9 @@ TEST_F(ListenerCallback, SecureSuccess)
string username_spec = "#!::u=admin";
string password = "thelocalmanager";

ASSERT_NE(srt_setsockflag(client_sock, SRTO_STREAMID, username_spec.c_str(), username_spec.size()), -1);
ASSERT_NE(srt_setsockflag(client_sock, SRTO_STREAMID, username_spec.c_str(), (int)username_spec.size()), -1);
#if SRT_ENABLE_ENCRYPTION
ASSERT_NE(srt_setsockflag(client_sock, SRTO_PASSPHRASE, password.c_str(), password.size()), -1);
ASSERT_NE(srt_setsockflag(client_sock, SRTO_PASSPHRASE, password.c_str(), (int)password.size()), -1);
#endif

// EXPECTED RESULT: connected successfully
Expand All @@ -261,8 +261,8 @@ TEST_F(ListenerCallback, FauxPass)
string username_spec = "#!::u=admin";
string password = "thelokalmanager"; // (typo :D)

ASSERT_NE(srt_setsockflag(client_sock, SRTO_STREAMID, username_spec.c_str(), username_spec.size()), -1);
ASSERT_NE(srt_setsockflag(client_sock, SRTO_PASSPHRASE, password.c_str(), password.size()), -1);
ASSERT_NE(srt_setsockflag(client_sock, SRTO_STREAMID, username_spec.c_str(), (int)username_spec.size()), -1);
ASSERT_NE(srt_setsockflag(client_sock, SRTO_PASSPHRASE, password.c_str(), (int)password.size()), -1);

// EXPECTED RESULT: connection rejected
EXPECT_EQ(srt_connect(client_sock, psa, sizeof sa), SRT_ERROR);
Expand All @@ -276,9 +276,9 @@ TEST_F(ListenerCallback, FauxUser)
string username_spec = "#!::u=haivision";
string password = "thelocalmanager"; // (typo :D)

ASSERT_NE(srt_setsockflag(client_sock, SRTO_STREAMID, username_spec.c_str(), username_spec.size()), -1);
ASSERT_NE(srt_setsockflag(client_sock, SRTO_STREAMID, username_spec.c_str(), (int)username_spec.size()), -1);
#if SRT_ENABLE_ENCRYPTION
ASSERT_NE(srt_setsockflag(client_sock, SRTO_PASSPHRASE, password.c_str(), password.size()), -1);
ASSERT_NE(srt_setsockflag(client_sock, SRTO_PASSPHRASE, password.c_str(), (int)password.size()), -1);
#endif

// EXPECTED RESULT: connection rejected
Expand All @@ -292,9 +292,9 @@ TEST_F(ListenerCallback, FauxSyntax)
string username_spec = "#!::r=mystream,t=publish"; // No 'u' key specified
string password = "thelocalmanager";

ASSERT_NE(srt_setsockflag(client_sock, SRTO_STREAMID, username_spec.c_str(), username_spec.size()), -1);
ASSERT_NE(srt_setsockflag(client_sock, SRTO_STREAMID, username_spec.c_str(), (int)username_spec.size()), -1);
#if SRT_ENABLE_ENCRYPTION
ASSERT_NE(srt_setsockflag(client_sock, SRTO_PASSPHRASE, password.c_str(), password.size()), -1);
ASSERT_NE(srt_setsockflag(client_sock, SRTO_PASSPHRASE, password.c_str(), (int)password.size()), -1);
#endif

// EXPECTED RESULT: connection rejected
Expand Down
14 changes: 7 additions & 7 deletions test/test_socket_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,15 @@ void CheckGetSockOpt<strptr>(const OptionTestEntry& entry, SRTSOCKET sock, const
EXPECT_EQ(srt_getsockopt(sock, 0, entry.optid, &opt_val, &opt_len), SRT_SUCCESS)
<< "Getting " << entry.optname << " returned error: " << srt_getlasterror_str();

EXPECT_EQ(strncmp(opt_val, value, min<int>(opt_len, entry.opt_len)), 0) << desc << ": Wrong " << entry.optname << " value " << opt_val;
EXPECT_EQ(strncmp(opt_val, value, min(opt_len, (int)entry.opt_len)), 0) << desc << ": Wrong " << entry.optname << " value " << opt_val;
EXPECT_EQ(opt_len, entry.opt_len) << desc << "Wrong " << entry.optname << " value length";
}

template<class ValueType>
void CheckSetSockOpt(const OptionTestEntry& entry, SRTSOCKET sock, const ValueType& value, int expect_return, const char* desc)
{
ValueType opt_val = value;
int opt_len = entry.opt_len;
int opt_len = (int)entry.opt_len;
EXPECT_EQ(srt_setsockopt(sock, 0, entry.optid, &opt_val, opt_len), expect_return)
<< "Setting " << entry.optname << " to " << opt_val << " must " << (expect_return == SRT_SUCCESS ? "succeed" : "fail");

Expand Down Expand Up @@ -858,7 +858,7 @@ TEST_F(TestSocketOptions, StreamIDOdd)
// 13 characters, that is, 3*4+1
string sid_odd = "something1234";

EXPECT_EQ(srt_setsockopt(m_caller_sock, 0, SRTO_STREAMID, sid_odd.c_str(), sid_odd.size()), SRT_SUCCESS);
EXPECT_EQ(srt_setsockopt(m_caller_sock, 0, SRTO_STREAMID, sid_odd.c_str(), (int)sid_odd.size()), SRT_SUCCESS);

char buffer[CSrtConfig::MAX_SID_LENGTH + 135];
int buffer_len = sizeof buffer;
Expand Down Expand Up @@ -887,7 +887,7 @@ TEST_F(TestSocketOptions, StreamIDEven)
// 12 characters = 4*3, that is, aligned to 4
string sid_even = "123412341234";

EXPECT_EQ(srt_setsockopt(m_caller_sock, 0, SRTO_STREAMID, sid_even.c_str(), sid_even.size()), SRT_SUCCESS);
EXPECT_EQ(srt_setsockopt(m_caller_sock, 0, SRTO_STREAMID, sid_even.c_str(), (int)sid_even.size()), SRT_SUCCESS);

char buffer[CSrtConfig::MAX_SID_LENGTH + 135];
int buffer_len = sizeof buffer;
Expand Down Expand Up @@ -923,7 +923,7 @@ TEST_F(TestSocketOptions, StreamIDAlmostFull)
sid_amost_full[size-2] = 'y';
sid_amost_full[size-1] = 'z';

EXPECT_EQ(srt_setsockopt(m_caller_sock, 0, SRTO_STREAMID, sid_amost_full.c_str(), sid_amost_full.size()), SRT_SUCCESS);
EXPECT_EQ(srt_setsockopt(m_caller_sock, 0, SRTO_STREAMID, sid_amost_full.c_str(), (int)sid_amost_full.size()), SRT_SUCCESS);

char buffer[CSrtConfig::MAX_SID_LENGTH + 135];
int buffer_len = sizeof buffer;
Expand Down Expand Up @@ -959,7 +959,7 @@ TEST_F(TestSocketOptions, StreamIDFull)
sid_full[size-2] = 'y';
sid_full[size-1] = 'z';

EXPECT_EQ(srt_setsockopt(m_caller_sock, 0, SRTO_STREAMID, sid_full.c_str(), sid_full.size()), SRT_SUCCESS);
EXPECT_EQ(srt_setsockopt(m_caller_sock, 0, SRTO_STREAMID, sid_full.c_str(), (int)sid_full.size()), SRT_SUCCESS);

char buffer[CSrtConfig::MAX_SID_LENGTH + 135];
int buffer_len = sizeof buffer;
Expand Down Expand Up @@ -989,7 +989,7 @@ TEST_F(TestSocketOptions, StreamIDLenListener)
{
string stream_id_13 = "something1234";

EXPECT_EQ(srt_setsockopt(m_listen_sock, 0, SRTO_STREAMID, stream_id_13.c_str(), stream_id_13.size()), SRT_SUCCESS);
EXPECT_EQ(srt_setsockopt(m_listen_sock, 0, SRTO_STREAMID, stream_id_13.c_str(), (int)stream_id_13.size()), SRT_SUCCESS);

char buffer[648];
int buffer_len = sizeof buffer;
Expand Down
2 changes: 1 addition & 1 deletion test/test_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ TEST(CircularBuffer, Overall)
int offset = 9;
IF_HEAVY_LOGGING(cerr << "Forced adding at position 9 with dropping (capacity: " << buf.capacity() << "):\n");
// State we already know it has failed. Calculate drop size.
int dropshift = offset - (buf.capacity() - 1); // buf.capacity()-1 is the latest position
int dropshift = offset - int(buf.capacity() - 1); // buf.capacity()-1 is the latest position
offset -= dropshift;
IF_HEAVY_LOGGING(cerr << "Need to drop: " << dropshift << " New offset:" << offset << endl);
ASSERT_GE(dropshift, 0);
Expand Down
4 changes: 2 additions & 2 deletions testing/srt-test-file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ bool DoUpload(UriParser& ut, string path, string filename)
size_t shift = 0;
while (n > 0)
{
int st = srt_send(ss, buf.data()+shift, n);
int st = srt_send(ss, buf.data()+shift, int(n));
Verb() << "Upload: " << n << " --> " << st << (!shift ? string() : "+" + Sprint(shift));
if (st == SRT_ERROR)
{
Expand Down Expand Up @@ -357,7 +357,7 @@ bool DoDownload(UriParser& us, string directory, string filename)

for (;;)
{
int n = srt_recv(ss, buf.data(), ::g_buffer_size);
int n = srt_recv(ss, buf.data(), int(::g_buffer_size));
if (n == SRT_ERROR)
{
cerr << "Download: SRT error: " << srt_getlasterror_str() << endl;
Expand Down
6 changes: 3 additions & 3 deletions testing/srt-test-live.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ extern "C" int SrtUserPasswordHook(void* , SRTSOCKET acpsock, int hsv, const soc

string exp_pw = passwd.at(username);

srt_setsockflag(acpsock, SRTO_PASSPHRASE, exp_pw.c_str(), exp_pw.size());
srt_setsockflag(acpsock, SRTO_PASSPHRASE, exp_pw.c_str(), int(exp_pw.size()));

return 0;
}
Expand Down Expand Up @@ -857,7 +857,7 @@ int main( int argc, char** argv )
if (stoptime != 0)
{
int elapsed = end_time - start_time;
int remain = stoptime - elapsed;
int remain = int(stoptime) - elapsed;

if (remain <= final_delay)
{
Expand Down Expand Up @@ -918,7 +918,7 @@ int main( int argc, char** argv )
if (stoptime != 0)
{
int elapsed = time(0) - end_time;
int remain = stoptime - final_delay - elapsed;
int remain = int(stoptime - final_delay - elapsed);
if (remain < 0)
{
Verror() << "\n (interrupted on timeout: elapsed " << elapsed << "s) - waiting " << final_delay << "s for cleanup";
Expand Down
Loading

0 comments on commit 0f6ddbb

Please sign in to comment.