From f96ddd39748f283768217fb1a3cdd3a7cbde353a Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 30 May 2005 22:36:08 +0000 Subject: Started on -Wall - safe compile git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1570 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_filter_pcre.cpp | 4 ++-- src/modules/extra/m_sqlauth.cpp | 2 +- src/modules/extra/m_sqloper.cpp | 4 ++-- src/modules/m_alias.cpp | 2 +- src/modules/m_antibottler.cpp | 4 ++-- src/modules/m_chanfilter.cpp | 6 +++--- src/modules/m_chanprotect.cpp | 6 +++--- src/modules/m_chghost.cpp | 2 +- src/modules/m_helpop.cpp | 2 +- src/modules/m_hostchange.cpp | 2 +- src/modules/m_ident.cpp | 1 + src/modules/m_park.cpp | 2 +- src/modules/m_remove.cpp | 2 +- src/modules/m_sajoin.cpp | 3 +-- src/modules/m_sapart.cpp | 2 +- src/modules/m_sethost.cpp | 2 +- 16 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/modules') diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index 2619b7b21..0cc7fcc26 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -90,7 +90,7 @@ class ModuleFilterPCRE : public Module virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text) { - for (int index = 0; index < filters.size(); index++) + for (unsigned int index = 0; index < filters.size(); index++) { if (pcre_exec(filters[index],NULL,text.c_str(),text.length(),0,0,NULL,0) > -1) { @@ -137,7 +137,7 @@ class ModuleFilterPCRE : public Module virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text) { - for (int index = 0; index < filters.size(); index++) + for (unsigned int index = 0; index < filters.size(); index++) { if (pcre_exec(filters[index],NULL,text.c_str(),text.length(),0,0,NULL,0) > -1) { diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp index 16274de26..d6a6b5e81 100644 --- a/src/modules/extra/m_sqlauth.cpp +++ b/src/modules/extra/m_sqlauth.cpp @@ -106,7 +106,7 @@ class ModuleSQLAuth : public Module // sanitize the password (we dont want any mysql insertion exploits!) std::string temp = ""; - for (int q = 0; q < password.length(); q++) + for (unsigned int q = 0; q < password.length(); q++) { if (password[q] == '\'') { diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index 70e971aae..9ccfd7a29 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -89,7 +89,7 @@ class ModuleSQLOper : public Module // sanitize the password (we dont want any mysql insertion exploits!) std::string temp = ""; - for (int q = 0; q < password.length(); q++) + for (unsigned int q = 0; q < password.length(); q++) { if (password[q] == '\'') { @@ -103,7 +103,7 @@ class ModuleSQLOper : public Module } password = temp; temp = ""; - for (int v = 0; v < username.length(); v++) + for (unsigned int v = 0; v < username.length(); v++) { if (username[v] == '\'') { diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index b5f62f584..9bb2a9df2 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -89,7 +89,7 @@ class ModuleAlias : public Module strncpy(data,raw.c_str(),MAXBUF); char* dptr = data; - for (int i = 0; i < Aliases.size(); i++) + for (unsigned int i = 0; i < Aliases.size(); i++) { if (!strncasecmp(Aliases[i].text.c_str(),data,Aliases[i].text.length())) { diff --git a/src/modules/m_antibottler.cpp b/src/modules/m_antibottler.cpp index 8351969e9..8c456bdfb 100644 --- a/src/modules/m_antibottler.cpp +++ b/src/modules/m_antibottler.cpp @@ -52,7 +52,7 @@ class ModuleAntiBottler : public Module bool not_bottler = false; if (!strncmp(data,"user ",5)) { - for (int j = 0; j < strlen(data); j++) + for (unsigned int j = 0; j < strlen(data); j++) { if (data[j] == ':') break; @@ -73,7 +73,7 @@ class ModuleAntiBottler : public Module char *remote = strtok(NULL," :"); if (!strlen(data)) return; char *gecos = strtok(NULL,"\r\n"); - for (int j = 0; j < strlen(remote); j++) + for (unsigned int j = 0; j < strlen(remote); j++) { if (((remote[j] < '0') || (remote[j] > '9')) && (remote[j] != '.')) { diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index 1d10bcd08..e8abd91a3 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -89,7 +89,7 @@ class ModuleChanFilter : public Module { char buffer[MAXBUF]; strlcpy(buffer,text.c_str(),MAXBUF); - for (int j = 0; j < strlen(buffer); j++) + for (unsigned int j = 0; j < strlen(buffer); j++) buffer[j] = tolower(buffer[j]); SpamList* spamlist = (SpamList*)chan->GetExt("spam_list"); if (spamlist) @@ -130,7 +130,7 @@ class ModuleChanFilter : public Module { chanrec* chan = (chanrec*)target; - for (int j = 0; j < params[0].length(); j++) + for (unsigned int j = 0; j < params[0].length(); j++) params[0][j] = tolower(params[0][j]); std::string param = params[0]; @@ -143,7 +143,7 @@ class ModuleChanFilter : public Module spamlist = new SpamList; chan->Extend("spam_list",(char*)spamlist); } - if (spamlist->size() < MaxEntries) + if (spamlist->size() < (unsigned)MaxEntries) { for (SpamList::iterator i = spamlist->begin(); i != spamlist->end(); i++) { diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 8cf91d45c..2bb446676 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -300,7 +300,7 @@ class ModuleChanProtect : public Module if (mode == 'q') { chanuserlist cl = Srv->GetUsers(channel); - for (int i = 0; i < cl.size(); i++) + for (unsigned int i = 0; i < cl.size(); i++) { if (cl[i]->GetExt("cm_founder_"+std::string(channel->name))) { @@ -312,7 +312,7 @@ class ModuleChanProtect : public Module if (mode == 'a') { chanuserlist cl = Srv->GetUsers(channel); - for (int i = 0; i < cl.size(); i++) + for (unsigned int i = 0; i < cl.size(); i++) { if (cl[i]->GetExt("cm_protect_"+std::string(channel->name))) { @@ -342,7 +342,7 @@ class ModuleChanProtect : public Module // know whos +q/+a on the channel. chanuserlist cl = Srv->GetUsers(chan); string_list commands; - for (int i = 0; i < cl.size(); i++) + for (unsigned int i = 0; i < cl.size(); i++) { if (cl[i]->GetExt("cm_founder_"+std::string(chan->name))) { diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index e1cc5a8cb..f786a9f30 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -28,7 +28,7 @@ Server *Srv; void handle_chghost(char **parameters, int pcnt, userrec *user) { - for (int x = 0; x < strlen(parameters[1]); x++) + for (unsigned int x = 0; x < strlen(parameters[1]); x++) { if (((tolower(parameters[1][x]) < 'a') || (tolower(parameters[1][x]) > 'z')) && (parameters[1][x] != '.')) { diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 7331db0a8..8df47ce3d 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -98,7 +98,7 @@ bool do_helpop(char **parameters, int pcnt, userrec *src) // case sensitive char lower[MAXBUF]; strlcpy(lower,search,MAXBUF); - for (int t = 0; t < strlen(lower); t++) + for (unsigned int t = 0; t < strlen(lower); t++) lower[t] = tolower(lower[t]); diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index 36cd3ea70..a3e839cad 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -84,7 +84,7 @@ class ModuleHostChange : public Module // first take their nick and strip out non-dns, leaving just [A-Z0-9\-] std::string complete = ""; std::string old = user->nick; - for (int j = 0; j < old.length(); j++) + for (unsigned int j = 0; j < old.length(); j++) { if (((old[j] >= 'A') && (old[j] <= 'Z')) || ((old[j] >= 'a') && (old[j] <= 'z')) || diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 6bbc58e97..45be7e874 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -237,6 +237,7 @@ class RFC1413 break; } } + return true; } // returns true if the operation is completed, diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp index 28733298f..8ceb54715 100644 --- a/src/modules/m_park.cpp +++ b/src/modules/m_park.cpp @@ -229,7 +229,7 @@ class ModulePark : public Module awaylog* awy = (awaylog*)dest->GetExt("park_awaylog"); if (awy) { - if (awy->size() <= ParkMaxMsgs) + if (awy->size() <= (unsigned)ParkMaxMsgs) { awaymsg am; am.text = text; diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index da4fc49d7..fafbff877 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -65,7 +65,7 @@ void handle_remove(char **parameters, int pcnt, userrec *user) /* If the target nick exists... */ if (target && channel) { - for (int x = 0; x < strlen(parameters[1]); x++) + for (unsigned int x = 0; x < strlen(parameters[1]); x++) { if ((parameters[1][0] != '#') || (parameters[1][x] == ' ') || (parameters[1][x] == ',')) { diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 038d511f6..76c568ea7 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -31,8 +31,7 @@ void handle_sajoin(char **parameters, int pcnt, userrec *user) userrec* dest = Srv->FindNick(std::string(parameters[0])); if (dest) { - - for (int x = 0; x < strlen(parameters[1]); x++) + for (unsigned int x = 0; x < strlen(parameters[1]); x++) { if ((parameters[1][0] != '#') || (parameters[1][x] == ' ') || (parameters[1][x] == ',')) { diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 4c7927a64..a403accc7 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -31,7 +31,7 @@ void handle_sapart(char **parameters, int pcnt, userrec *user) userrec* dest = Srv->FindNick(std::string(parameters[0])); if (dest) { - for (int x = 0; x < strlen(parameters[1]); x++) + for (unsigned int x = 0; x < strlen(parameters[1]); x++) { if ((parameters[1][0] != '#') || (parameters[1][x] == ' ') || (parameters[1][x] == ',')) { diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index c064bbe0b..d4f8a4f1d 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -29,7 +29,7 @@ Server *Srv; void handle_sethost(char **parameters, int pcnt, userrec *user) { - for (int x = 0; x < strlen(parameters[0]); x++) + for (unsigned int x = 0; x < strlen(parameters[0]); x++) { if (((tolower(parameters[0][x]) < 'a') || (tolower(parameters[0][x]) > 'z')) && (parameters[0][x] != '.')) { -- cgit v1.2.3