1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 02:03:12 +02:00

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
This commit is contained in:
cyberbotx
2009-02-10 23:27:00 +00:00
parent 53e79c2155
commit f9e7760a23
4 changed files with 9 additions and 12 deletions
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
}
+6 -9
View File
@@ -26,7 +26,8 @@ class CommandOSSQLine : public Command
private:
CommandReturn DoAdd(User *u, std::vector<std::string> &params)
{
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)
+1 -1
View File
@@ -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;