change size_t to unsigned int

pull/114/head
lucamarche-iz1mlt 7 years ago
parent a15bcab8ce
commit 76bac70132

@ -40,7 +40,7 @@ CBmPeer::CBmPeer(const CCallsign &callsign, const CIp &ip, char *modules, const
std::cout << "Adding BM peer" << std::endl;
// and construct all xlx clients
for ( size_t i = 0; i < ::strlen(modules); i++ )
for ( unsigned int i = 0; i < ::strlen(modules); i++ )
{
// create
CBmClient *client = new CBmClient(callsign, ip, modules[i]);
@ -52,7 +52,7 @@ CBmPeer::CBmPeer(const CCallsign &callsign, const CIp &ip, char *modules, const
CBmPeer::CBmPeer(const CBmPeer &peer)
: CPeer(peer)
{
for ( size_t i = 0; i < peer.m_Clients.size(); i++ )
for ( unsigned int i = 0; i < peer.m_Clients.size(); i++ )
{
CBmClient *client = new CBmClient((const CBmClient &)*(peer.m_Clients[i]));
// grow vector capacity if needed

@ -120,7 +120,7 @@ void CBuffer::ReplaceAt(int i, uint32 ui)
void CBuffer::ReplaceAt(int i, const uint8 *ptr, int len)
{
if ( size() < (size_t)(i+len) )
if ( size() < (unsigned int)(i+len) )
{
resize(i+len);
}
@ -133,7 +133,7 @@ void CBuffer::ReplaceAt(int i, const uint8 *ptr, int len)
int CBuffer::Compare(uint8 *buffer, int len) const
{
int result = -1;
if ( size() >= (size_t)len )
if ( size() >= (unsigned int)len )
{
result = ::memcmp(data(), buffer, len);
}
@ -143,7 +143,7 @@ int CBuffer::Compare(uint8 *buffer, int len) const
int CBuffer::Compare(uint8 *buffer, int off, int len) const
{
int result = -1;
if ( size() >= (size_t)(off+len) )
if ( size() >= (unsigned int)(off+len) )
{
result = ::memcmp(&(data()[off]), buffer, len);
}
@ -182,7 +182,7 @@ CBuffer::operator const char *() const
void CBuffer::DebugDump(std::ofstream &debugout) const
{
for ( size_t i = 0; i < size(); i++ )
for ( unsigned int i = 0; i < size(); i++ )
{
char sz[16];
//sprintf(sz, "%02X", data()[i]);

@ -137,7 +137,7 @@ bool CCallsign::IsValid(void) const
bool CCallsign::HasSuffix(void) const
{
bool has = false;
for ( size_t i = 0; i < CALLSUFFIX_LEN; i++ )
for ( unsigned int i = 0; i < CALLSUFFIX_LEN; i++ )
{
has |= (m_Suffix[i] != ' ');
}
@ -174,14 +174,14 @@ void CCallsign::SetCallsign(const uint8 *buffer, int len, bool UpdateDmrid)
::memset(m_Callsign, ' ', sizeof(m_Callsign));
m_Module = ' ';
::memcpy(m_Callsign, buffer, MIN(len, sizeof(m_Callsign)-1));
for ( size_t i = 0; i < sizeof(m_Callsign); i++ )
for ( unsigned int i = 0; i < sizeof(m_Callsign); i++ )
{
if ( m_Callsign[i] == 0 )
{
m_Callsign[i] = ' ';
}
}
if ( ((size_t)len >= sizeof(m_Callsign)) && ((char)buffer[sizeof(m_Callsign)-1] != 0) )
if ( ((unsigned int)len >= sizeof(m_Callsign)) && ((char)buffer[sizeof(m_Callsign)-1] != 0) )
{
m_Module = (char)buffer[sizeof(m_Callsign)-1];
}
@ -244,7 +244,7 @@ void CCallsign::SetSuffix(const uint8 *buffer, int len)
void CCallsign::PatchCallsign(int off, const uint8 *patch, int len)
{
if ( (size_t)off < sizeof(m_Callsign) )
if ( (unsigned int)off < sizeof(m_Callsign) )
{
::memcpy(m_Callsign, patch, MIN(len, sizeof(m_Callsign) - off));
}
@ -266,7 +266,7 @@ void CCallsign::GetCallsign(uint8 *buffer) const
void CCallsign::GetCallsignString(char *sz) const
{
int i;
for ( i = 0; ((size_t)i < sizeof(m_Callsign)) && (m_Callsign[i] != ' '); i++ )
for ( i = 0; ((unsigned int)i < sizeof(m_Callsign)) && (m_Callsign[i] != ' '); i++ )
{
sz[i] = m_Callsign[i];
}
@ -291,7 +291,7 @@ bool CCallsign::HasSameCallsignWithWildcard(const CCallsign &callsign) const
bool same = true;
bool done = false;
for ( size_t i = 0; (i < sizeof(m_Callsign)) && same && !done; i++ )
for ( unsigned int i = 0; (i < sizeof(m_Callsign)) && same && !done; i++ )
{
if ( !(done = ((m_Callsign[i] == '*') || (callsign[i] == '*'))) )
{

@ -131,7 +131,7 @@ bool CCallsignList::IsCallsignListedWithWildcard(const CCallsign &callsign) cons
{
bool listed = false;
for ( size_t i = 0; (i < size()) && !listed; i++ )
for ( unsigned int i = 0; (i < size()) && !listed; i++ )
{
listed = (data()[i]).HasSameCallsignWithWildcard(callsign);
}
@ -143,7 +143,7 @@ bool CCallsignList::IsCallsignListedWithWildcard(const CCallsign &callsign, char
{
bool listed = false;
for ( size_t i = 0; (i < size()) && !listed; i++ )
for ( unsigned int i = 0; (i < size()) && !listed; i++ )
{
const CCallsignListItem *item = &(data()[i]);
listed = (item->HasSameCallsignWithWildcard(callsign) &&
@ -158,7 +158,7 @@ bool CCallsignList::IsCallsignListed(const CCallsign &callsign, char module) con
{
bool listed = false;
for ( size_t i = 0; (i < size()) && !listed; i++ )
for ( unsigned int i = 0; (i < size()) && !listed; i++ )
{
const CCallsignListItem *item = &(data()[i]);
listed = (item->HasSameCallsign(callsign) && item->HasModuleListed(module));
@ -172,7 +172,7 @@ bool CCallsignList::IsCallsignListed(const CCallsign &callsign, char *modules) c
{
bool listed = false;
for ( size_t i = 0; (i < size()) && !listed; i++ )
for ( unsigned int i = 0; (i < size()) && !listed; i++ )
{
const CCallsignListItem *item = &(data()[i]);
listed = (item->HasSameCallsign(callsign) && item->CheckListedModules(modules));
@ -190,7 +190,7 @@ CCallsignListItem *CCallsignList::FindListItem(const CCallsign &Callsign)
CCallsignListItem *item = NULL;
// find client
for ( size_t i = 0; (i < size()) && (item == NULL); i++ )
for ( unsigned int i = 0; (i < size()) && (item == NULL); i++ )
{
if ( (data()[i]).GetCallsign().HasSameCallsign(Callsign) )
{

@ -45,7 +45,7 @@ CCallsignListItem::CCallsignListItem(const CCallsign &callsign, const CIp &ip, c
::memset(m_Modules, 0, sizeof(m_Modules));
if ( modules[0] == '*' )
{
for ( size_t i = 0; i < NB_OF_MODULES; i++ )
for ( unsigned int i = 0; i < NB_OF_MODULES; i++ )
{
m_Modules[i] = 'A' + i;
}
@ -75,7 +75,7 @@ CCallsignListItem::CCallsignListItem(const CCallsign &callsign, const char *url,
::memset(m_Modules, 0, sizeof(m_Modules));
if ( modules[0] == '*' )
{
for ( size_t i = 0; i < NB_OF_MODULES; i++ )
for ( unsigned int i = 0; i < NB_OF_MODULES; i++ )
{
m_Modules[i] = 'A' + i;
}
@ -132,7 +132,7 @@ bool CCallsignListItem::CheckListedModules(char *Modules) const
char list[NB_MODULES_MAX+1];
list[0] = 0;
//
for ( size_t i = 0; i < ::strlen(Modules); i++ )
for ( unsigned int i = 0; i < ::strlen(Modules); i++ )
{
if ( HasModuleListed(Modules[i]) )
{

@ -43,7 +43,7 @@ CClients::~CClients()
{
m_Mutex.lock();
{
for ( size_t i = 0; i < m_Clients.size(); i++ )
for ( unsigned int i = 0; i < m_Clients.size(); i++ )
{
delete m_Clients[i];
}
@ -60,7 +60,7 @@ void CClients::AddClient(CClient *client)
{
// first check if client already exists
bool found = false;
for ( size_t i = 0; (i < m_Clients.size()) && !found; i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && !found; i++ )
{
found = (*client == *m_Clients[i]);
// if found, just do nothing
@ -100,7 +100,7 @@ void CClients::RemoveClient(CClient *client)
{
// look for the client
bool found = false;
for ( size_t i = 0; (i < m_Clients.size()) && !found; i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && !found; i++ )
{
// compare objetc pointers
if ( (m_Clients[i]) == client )
@ -128,7 +128,7 @@ void CClients::RemoveClient(CClient *client)
CClient *CClients::GetClient(int i)
{
if ( (i >= 0) && ((size_t)i < m_Clients.size()) )
if ( (i >= 0) && ((unsigned int)i < m_Clients.size()) )
{
return m_Clients[i];
}
@ -141,7 +141,7 @@ CClient *CClients::GetClient(int i)
bool CClients::IsClient(CClient *client) const
{
bool found = false;
for ( size_t i = 0; (i < m_Clients.size()) && !found; i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && !found; i++ )
{
found = (m_Clients[i] == client);
}
@ -156,7 +156,7 @@ CClient *CClients::FindClient(const CIp &Ip)
CClient *client = NULL;
// find client
for ( size_t i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
{
if ( m_Clients[i]->GetIp() == Ip )
{
@ -173,7 +173,7 @@ CClient *CClients::FindClient(const CIp &Ip, int Protocol)
CClient *client = NULL;
// find client
for ( size_t i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
{
if ( (m_Clients[i]->GetIp() == Ip) && (m_Clients[i]->GetProtocol() == Protocol))
{
@ -190,7 +190,7 @@ CClient *CClients::FindClient(const CIp &Ip, int Protocol, char ReflectorModule)
CClient *client = NULL;
// find client
for ( size_t i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
{
if ( (m_Clients[i]->GetIp() == Ip) &&
(m_Clients[i]->GetReflectorModule() == ReflectorModule) &&
@ -209,7 +209,7 @@ CClient *CClients::FindClient(const CCallsign &Callsign, const CIp &Ip, int Prot
CClient *client = NULL;
// find client
for ( size_t i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
{
if ( m_Clients[i]->GetCallsign().HasSameCallsign(Callsign) &&
(m_Clients[i]->GetIp() == Ip) &&
@ -228,7 +228,7 @@ CClient *CClients::FindClient(const CCallsign &Callsign, char module, const CIp
CClient *client = NULL;
// find client
for ( size_t i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
{
if ( m_Clients[i]->GetCallsign().HasSameCallsign(Callsign) &&
(m_Clients[i]->GetModule() == module) &&
@ -248,7 +248,7 @@ CClient *CClients::FindClient(const CCallsign &Callsign, int Protocol)
CClient *client = NULL;
// find client
for ( size_t i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && (client == NULL); i++ )
{
if ( (m_Clients[i]->GetProtocol() == Protocol) &&
m_Clients[i]->GetCallsign().HasSameCallsign(Callsign) )
@ -270,7 +270,7 @@ CClient *CClients::FindNextClient(int Protocol, int *index)
// find next client
bool found = false;
for ( size_t i = *index+1; (i < m_Clients.size()) && !found; i++ )
for ( unsigned int i = *index+1; (i < m_Clients.size()) && !found; i++ )
{
if ( m_Clients[i]->GetProtocol() == Protocol )
{
@ -288,7 +288,7 @@ CClient *CClients::FindNextClient(const CIp &Ip, int Protocol, int *index)
// find next client
bool found = false;
for ( size_t i = *index+1; (i < m_Clients.size()) && !found; i++ )
for ( unsigned int i = *index+1; (i < m_Clients.size()) && !found; i++ )
{
if ( (m_Clients[i]->GetProtocol() == Protocol) &&
(m_Clients[i]->GetIp() == Ip) )
@ -307,7 +307,7 @@ CClient *CClients::FindNextClient(const CCallsign &Callsign, const CIp &Ip, int
// find next client
bool found = false;
for ( size_t i = *index+1; (i < m_Clients.size()) && !found; i++ )
for ( unsigned int i = *index+1; (i < m_Clients.size()) && !found; i++ )
{
if ( (m_Clients[i]->GetProtocol() == Protocol) &&
(m_Clients[i]->GetIp() == Ip) &&

@ -159,7 +159,7 @@ void CCodecStream::Task(void)
uint8 DStarSync[] = { 0x55,0x2D,0x16 };
// any packet from transcoder
if ( m_Socket.Receive(&Buffer, &Ip, 5) != -1 )
if ( m_Socket.Receive(&Buffer, &Ip, 20) != -1 )
{
// crack
if ( IsValidAmbePacket(Buffer, Ambe) )

@ -146,11 +146,11 @@ uint32 CDmridDir::FindDmrid(const CCallsign &callsign)
bool CDmridDir::IsValidDmrid(const char *sz)
{
bool ok = false;
size_t n = ::strlen(sz);
unsigned int n = ::strlen(sz);
if ( (n > 0) && (n <= 8) )
{
ok = true;
for ( size_t i = 0; (i < n) && ok; i++ )
for ( unsigned int i = 0; (i < n) && ok; i++ )
{
ok &= ::isdigit(sz[i]);
}

@ -33,7 +33,7 @@
////////////////////////////////////////////////////////////////////////////////////////
//#define STREAM_TIMEOUT (0.600)
#define STREAM_TIMEOUT (1.600)
#define STREAM_TIMEOUT (2.000)
////////////////////////////////////////////////////////////////////////////////////////
// class

@ -68,7 +68,7 @@ CPeer::CPeer(const CPeer &peer)
CPeer::~CPeer()
{
for ( size_t i = 0; i < m_Clients.size(); i++ )
for ( unsigned int i = 0; i < m_Clients.size(); i++ )
{
delete m_Clients[i];
}
@ -85,7 +85,7 @@ bool CPeer::operator ==(const CPeer &peer) const
same &= (peer.m_Callsign == m_Callsign);
same &= (peer.m_Ip == m_Ip);
same &= (peer.m_Version == m_Version);
for ( size_t i = 0; (i < m_Clients.size()) && same ; i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && same ; i++ )
{
same &= (peer.m_Clients[i] == m_Clients[i]);
}
@ -99,7 +99,7 @@ bool CPeer::operator ==(const CPeer &peer) const
bool CPeer::IsAMaster(void) const
{
bool master = false;
for ( size_t i = 0; (i < m_Clients.size()) && !master ; i++ )
for ( unsigned int i = 0; (i < m_Clients.size()) && !master ; i++ )
{
master |= m_Clients[i]->IsAMaster();
}
@ -109,7 +109,7 @@ bool CPeer::IsAMaster(void) const
void CPeer::Alive(void)
{
m_LastKeepaliveTime.Now();;
for ( size_t i = 0; i < m_Clients.size(); i++ )
for ( unsigned int i = 0; i < m_Clients.size(); i++ )
{
m_Clients[i]->Alive();
}
@ -120,7 +120,7 @@ void CPeer::Alive(void)
CClient *CPeer::GetClient(int i)
{
if ( (i >= 0) && ((size_t)i < m_Clients.size()) )
if ( (i >= 0) && ((unsigned int)i < m_Clients.size()) )
{
return m_Clients[i];
}

@ -43,7 +43,7 @@ CPeers::~CPeers()
{
m_Mutex.lock();
{
for ( size_t i = 0; i < m_Peers.size(); i++ )
for ( unsigned int i = 0; i < m_Peers.size(); i++ )
{
delete m_Peers[i];
}
@ -60,7 +60,7 @@ void CPeers::AddPeer(CPeer *peer)
{
// first check if peer already exists
bool found = false;
for ( size_t i = 0; (i < m_Peers.size()) && !found; i++ )
for ( unsigned int i = 0; (i < m_Peers.size()) && !found; i++ )
{
found = (*peer == *m_Peers[i]);
// if found, just do nothing
@ -104,7 +104,7 @@ void CPeers::RemovePeer(CPeer *peer)
{
// look for the client
bool found = false;
for ( size_t i = 0; (i < m_Peers.size()) && !found; i++ )
for ( unsigned int i = 0; (i < m_Peers.size()) && !found; i++ )
{
// compare objetc pointers
if ( (m_Peers[i]) == peer )
@ -139,7 +139,7 @@ void CPeers::RemovePeer(CPeer *peer)
CPeer *CPeers::GetPeer(int i)
{
if ( (i >= 0) && ((size_t)i < m_Peers.size()) )
if ( (i >= 0) && ((unsigned int)i < m_Peers.size()) )
{
return m_Peers[i];
}
@ -157,7 +157,7 @@ CPeer *CPeers::FindPeer(const CIp &Ip, int Protocol)
CPeer *peer = NULL;
// find peer
for ( size_t i = 0; (i < m_Peers.size()) && (peer == NULL); i++ )
for ( unsigned int i = 0; (i < m_Peers.size()) && (peer == NULL); i++ )
{
if ( (m_Peers[i]->GetIp() == Ip) && (m_Peers[i]->GetProtocol() == Protocol))
{
@ -174,7 +174,7 @@ CPeer *CPeers::FindPeer(const CCallsign &Callsign, const CIp &Ip, int Protocol)
CPeer *peer = NULL;
// find peer
for ( size_t i = 0; (i < m_Peers.size()) && (peer == NULL); i++ )
for ( unsigned int i = 0; (i < m_Peers.size()) && (peer == NULL); i++ )
{
if ( m_Peers[i]->GetCallsign().HasSameCallsign(Callsign) &&
(m_Peers[i]->GetIp() == Ip) &&
@ -193,7 +193,7 @@ CPeer *CPeers::FindPeer(const CCallsign &Callsign, int Protocol)
CPeer *peer = NULL;
// find peer
for ( size_t i = 0; (i < m_Peers.size()) && (peer == NULL); i++ )
for ( unsigned int i = 0; (i < m_Peers.size()) && (peer == NULL); i++ )
{
if ( (m_Peers[i]->GetProtocol() == Protocol) &&
m_Peers[i]->GetCallsign().HasSameCallsign(Callsign) )
@ -216,7 +216,7 @@ CPeer *CPeers::FindNextPeer(int Protocol, int *index)
// find next peer
bool found = false;
for ( size_t i = *index+1; (i < m_Peers.size()) && !found; i++ )
for ( unsigned int i = *index+1; (i < m_Peers.size()) && !found; i++ )
{
if ( m_Peers[i]->GetProtocol() == Protocol )
{

@ -172,7 +172,7 @@ CPacketStream *CProtocol::GetStream(uint16 uiStreamId, const CIp *Ip)
CPacketStream *stream = NULL;
// find if we have a stream with same streamid in our cache
for ( size_t i = 0; (i < m_Streams.size()) && (stream == NULL); i++ )
for ( unsigned int i = 0; (i < m_Streams.size()) && (stream == NULL); i++ )
{
if ( m_Streams[i]->GetStreamId() == uiStreamId )
{
@ -189,7 +189,7 @@ CPacketStream *CProtocol::GetStream(uint16 uiStreamId, const CIp *Ip)
void CProtocol::CheckStreamsTimeout(void)
{
for ( size_t i = 0; i < m_Streams.size(); i++ )
for ( unsigned int i = 0; i < m_Streams.size(); i++ )
{
// time out ?
m_Streams[i]->Lock();

@ -37,7 +37,7 @@
CProtocols::CProtocols()
{
for ( size_t i = 0; i < m_Protocols.size(); i++ )
for ( unsigned int i = 0; i < m_Protocols.size(); i++ )
{
m_Protocols[i] = NULL;
}
@ -50,7 +50,7 @@ CProtocols::~CProtocols()
{
m_Mutex.lock();
{
for ( size_t i = 0; i < m_Protocols.size(); i++ )
for ( unsigned int i = 0; i < m_Protocols.size(); i++ )
{
delete m_Protocols[i];
}
@ -107,7 +107,7 @@ void CProtocols::Close(void)
{
m_Mutex.lock();
{
for ( size_t i = 0; i < m_Protocols.size(); i++ )
for ( unsigned int i = 0; i < m_Protocols.size(); i++ )
{
m_Protocols[i]->Close();
}

@ -568,7 +568,7 @@ CPacketStream *CReflector::GetStream(char module)
bool CReflector::IsStreamOpen(const CDvHeaderPacket *DvHeader)
{
bool open = false;
for ( size_t i = 0; (i < m_Streams.size()) && !open; i++ )
for ( unsigned int i = 0; (i < m_Streams.size()) && !open; i++ )
{
open = ( (m_Streams[i].GetStreamId() == DvHeader->GetStreamId()) &&
(m_Streams[i].IsOpen()));
@ -579,7 +579,7 @@ bool CReflector::IsStreamOpen(const CDvHeaderPacket *DvHeader)
char CReflector::GetStreamModule(CPacketStream *stream)
{
char module = ' ';
for ( size_t i = 0; (i < m_Streams.size()) && (module == ' '); i++ )
for ( unsigned int i = 0; (i < m_Streams.size()) && (module == ' '); i++ )
{
if ( &(m_Streams[i]) == stream )
{

@ -48,7 +48,7 @@ protected:
// data
std::mutex m_Mutex;
std::condition_variable m_Condition;
size_t m_Count;
int m_Count;
};

@ -65,7 +65,7 @@ CTranscoder::~CTranscoder()
// close all streams
m_Mutex.lock();
{
for ( size_t i = 0; i < m_Streams.size(); i++ )
for ( unsigned int i = 0; i < m_Streams.size(); i++ )
{
delete m_Streams[i];
}
@ -120,7 +120,7 @@ void CTranscoder::Close(void)
// close all streams
m_Mutex.lock();
{
for ( size_t i = 0; i < m_Streams.size(); i++ )
for ( unsigned int i = 0; i < m_Streams.size(); i++ )
{
delete m_Streams[i];
}
@ -271,7 +271,7 @@ void CTranscoder::ReleaseStream(CCodecStream *stream)
bool found = false;
Lock();
{
for ( size_t i = 0; (i < m_Streams.size()) && !found; i++ )
for ( unsigned int i = 0; (i < m_Streams.size()) && !found; i++ )
{
// compare object pointers
if ( (m_Streams[i]) == stream )

@ -69,7 +69,7 @@ void CUsers::Hearing(const CCallsign &my, const CCallsign &rpt1, const CCallsign
// first check if we have this user listed yet
bool found = false;
for ( size_t i = 0; (i < m_Users.size()) && !found; i++ )
for ( unsigned int i = 0; (i < m_Users.size()) && !found; i++ )
{
found = (m_Users[i] == heard);
if ( found )

@ -45,7 +45,7 @@ CXlxPeer::CXlxPeer(const CCallsign &callsign, const CIp &ip, char *modules, cons
//std::cout << "Adding XLX peer with protocol revision " << protrev << std::endl;
// and construct all xlx clients
for ( size_t i = 0; i < ::strlen(modules); i++ )
for ( unsigned int i = 0; i < ::strlen(modules); i++ )
{
// create
CXlxClient *client = new CXlxClient(callsign, ip, modules[i], protrev);
@ -57,7 +57,7 @@ CXlxPeer::CXlxPeer(const CCallsign &callsign, const CIp &ip, char *modules, cons
CXlxPeer::CXlxPeer(const CXlxPeer &peer)
: CPeer(peer)
{
for ( size_t i = 0; i < peer.m_Clients.size(); i++ )
for ( unsigned int i = 0; i < peer.m_Clients.size(); i++ )
{
CXlxClient *client = new CXlxClient((const CXlxClient &)*(peer.m_Clients[i]));
// grow vector capacity if needed

@ -381,7 +381,7 @@ void CXlxProtocol::HandlePeerLinks(void)
// check if all ours peers listed by gatekeeper are connected
// if not, connect or reconnect
for ( size_t i = 0; i < list->size(); i++ )
for ( unsigned int i = 0; i < list->size(); i++ )
{
CCallsignListItem *item = &((list->data())[i]);
if ( peers->FindPeer(item->GetCallsign(), PROTOCOL_XLX) == NULL )
@ -391,7 +391,7 @@ void CXlxProtocol::HandlePeerLinks(void)
// send connect packet to re-initiate peer link
EncodeConnectPacket(&buffer, item->GetModules());
m_Socket.Send(buffer, item->GetIp(), XLX_PORT);
std::cout << "Sending connect packet to XLX peer " << item->GetCallsign() << " @ " << item->GetIp() << " for modules " << item->GetModules() << std::endl;
/*std::cout << "Sending connect packet to XLX peer " << item->GetCallsign() << " @ " << item->GetIp() << " for modules " << item->GetModules() << std::endl;*/
}
}
@ -501,7 +501,7 @@ bool CXlxProtocol::IsValidConnectPacket(const CBuffer &Buffer, CCallsign *callsi
::strcpy(modules, (const char *)&(Buffer.data()[12]));
valid = callsign->IsValid();
*version = CVersion(Buffer.data()[9], Buffer.data()[10], Buffer.data()[11]);
for ( size_t i = 0; i < ::strlen(modules); i++ )
for ( unsigned int i = 0; i < ::strlen(modules); i++ )
{
valid &= IsLetter(modules[i]);
}
@ -529,7 +529,7 @@ bool CXlxProtocol::IsValidAckPacket(const CBuffer &Buffer, CCallsign *callsign,
::strcpy(modules, (const char *)&(Buffer.data()[12]));
valid = callsign->IsValid();
*version = CVersion(Buffer.data()[9], Buffer.data()[10], Buffer.data()[11]);
for ( size_t i = 0; i < ::strlen(modules); i++ )
for ( unsigned int i = 0; i < ::strlen(modules); i++ )
{
valid &= IsLetter(modules[i]);
}

@ -49,7 +49,7 @@
#define VERSION_MAJOR 2
#define VERSION_MINOR 2
#define VERSION_REVISION 2
#define VERSION_REVISION 3
// global ------------------------------------------------------
@ -115,7 +115,7 @@
#define TRANSCODER_PORT 10100 // UDP port
#define TRANSCODER_KEEPALIVE_PERIOD 5 // in seconds
#define TRANSCODER_KEEPALIVE_TIMEOUT 30 // in seconds
#define TRANSCODER_KEEPALIVE_TIMEOUT 15 // in seconds
#define TRANSCODER_AMBEPACKET_TIMEOUT 600 // in ms
// codec --------------------------------------------------------
@ -127,7 +127,7 @@
// DMRid database -----------------------------------------------
#define DMRIDDB_USE_RLX_SERVER 1 // 1 = use http, 0 = use local file
#define DMRIDDB_USE_RLX_SERVER 0 // 1 = use http, 0 = use local file
#define DMRIDDB_PATH "/xlxd/dmrid.dat" // local file path
#define DMRIDDB_REFRESH_RATE 180 // in minutes
@ -163,8 +163,8 @@ typedef unsigned int uint;
////////////////////////////////////////////////////////////////////////////////////////
// macros
#define MIN(a,b) ((float)(a) < (float)(b))?(a):(b)
#define MAX(a,b) ((a) > (b))?(a):(b)
#define MIN(a, b) ((float)(a) < (float)(b))?(a):(b)
#define MAX(a, b) ((a) > (b))?(a):(b)
#define MAKEWORD(low, high) ((uint16)(((uint8)(low)) | (((uint16)((uint8)(high))) << 8)))
#define MAKEDWORD(low, high) ((uint32)(((uint16)(low)) | (((uint32)((uint16)(high))) << 16)))
#define LOBYTE(w) ((uint8)(uint16)(w & 0x00FF))

@ -14,7 +14,7 @@ $(EXECUTABLE): $(OBJECTS)
$(CXX) $(CXXFLAGS) -c -o $@ $<
clean:
$(RM) xlxd *.o *.d *.bak
$(RM) $(EXECUTABLE) *.o *.d *.bak
install:
mkdir -p /xlxd

Loading…
Cancel
Save

Powered by TurnKey Linux.