OCT 1. 修正代码检查警告

This commit is contained in:
huangxin 2023-01-28 16:09:12 +08:00
parent 3cbbb839a6
commit a62f7436a8
2 changed files with 78 additions and 87 deletions

View File

@ -298,7 +298,7 @@ int dhcpd_main(int daemon, const char *pInifile, const char *pStatusFile, const
}
#endif
verbatim = (daemon > 0) ? true : false;
verbatim = (daemon > 0);
if (pInifile && strlen(pInifile) > 0) {
strcpy(iniFile, pInifile);

View File

@ -1,4 +1,6 @@
#pragma clang diagnostic push
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
#pragma ide diagnostic ignored "OCUnusedMacroInspection"
#pragma ide diagnostic ignored "cppcoreguidelines-pro-type-member-init"
/**************************************************************************
* Copyright (C) 2005 by Achal Dhir *
@ -132,6 +134,7 @@ enum {
QTYPE_CHILDZONE
};
#if 0
struct data10 {
char zone[256];
MYWORD zLen;
@ -149,6 +152,7 @@ struct data16 {
char wildcard[256];
MYDWORD ip;
};
#endif
struct data7 //cache
{
@ -209,10 +213,12 @@ struct data71 //Lump
typedef std::map<string, data7 *> dhcpMap;
#if 0
struct data11 {
char hostname[256];
MYWORD pref;
};
#endif
struct ConnType {
SOCKET sock;
@ -704,7 +710,6 @@ bool isInt(char *);
bool isIP(char *);
FILE *openSection(const char *, MYBYTE);
MYBYTE pIP(void *, MYDWORD);
MYBYTE pInt(void *, MYDWORD);
MYBYTE pUInt(void *raw, MYDWORD data);
MYBYTE pUShort(void *, MYWORD);
MYBYTE addServer(MYDWORD *, MYBYTE, MYDWORD);
@ -716,16 +721,12 @@ char *getHexValue(MYBYTE *, char *, MYBYTE *);
char *genHostName(char *, const MYBYTE *, MYBYTE);
char *hex2String(char *, const MYBYTE *, MYBYTE);
char *IP2String(char *, MYDWORD);
char *IP2arpa(char *, MYDWORD);
char *IP62String(char *, MYBYTE *);
char *myUpper(char *string);
char *myLower(char *string);
char *readSection(char *, FILE *);
data7 *findDHCPEntry(char *);
data7 *createCache(data71 *pLump);
MYDWORD alad(data9 *);
MYDWORD calcMask(MYDWORD, MYDWORD);
MYDWORD chaddr(data9 *);
MYDWORD resad(data9 *);
MYDWORD sdmess(data9 *);
MYDWORD sendRepl(data9 *req);
@ -737,12 +738,9 @@ void addUserClass(MYBYTE rangeSetInd, char *userClass, MYBYTE userClassS
void addMacRange(MYBYTE rangeSetInd, char *macRange);
void addOptions(data9 *req);
void calcRangeLimits(MYDWORD, MYDWORD, MYDWORD *, MYDWORD *);
void catch_int(int sig_num);
void checkSize(MYBYTE);
void closeConn();
void debug(const char *mess, int i);
bool getInterfaces(data1 *pNetwork);
void getSecondary();
void *init(void *);
void lockOptions(FILE *);
void loadOptions(FILE *, const char *, data20 *);
@ -751,9 +749,7 @@ void *sendHTTP(void *);
void procHTTP(data19 *);
void pvdata(data9 *, data3 *);
void recvRepl(data9 *);
void runProg();
void lockIP(MYDWORD);
void sendScopeStatus(data19 *req);
void sendStatus(data19 *req);
void setTempLease(data7 *);
void setLeaseExpiry(data7 *);
@ -762,11 +758,8 @@ void *updateStateFile(void *);
MYWORD fUShort(void *);
MYWORD gdmess(data9 *, MYBYTE);
MYWORD myTokenize(char *, char *, const char *, bool);
MYWORD pQu(char *, char *);
MYWORD qLen(char *);
MYDWORD fIP(void *raw);
MYDWORD fUInt(void *raw);
const char *getRequestMethod(const char *buffer);
void prepareUserHtmlRespStatus(data19 *req);
void opendhcp_init_http_server();
void opendhcp_set_replication_svr();
@ -775,8 +768,6 @@ void opendhcp_add_mac_filter();
int process_iptv_multicast(const unsigned char *p, int size, const char *mac);
int opendhcp_add_listener();
unsigned int opendhcp_set_lease_time();
void sendUserList(data19 *req, const char *pRequest, dhcpMap *dhcpCache, data2 *cfig, time_t t);
void sendAllLists(data19 *req, bool kRunning, dhcpMap *dhcpCache, data2 *cfig);
int getHwAddr(char *buff, char *mac);
int arpSet(const char *ifname, char *ipStr, char *mac);
sockaddr_in get_cliAddr(char *nicif, char *tempbuff, data9 *req);