remove some calls to strcmp()

dev
Tom Early 4 years ago
parent 9f725193e5
commit 2c509e87b1

@ -40,7 +40,7 @@
#include "DStarDecode.h"
#include "QnetDVRPTR.h"
#define DVRPTR_VERSION "QnetDVRPTR-20307"
#define DVRPTR_VERSION "QnetDVRPTR-20520"
#define BAUD B115200
#define IP_SIZE 15
@ -1949,7 +1949,7 @@ bool CQnetDVRPTR::check_serial()
char temp_dvrptr_serial[16];
sprintf(temp_dvrptr_serial, "%02X.%02X.%02X.%02X", puffer[4], puffer[5], puffer[6], puffer[7]);
printf("Device %s has serial=[%s]\n", dvrptr_device, temp_dvrptr_serial);
if (strcmp(temp_dvrptr_serial, DVRPTR_SERIAL.c_str()) == 0)
if (0 == DVRPTR_SERIAL.compare(temp_dvrptr_serial))
{
printf("Device %s serial number matches DVRPTR_SERIAL in dvrptr.cfg\n", dvrptr_device);
match = true;

@ -50,7 +50,7 @@
#include "QnetGateway.h"
#include "Utilities.h"
const std::string GW_VERSION("QnetGateway-20320");
const std::string GW_VERSION("QnetGateway-20520");
int CQnetGateway::FindIndex(const int i) const
{

@ -54,7 +54,7 @@
#include "QnetLink.h"
#include "Utilities.h"
#define LINK_VERSION "QnetLink-607"
#define LINK_VERSION "QnetLink-20520"
CQnetLink::CQnetLink()
{
@ -1308,7 +1308,7 @@ void CQnetLink::ProcessXRF(unsigned char *buf, const int length)
// delete the user if exists
for (auto dt_lh_pos = dt_lh_list.begin(); dt_lh_pos != dt_lh_list.end(); dt_lh_pos++)
{
if (0 == strcmp((char *)dt_lh_pos->second.c_str(), tmp1))
if (0 == dt_lh_pos->second.compare(tmp1))
{
dt_lh_list.erase(dt_lh_pos);
break;
@ -1651,7 +1651,7 @@ void CQnetLink::ProcessDCS(unsigned char *dcs_buf, const int length)
// delete the user if exists
for (auto dt_lh_pos=dt_lh_list.begin(); dt_lh_pos!=dt_lh_list.end(); dt_lh_pos++)
{
if (strcmp(dt_lh_pos->second.c_str(), tmp1) == 0)
if (dt_lh_pos->second.compare(tmp1) == 0)
{
dt_lh_list.erase(dt_lh_pos);
break;
@ -2552,7 +2552,7 @@ void CQnetLink::ProcessREF(unsigned char *buf, const int length)
// delete the user if exists
for (auto dt_lh_pos = dt_lh_list.begin(); dt_lh_pos != dt_lh_list.end(); dt_lh_pos++)
{
if (strcmp((char *)dt_lh_pos->second.c_str(), tmp1) == 0)
if (dt_lh_pos->second.compare(tmp1) == 0)
{
dt_lh_list.erase(dt_lh_pos);
break;
@ -2893,7 +2893,7 @@ void CQnetLink::Process()
// delete the user if exists
for (auto dt_lh_pos=dt_lh_list.begin(); dt_lh_pos!=dt_lh_list.end(); dt_lh_pos++)
{
if (strcmp(dt_lh_pos->second.c_str(), tmp1) == 0)
if (dt_lh_pos->second.compare(tmp1) == 0)
{
dt_lh_list.erase(dt_lh_pos);
break;
@ -3357,7 +3357,7 @@ void CQnetLink::Process()
char tmp2[36];
for (auto dt_lh_pos = dt_lh_list.begin(); dt_lh_pos != dt_lh_list.end(); dt_lh_pos++)
{
if (strcmp((char *)dt_lh_pos->second.c_str(), tmp1) == 0)
if (dt_lh_pos->second.compare(tmp1) == 0)
{
strcpy(tmp2, (char *)dt_lh_pos->first.c_str());
p_tmp2 = strstr(tmp2, "=l");

@ -547,8 +547,7 @@ std::string IRCDDBApp::getTableIDString(int tableID, bool spaceBeforeNumber)
void IRCDDBApp::msgQuery(IRCMessage *m)
{
if (0 == strcmp(m->getPrefixNick().substr(0,2).c_str(), "s-") && (m->numParams >= 2)) // server msg
if (0==m->getPrefixNick().compare(0, 2, "s-") && m->numParams>1) // server msg
{
std::string msg = m->params[1];
std::vector<std::string> tkz = stringTokenizer(msg);

Loading…
Cancel
Save

Powered by TurnKey Linux.