Fix network ports datatype (unsigned int -> unsigned short). UDPSocket: fix old bug using m_port instead of m_port[x].

This commit is contained in:
Daniel Caujolle-Bert
2021-04-25 07:51:01 +02:00
parent 7b1ba5d849
commit ee2d6fd488
23 changed files with 98 additions and 96 deletions
+12 -12
View File
@@ -141,9 +141,9 @@ bool CConf::read()
} else if (::strcmp(key, "RptAddress") == 0)
m_rptAddress = value;
else if (::strcmp(key, "RptPort") == 0)
m_rptPort = (unsigned int)::atoi(value);
m_rptPort = (unsigned short)::atoi(value);
else if (::strcmp(key, "LocalPort") == 0)
m_myPort = (unsigned int)::atoi(value);
m_myPort = (unsigned short)::atoi(value);
else if (::strcmp(key, "Debug") == 0)
m_debug = ::atoi(value) == 1;
else if (::strcmp(key, "Daemon") == 0)
@@ -173,7 +173,7 @@ bool CConf::read()
m_logFileRotate = ::atoi(value) == 1;
} else if (section == SECTION_NETWORK) {
if (::strcmp(key, "Port") == 0)
m_networkPort = (unsigned int)::atoi(value);
m_networkPort = (unsigned short)::atoi(value);
else if (::strcmp(key, "HostsFile1") == 0)
m_networkHosts1 = value;
else if (::strcmp(key, "HostsFile2") == 0)
@@ -183,11 +183,11 @@ bool CConf::read()
else if (::strcmp(key, "ParrotAddress") == 0)
m_networkParrotAddress = value;
else if (::strcmp(key, "ParrotPort") == 0)
m_networkParrotPort = (unsigned int)::atoi(value);
m_networkParrotPort = (unsigned short)::atoi(value);
else if (::strcmp(key, "P252DMRAddress") == 0)
m_networkP252DMRAddress = value;
else if (::strcmp(key, "P252DMRPort") == 0)
m_networkP252DMRPort = (unsigned int)::atoi(value);
m_networkP252DMRPort = (unsigned short)::atoi(value);
else if (::strcmp(key, "Static") == 0) {
char* p = ::strtok(value, ",\r\n");
while (p != NULL) {
@@ -205,7 +205,7 @@ bool CConf::read()
if (::strcmp(key, "Enable") == 0)
m_remoteCommandsEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Port") == 0)
m_remoteCommandsPort = (unsigned int)::atoi(value);
m_remoteCommandsPort = (unsigned short)::atoi(value);
}
}
@@ -224,12 +224,12 @@ std::string CConf::getRptAddress() const
return m_rptAddress;
}
unsigned int CConf::getRptPort() const
unsigned short CConf::getRptPort() const
{
return m_rptPort;
}
unsigned int CConf::getMyPort() const
unsigned short CConf::getMyPort() const
{
return m_myPort;
}
@@ -294,7 +294,7 @@ bool CConf::getLogFileRotate() const
return m_logFileRotate;
}
unsigned int CConf::getNetworkPort() const
unsigned short CConf::getNetworkPort() const
{
return m_networkPort;
}
@@ -319,7 +319,7 @@ std::string CConf::getNetworkParrotAddress() const
return m_networkParrotAddress;
}
unsigned int CConf::getNetworkParrotPort() const
unsigned short CConf::getNetworkParrotPort() const
{
return m_networkParrotPort;
}
@@ -329,7 +329,7 @@ std::string CConf::getNetworkP252DMRAddress() const
return m_networkP252DMRAddress;
}
unsigned int CConf::getNetworkP252DMRPort() const
unsigned short CConf::getNetworkP252DMRPort() const
{
return m_networkP252DMRPort;
}
@@ -359,7 +359,7 @@ bool CConf::getRemoteCommandsEnabled() const
return m_remoteCommandsEnabled;
}
unsigned int CConf::getRemoteCommandsPort() const
unsigned short CConf::getRemoteCommandsPort() const
{
return m_remoteCommandsPort;
}