diff options
-rw-r--r-- | src/commands.cpp | 2 | ||||
-rw-r--r-- | src/helperfuncs.cpp | 10 | ||||
-rw-r--r-- | src/inspircd.cpp | 6 | ||||
-rw-r--r-- | src/message.cpp | 14 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/commands.cpp b/src/commands.cpp index 6fe978514..7cdc534a2 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -958,7 +958,7 @@ void handle_who(char **parameters, int pcnt, userrec *user) { if ((!strcmp(parameters[0],"0")) || (!strcmp(parameters[0],"*"))) { - if ((user->chans.size()) (user->chans[0].channel)) + if ((user->chans.size()) && (user->chans[0].channel)) { int n_list = 0; for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index bbf224883..897f9f890 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -416,7 +416,7 @@ void WriteCommon(userrec *u, char* text, ...) bool sent_to_at_least_one = false; - for (int i = 0; i < u->chans.size(); i++) + for (unsigned int i = 0; i < u->chans.size(); i++) { if (u->chans[i].channel) { @@ -466,7 +466,7 @@ void WriteCommonExcept(userrec *u, char* text, ...) memset(&already_sent,0,65536); - for (int i = 0; i < u->chans.size(); i++) + for (unsigned int i = 0; i < u->chans.size(); i++) { if (u->chans[i].channel) { @@ -607,7 +607,7 @@ bool CommonOnThisServer(userrec* u,const char* servername) { log(DEBUG,"ChanAnyOnThisServer"); - for (int i = 0; i < u->chans[i].size(); i++) + for (unsigned int i = 0; i < u->chans.size(); i++) { if (u->chans[i].channel) { @@ -803,7 +803,7 @@ void purge_empty_chans(userrec* u) int go_again = 1, purge = 0; // firstly decrement the count on each channel - for (int f = 0; f < u->chans.size(); f++) + for (unsigned int f = 0; f < u->chans.size(); f++) { if (u->chans[f].channel) { @@ -811,7 +811,7 @@ void purge_empty_chans(userrec* u) } } - for (int i = 0; i < u->chans.size(); i++) + for (unsigned int i = 0; i < u->chans.size(); i++) { if (u->chans[i].channel) { diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 3a7695fd2..62731ecf9 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -716,7 +716,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri log(DEBUG,"Passed channel checks"); - for (int index =0; index < user->chans.size(); index++) + for (unsigned int index =0; index < user->chans.size(); index++) { log(DEBUG,"Check location %d",index); if (user->chans[index].channel == NULL) @@ -787,7 +787,7 @@ chanrec* del_channel(userrec *user, const char* cname, const char* reason, bool FOREACH_MOD OnUserPart(user,Ptr); log(DEBUG,"del_channel: removing: %s %s",user->nick,Ptr->name); - for (int i =0; i < user->chans.size(); i++) + for (unsigned int i =0; i < user->chans.size(); i++) { /* zap it from the channel list of the user */ if (user->chans[i].channel == Ptr) @@ -882,7 +882,7 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason) FOREACH_MOD OnUserKick(src,user,Ptr,reason); - for (int i =0; i < user->chans.size(); i++) + for (unsigned int i =0; i < user->chans.size(); i++) { /* zap it from the channel list of the user */ if (user->chans[i].channel) diff --git a/src/message.cpp b/src/message.cpp index bb49d48ca..79ea41f19 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -68,9 +68,9 @@ int common_channels(userrec *u, userrec *u2) log(DEFAULT,"*** BUG *** common_channels was given an invalid parameter"); return 0; } - for (int i = 0; i < u->chans.size(); i++) + for (unsigned int i = 0; i < u->chans.size(); i++) { - for (int z = 0; z != u2->chans.size(); z++) + for (unsigned int z = 0; z != u2->chans.size(); z++) { if ((u->chans[i].channel != NULL) && (u2->chans[z].channel != NULL)) { @@ -193,7 +193,7 @@ int CleanAndResolve (char *resolvedHost, const char *unresolvedHost) int c_count(userrec* u) { int z = 0; - for (int i =0; i < u->chans.size(); i++) + for (unsigned int i =0; i < u->chans.size(); i++) if (u->chans[i].channel != NULL) z++; return z; @@ -311,7 +311,7 @@ char* cmode(userrec *user, chanrec *chan) return ""; } - for (int i = 0; i < user->chans.size(); i++) + for (unsigned int i = 0; i < user->chans.size(); i++) { if (user->chans[i].channel) { @@ -351,7 +351,7 @@ int cstatus(userrec *user, chanrec *chan) if (is_uline(user->server)) return STATUS_OP; - for (int i = 0; i < user->chans.size(); i++) + for (unsigned int i = 0; i < user->chans.size(); i++) { if (user->chans[i].channel) { @@ -385,7 +385,7 @@ int has_channel(userrec *u, chanrec *c) log(DEFAULT,"*** BUG *** has_channel was given an invalid parameter"); return 0; } - for (int i =0; i < u->chans.size(); i++) + for (unsigned int i =0; i < u->chans.size(); i++) { if (u->chans[i].channel) { @@ -436,7 +436,7 @@ char* chlist(userrec *user,userrec* source) { return lst; } - for (int i = 0; i < user->chans.size(); i++) + for (unsigned int i = 0; i < user->chans.size(); i++) { if (user->chans[i].channel != NULL) { |