diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-10 23:27:00 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-10 23:27:00 +0000 |
commit | f9e7760a235ae07f4bbe7193bc8c9212bd5eee7d (patch) | |
tree | c7d4c244e543ca01fe8cb9dc44123c1d73f2c602 | |
parent | 53e79c21557ee8024936977caebda17634dd1b07 (diff) |
Fixed compile errors in os_shutdown and os_sqline.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1995 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | include/extern.h | 2 | ||||
-rw-r--r-- | src/core/os_shutdown.c | 2 | ||||
-rw-r--r-- | src/core/os_sqline.c | 15 | ||||
-rw-r--r-- | src/operserv.c | 2 |
4 files changed, 9 insertions, 12 deletions
diff --git a/include/extern.h b/include/extern.h index 77f9d7949..3fd628d60 100644 --- a/include/extern.h +++ b/include/extern.h @@ -785,7 +785,7 @@ E int add_sgline(User *u, const char *mask, const char *by, time_t expires, cons E int check_sgline(const char *nick, const char *realname); E void expire_sglines(); -E int add_sqline(User *u, char *mask, const char *by, const time_t expires, const char *reason); +E int add_sqline(User *u, const char *mask, const char *by, time_t expires, const char *reason); E int check_sqline(const char *nick, int nick_change); E void expire_sqlines(); E int check_chan_sqline(const char *chan); diff --git a/src/core/os_shutdown.c b/src/core/os_shutdown.c index 4dc8728e3..0125297bc 100644 --- a/src/core/os_shutdown.c +++ b/src/core/os_shutdown.c @@ -58,7 +58,7 @@ class OSShutdown : public Module this->SetVersion("$Id$"); this->SetType(CORE); - this->AddCommand(OPERSERV, c, MOD_UNIQUE); + this->AddCommand(OPERSERV, new CommandOSShutdown(), MOD_UNIQUE); this->SetOperHelp(myOperServHelp); } diff --git a/src/core/os_sqline.c b/src/core/os_sqline.c index 5a8f8f1af..6ddd09f57 100644 --- a/src/core/os_sqline.c +++ b/src/core/os_sqline.c @@ -26,7 +26,8 @@ class CommandOSSQLine : public Command private: CommandReturn DoAdd(User *u, std::vector<std::string> ¶ms) { - int deleted = 0, last_param = 2; + int deleted = 0; + unsigned last_param = 2; const char *expiry, *mask; char reason[BUFSIZE]; time_t expires; @@ -61,7 +62,7 @@ class CommandOSSQLine : public Command this->OnSyntaxError(u); return MOD_CONT; } - snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 ? " " : "", last_param == 2 ? param[3].c_str() : ""); + snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 ? " " : "", last_param == 2 ? params[3].c_str() : ""); if (mask && *reason) { /* We first do some sanity check on the proposed mask. */ @@ -94,7 +95,7 @@ class CommandOSSQLine : public Command else { int wall_expiry = expires - time(NULL); - char *s = NULL; + const char *s = NULL; if (wall_expiry >= 86400) { @@ -162,7 +163,7 @@ class CommandOSSQLine : public Command notice_lang(s_OperServ, u, OPER_SQLINE_DELETED_SEVERAL, res); } else { - if ((res = slist_indexof(&sqlines, mask)) == -1) + if ((res = slist_indexof(&sqlines, const_cast<char *>(mask))) == -1) { notice_lang(s_OperServ, u, OPER_SQLINE_NOT_FOUND, mask); return MOD_CONT; @@ -313,15 +314,11 @@ class OSSQLine : public Module public: OSSQLine(const std::string &modname, const std::string &creator) : Module(modname, creator) { - Command *c; - this->SetAuthor("Anope"); this->SetVersion("$Id$"); this->SetType(CORE); - c = createCommand("SQLINE", do_sqline, is_services_oper, - OPER_HELP_SQLINE, -1, -1, -1, -1); - this->AddCommand(OPERSERV, c, MOD_UNIQUE); + this->AddCommand(OPERSERV, new CommandOSSQLine(), MOD_UNIQUE); this->SetOperHelp(myOperServHelp); if (!ircd->sqline) diff --git a/src/operserv.c b/src/operserv.c index b17f895bc..51ddcfaa1 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -906,7 +906,7 @@ static int is_sgline_entry_equal(SList * slist, void *item1, void *item2) * The success result is the number of SQLINEs that were deleted to successfully add one. */ -int add_sqline(User * u, char *mask, const char *by, const time_t expires, +int add_sqline(User * u, const char *mask, const char *by, time_t expires, const char *reason) { int deleted = 0, i; |