diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 4 | ||||
-rw-r--r-- | src/chanserv.c | 17 | ||||
-rw-r--r-- | src/core/cs_set.c | 3 | ||||
-rw-r--r-- | src/core/cs_xop.c | 2 | ||||
-rw-r--r-- | src/core/ns_alist.c | 2 | ||||
-rw-r--r-- | src/core/ns_status.c | 2 | ||||
-rw-r--r-- | src/core/os_news.c | 7 | ||||
-rw-r--r-- | src/memoserv.c | 6 | ||||
-rw-r--r-- | src/modules.c | 1 | ||||
-rw-r--r-- | src/nickserv.c | 33 | ||||
-rw-r--r-- | src/protocol/bahamut.c | 5 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 5 | ||||
-rw-r--r-- | src/protocol/ratbox.c | 4 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 7 |
14 files changed, 47 insertions, 51 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index c8afd91fd..cef77ec9d 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -38,7 +38,7 @@ BotInfo::BotInfo(const char *nnick) this->flags |= BI_GLOBAL; // If we're synchronised with the uplink already, call introduce_user() for this bot. - alog("serv_uplink is %p and status is %d", serv_uplink, serv_uplink ? serv_uplink->sync == SSYNC_DONE : 0); + alog("serv_uplink is %p and status is %d", static_cast<void *>(serv_uplink), serv_uplink ? serv_uplink->sync == SSYNC_DONE : 0); if (serv_uplink && serv_uplink->sync == SSYNC_DONE) ircdproto->SendClientIntroduction(this->nick, this->user, this->host, this->real, ircd->pseudoclient_mode, this->uid.c_str()); } @@ -72,7 +72,7 @@ BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const this->flags |= BI_GLOBAL; // If we're synchronised with the uplink already, call introduce_user() for this bot. - alog("serv_uplink is %p and status is %d", serv_uplink, serv_uplink ? serv_uplink->sync == SSYNC_DONE : 0); + alog("serv_uplink is %p and status is %d", static_cast<void *>(serv_uplink), serv_uplink ? serv_uplink->sync == SSYNC_DONE : 0); if (serv_uplink && serv_uplink->sync == SSYNC_DONE) ircdproto->SendClientIntroduction(this->nick, this->user, this->host, this->real, ircd->pseudoclient_mode, this->uid.c_str()); } diff --git a/src/chanserv.c b/src/chanserv.c index ea470e064..e12ad9b8c 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -132,12 +132,12 @@ class ChanServTimer : public Timer { private: std::string channel; - + public: ChanServTimer(long delay, const std::string &chan) : Timer(delay), channel(chan) { } - + void Tick(time_t ctime) { ChannelInfo *ci = cs_findchan(channel.c_str()); @@ -214,7 +214,7 @@ char *get_mlock_modes(ChannelInfo * ci, int complete) void get_chanserv_stats(long *nrec, long *memuse) { long count = 0, mem = 0; - int i, j; + unsigned i, j; ChannelInfo *ci; for (i = 0; i < 256; i++) { @@ -325,7 +325,8 @@ void chanserv(User * u, char *buf) void load_cs_dbase() { dbFILE *f; - int ver, i, j, c; + int ver, c; + unsigned i, j; ChannelInfo *ci, **last, *prev; int failed = 0; @@ -594,7 +595,7 @@ void load_cs_dbase() void save_cs_dbase() { dbFILE *f; - int i, j; + unsigned i, j; ChannelInfo *ci; static time_t lastwarn = 0; @@ -1133,7 +1134,7 @@ int check_kick(User * user, const char *chan, time_t chants) if (user->isSuperAdmin == 1) return 0; - /* We don't enforce services restrictions on clients on ulined services + /* We don't enforce services restrictions on clients on ulined services * as this will likely lead to kick/rejoin floods. ~ Viper */ if (is_ulined(user->server->name)) { return 0; @@ -1214,7 +1215,7 @@ int check_kick(User * user, const char *chan, time_t chants) { ircdproto->SendMode(findbot(s_ChanServ), chan, "+ntsi"); } - + t = new ChanServTimer(CSInhabit, chan); ci->flags |= CI_INHABIT; } @@ -1653,7 +1654,7 @@ ChannelInfo *makechan(const char *chan) int delchan(ChannelInfo * ci) { - int i; + unsigned i; NickCore *nc; User *u; struct u_chaninfolist *cilist, *cilist_next; diff --git a/src/core/cs_set.c b/src/core/cs_set.c index 1e36e859e..00d18a110 100644 --- a/src/core/cs_set.c +++ b/src/core/cs_set.c @@ -460,10 +460,9 @@ class CommandCSSet : public Command { if (stricmp(param, "ON") == 0) { if (!(ci->flags & CI_XOP)) { - int i; ChanAccess *access; - for (i = 0; i < ci->access.size(); i++) { + for (unsigned i = 0; i < ci->access.size(); i++) { access = ci->GetAccess(i); if (!access->in_use) continue; diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c index b83c44928..916792f8b 100644 --- a/src/core/cs_xop.c +++ b/src/core/cs_xop.c @@ -307,7 +307,7 @@ class XOPBase : public Command process_numlist(nick, NULL, xop_list_callback, u, ci, &sent_header, level, messages[XOP_LIST_HEADER]); else { - for (int i = 0; i < ci->access.size(); ++i) + for (unsigned i = 0; i < ci->access.size(); ++i) { ChanAccess *access = ci->GetAccess(i); if (nick && access->nc && !Anope::Match(access->nc->display, nick, false)) diff --git a/src/core/ns_alist.c b/src/core/ns_alist.c index c4bfa04c7..26b975525 100644 --- a/src/core/ns_alist.c +++ b/src/core/ns_alist.c @@ -39,7 +39,7 @@ class CommandNSAList : public Command int min_level = 0; int is_servadmin = u->nc->IsServicesOper(); - int lev_param = 0; + unsigned lev_param = 0; if (!is_servadmin) /* Non service admins can only see their own levels */ diff --git a/src/core/ns_status.c b/src/core/ns_status.c index d2f89dcb9..551a5421f 100644 --- a/src/core/ns_status.c +++ b/src/core/ns_status.c @@ -27,7 +27,7 @@ class CommandNSStatus : public Command { User *u2; NickAlias *na = NULL; - int i = 0; + unsigned i = 0; const char *nick = params.size() ? params[0].c_str() : NULL; /* If no nickname is given, we assume that the user diff --git a/src/core/os_news.c b/src/core/os_news.c index 81b46526b..3100ffcc0 100644 --- a/src/core/os_news.c +++ b/src/core/os_news.c @@ -84,8 +84,7 @@ struct newsmsgs msgarray[] = { static int *findmsgs(int16 type, const char **type_name) { - int i; - for (i = 0; i < lenof(msgarray); i++) { + for (unsigned i = 0; i < lenof(msgarray); i++) { if (msgarray[i].type == type) { if (type_name) *type_name = msgarray[i].name; @@ -151,7 +150,7 @@ class NewsBase : public Command CommandReturn DoDel(User *u, std::vector<ci::string> ¶ms, short type, int *msgs) { const char *text = params.size() > 1 ? params[1].c_str() : NULL; - int i, num; + int num; if (!text) this->OnSyntaxError(u); @@ -169,7 +168,7 @@ class NewsBase : public Command { notice_lang(s_OperServ, u, msgs[MSG_DELETED], num); /* Reset the order - #0000397 */ - for (i = 0; i < nnews; ++i) + for (int i = 0; i < nnews; ++i) { if (news[i].type == type && news[i].num > num) --news[i].num; diff --git a/src/memoserv.c b/src/memoserv.c index 7af1b0c18..aef802bc3 100644 --- a/src/memoserv.c +++ b/src/memoserv.c @@ -81,7 +81,7 @@ void memoserv(User * u, char *buf) void check_memos(User * u) { NickCore *nc; - int i, newcnt = 0; + unsigned i, newcnt = 0; if (!u) { if (debug) { @@ -254,7 +254,7 @@ void memo_send(User * u, const char *name, const char *text, int z) if (mi->memos.size() > 1) { m->number = mi->memos[mi->memos.size() - 2]->number + 1; if (m->number < 1) { - int i; + unsigned i; for (i = 0; i < mi->memos.size(); i++) { mi->memos[i]->number = i + 1; } @@ -333,7 +333,7 @@ void memo_send(User * u, const char *name, const char *text, int z) */ int delmemo(MemoInfo * mi, int num) { - int i; + unsigned i; if (mi->memos.empty()) return 0; for (i = 0; i < mi->memos.size(); i++) { diff --git a/src/modules.c b/src/modules.c index 6155fc25d..37510caf9 100644 --- a/src/modules.c +++ b/src/modules.c @@ -187,7 +187,6 @@ static int internal_addCommand(Module *m, CommandHash * cmdTable[], Command * c, CommandHash *current = NULL; CommandHash *newHash = NULL; CommandHash *lastHash = NULL; - Command *tail = NULL; if (!cmdTable || !c || (pos < 0 || pos > 2)) { return MOD_ERR_PARAMS; diff --git a/src/nickserv.c b/src/nickserv.c index 032d1fd4e..3cd25e671 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -41,12 +41,12 @@ class NickServCollide : public Timer { public: NickAlias *na; - + NickServCollide(NickAlias *nickalias, time_t delay) : Timer(delay), na(nickalias) { NickServCollides.insert(std::make_pair(nickalias, this)); } - + void Tick(time_t ctime) { /* If they identified or don't exist anymore, don't kill them. */ @@ -58,7 +58,7 @@ class NickServCollide : public Timer * triggered yet anyway. */ collide(na, 1); } - + static void ClearTimers(NickAlias *na) { std::map<NickAlias *, NickServCollide *>::iterator i = NickServCollides.find(na); @@ -79,12 +79,12 @@ class NickServRelease : public Timer public: NickAlias *na; std::string uid; - + NickServRelease(NickAlias *nickalias, time_t delay) : Timer(delay), na(nickalias) { NickServReleases.insert(std::make_pair(nickalias, this)); } - + void Tick(time_t ctime) { if (ircd->svshold) @@ -100,21 +100,21 @@ class NickServRelease : public Timer } na->status &= ~NS_KILL_HELD; } - + static void ClearTimers(NickAlias *na, bool dorelease = false) { std::map<NickAlias *, NickServRelease *>::iterator i = NickServReleases.find(na); NickServRelease *t; - + if (i != NickServReleases.end()) { t = i->second; NickServReleases.erase(i); - + if (dorelease) release(na, 1); - + TimerManager::DelTimer(t); } } @@ -164,7 +164,7 @@ void get_aliases_stats(long *nrec, long *memuse) void get_core_stats(long *nrec, long *memuse) { long count = 0, mem = 0; - int i, j; + unsigned i, j; NickCore *nc; for (i = 0; i < 1024; i++) @@ -303,7 +303,8 @@ void load_ns_req_db() void load_ns_dbase() { dbFILE *f; - int ver, i, j, c; + int ver, c; + unsigned i, j; NickAlias *na, **nalast, *naprev; NickCore *nc, **nclast, *ncprev; int failed = 0; @@ -487,7 +488,7 @@ void load_ns_dbase() void save_ns_dbase() { dbFILE *f; - int i, j; + unsigned i, j; NickAlias *na; NickCore *nc; static time_t lastwarn = 0; @@ -936,7 +937,7 @@ NickCore *findcore(const char *nick) int is_on_access(User * u, NickCore * nc) { - int i; + unsigned i; char *buf; char *buf2 = NULL; @@ -1117,7 +1118,7 @@ void change_core_display(NickCore * nc) static int delcore(NickCore * nc) { - int i; + unsigned i; User *user; FOREACH_MOD(I_OnDelCore, OnDelCore(nc)); @@ -1324,7 +1325,7 @@ void release(NickAlias * na, int from_timeout) NickServRelease::ClearTimers(na); if (ircd->svshold) - { + { ircdproto->SendSVSHoldDel(na->nick); } else @@ -1361,7 +1362,7 @@ void SetOperType(NickCore *nc) /* Nonexistant nick */ continue; } - + if (na->nc == nc) { for (std::list<OperType *>::iterator tit = MyOperTypes.begin(); tit != MyOperTypes.end(); ++tit) diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index e8be32ca9..050d37fb0 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -709,14 +709,13 @@ class BahamutIRCdProto : public IRCDProto void SetAutoIdentificationToken(User *u) { - int *c; - char svidbuf[15]; + char svidbuf[15], *c; if (!u->nc) return; srand(time(NULL)); - snprintf(svidbuf, sizeof(svidbuf), "%i", rand()); + snprintf(svidbuf, sizeof(svidbuf), "%d", rand()); if (u->nc->GetExt("authenticationtoken", c)) { diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 43369f4c3..846f3f6fc 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -678,13 +678,12 @@ class InspIRCdProto : public IRCDProto void SetAutoIdentificationToken(User *u) { - int *c; - char svidbuf[15]; + char svidbuf[15], *c; if (!u->nc) return; - snprintf(svidbuf, sizeof(svidbuf), "%ld", u->timestamp); + snprintf(svidbuf, sizeof(svidbuf), "%ld", static_cast<long>(u->timestamp)); if (u->nc->GetExt("authenticationtoken", c)) { diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index 7cb6cb884..d338277e9 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -688,8 +688,8 @@ class RatboxProto : public IRCDTS6Proto if (!u->nc) return; - - snprintf(svidbuf, sizeof(svidbuf), "%ld", u->timestamp); + + snprintf(svidbuf, sizeof(svidbuf), "%ld", static_cast<long>(u->timestamp)); if (u->nc->GetExt("authenticationtoken", c)) { diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 44752af7a..ee97a8ca6 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -902,14 +902,13 @@ class UnrealIRCdProto : public IRCDProto void SetAutoIdentificationToken(User *u) { - int *c; - char svidbuf[15]; + char svidbuf[15], *c; if (!u->nc) return; srand(time(NULL)); - snprintf(svidbuf, sizeof(svidbuf), "%i", rand()); + snprintf(svidbuf, sizeof(svidbuf), "%d", rand()); if (u->nc->GetExt("authenticationtoken", c)) { @@ -1479,7 +1478,7 @@ class ProtoUnreal : public Module pmodule_ircd_proto(&ircd_proto); moduleAddIRCDMsgs(); - + ModuleManager::Attach(I_OnDelCore, this); } |