diff options
Diffstat (limited to 'src/module.cpp')
-rw-r--r-- | src/module.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/module.cpp b/src/module.cpp index b30e2b6a7..df50b63d1 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -4,29 +4,26 @@ * Contact us at team@anope.org * * Please read COPYING and README for further details. - * - * */ + #include "modules.h" #include "language.h" #include "version.h" Module::Module(const std::string &mname, const std::string &creator) { - this->name = mname; /* Our name */ + this->name = mname; /* Our name */ this->type = THIRD; this->handle = NULL; this->permanent = false; - for (int i = 0; i < NUM_LANGS; i++) - { + for (int i = 0; i < NUM_LANGS; ++i) this->lang[i].argc = 0; - } if (FindModule(this->name)) throw CoreException("Module already exists!"); - + this->created = time(NULL); Modules.push_back(this); @@ -36,7 +33,7 @@ Module::~Module() { int i = 0; - for (i = 0; i < NUM_LANGS; i++) + for (i = 0; i < NUM_LANGS; ++i) this->DeleteLanguage(i); remove(this->filename.c_str()); @@ -49,7 +46,7 @@ Module::~Module() **/ if (HostServ) { - for (std::map<ci::string, Command *>::iterator it = HostServ->Commands.begin(); it != HostServ->Commands.end();) + for (std::map<ci::string, Command *>::iterator it = HostServ->Commands.begin(), it_end = HostServ->Commands.end(); it != it_end; ) { Command *c = it->second; ++it; @@ -61,7 +58,7 @@ Module::~Module() if (BotServ) { - for (std::map<ci::string, Command *>::iterator it = BotServ->Commands.begin(); it != BotServ->Commands.end();) + for (std::map<ci::string, Command *>::iterator it = BotServ->Commands.begin(), it_end = BotServ->Commands.end(); it != it_end; ) { Command *c = it->second; ++it; @@ -73,7 +70,7 @@ Module::~Module() if (MemoServ) { - for (std::map<ci::string, Command *>::iterator it = MemoServ->Commands.begin(); it != MemoServ->Commands.end();) + for (std::map<ci::string, Command *>::iterator it = MemoServ->Commands.begin(), it_end = MemoServ->Commands.end(); it != it_end; ) { Command *c = it->second; ++it; @@ -85,7 +82,7 @@ Module::~Module() if (NickServ) { - for (std::map<ci::string, Command *>::iterator it = NickServ->Commands.begin(); it != NickServ->Commands.end();) + for (std::map<ci::string, Command *>::iterator it = NickServ->Commands.begin(), it_end = NickServ->Commands.end(); it != it_end; ) { Command *c = it->second; ++it; @@ -94,10 +91,10 @@ Module::~Module() this->DelCommand(NickServ, c); } } - + if (ChanServ) { - for (std::map<ci::string, Command *>::iterator it = ChanServ->Commands.begin(); it != ChanServ->Commands.end();) + for (std::map<ci::string, Command *>::iterator it = ChanServ->Commands.begin(), it_end = ChanServ->Commands.end(); it != it_end; ) { Command *c = it->second; ++it; @@ -109,7 +106,7 @@ Module::~Module() if (OperServ) { - for (std::map<ci::string, Command *>::iterator it = OperServ->Commands.begin(); it != OperServ->Commands.end();) + for (std::map<ci::string, Command *>::iterator it = OperServ->Commands.begin(), it_end = OperServ->Commands.end(); it != it_end; ) { Command *c = it->second; ++it; @@ -119,7 +116,7 @@ Module::~Module() } } - for (std::deque<Module *>::iterator it = Modules.begin(); it != Modules.end(); ++it) + for (std::deque<Module *>::iterator it = Modules.begin(), it_end = Modules.end(); it != it_end; ++it) { if (*it == this) { |