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

Fixed build errors and warnings with -std=c++11

This commit is contained in:
Adam
2012-10-30 17:09:30 -04:00
parent b07928eea9
commit 36f357c354
10 changed files with 28 additions and 36 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class HelpChannel : public Module
OnReload();
}
EventReturn OnChannelModeSet(Channel *c, User *setter, ChannelModeName Name, const Anope::string &param) anope_override
EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelModeName Name, const Anope::string &param) anope_override
{
if (Name == CMODE_OP && c && c->ci && c->name.equals_ci(this->HelpChan))
{
@@ -139,7 +139,7 @@ bool WebCPanel::ChanServ::Access::OnRequest(HTTPProvider *server, const Anope::s
return true;
}
std::set<Anope::string> WebCPanel::ChanServ::Access::GetData() anope_override
std::set<Anope::string> WebCPanel::ChanServ::Access::GetData()
{
std::set<Anope::string> v;
v.insert("channel");
@@ -73,7 +73,7 @@ bool WebCPanel::ChanServ::Akick::OnRequest(HTTPProvider *server, const Anope::st
return true;
}
std::set<Anope::string> WebCPanel::ChanServ::Akick::GetData() anope_override
std::set<Anope::string> WebCPanel::ChanServ::Akick::GetData()
{
std::set<Anope::string> v;
v.insert("channel");
@@ -128,7 +128,7 @@ bool WebCPanel::ChanServ::Set::OnRequest(HTTPProvider *server, const Anope::stri
return true;
}
std::set<Anope::string> WebCPanel::ChanServ::Set::GetData() anope_override
std::set<Anope::string> WebCPanel::ChanServ::Set::GetData()
{
std::set<Anope::string> v;
v.insert("channel");
+1 -1
View File
@@ -238,7 +238,7 @@ class BahamutIRCdProto : public IRCDProto
/*
Note: if the stamp is null 0, the below usage is correct of Bahamut
*/
void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf) anope_override
void SendSVSKillInternal(const BotInfo *source, User *user, const Anope::string &buf) anope_override
{
if (source)
UplinkSocket::Message(source) << "SVSKILL " << user->nick << " :" << buf;
-8
View File
@@ -138,14 +138,6 @@ class ngIRCdProto : public IRCDProto
UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :" << server->GetDescription();
}
void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf) anope_override
{
if (source)
UplinkSocket::Message(source) << "KILL " << user->nick << " :" << buf;
else
UplinkSocket::Message(Me) << "KILL " << user->nick << " :" << buf;
}
void SendTopic(BotInfo *bi, Channel *c) anope_override
{
UplinkSocket::Message(bi) << "TOPIC " << c->name << " :" << c->topic;
+1 -1
View File
@@ -126,7 +126,7 @@ class UnrealIRCdProto : public IRCDProto
UplinkSocket::Message() << "BD + G " << x->GetUser() << " " << x->GetHost() << " " << x->By << " " << Anope::CurTime + timeleft << " " << x->Created << " :" << x->GetReason();
}
void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf) anope_override
void SendSVSKillInternal(const BotInfo *source, User *user, const Anope::string &buf) anope_override
{
UplinkSocket::Message(source) << "h " << user->nick << " :" << buf;
}
+3 -3
View File
@@ -72,7 +72,7 @@ class MyMemoServService : public MemoServService
return MEMO_TOO_FAST;
else if (!mi->memomax)
return MEMO_TARGET_FULL;
else if (mi->memomax > 0 && mi->memos->size() >= mi->memomax)
else if (mi->memomax > 0 && mi->memos->size() >= static_cast<unsigned>(mi->memomax))
return MEMO_TARGET_FULL;
else if (mi->HasIgnore(sender))
return MEMO_SUCCESS;
@@ -147,9 +147,9 @@ class MyMemoServService : public MemoServService
++newcnt;
if (newcnt > 0)
u->SendMessage(ms, newcnt == 1 ? _("You have 1 new memo.") : _("You have %d new memos."), newcnt);
if (nc->memos.memomax > 0 && nc->memos.memos->size() >= nc->memos.memomax)
if (nc->memos.memomax > 0 && nc->memos.memos->size() >= static_cast<unsigned>(nc->memos.memomax))
{
if (nc->memos.memos->size() > nc->memos.memomax)
if (nc->memos.memos->size() > static_cast<unsigned>(nc->memos.memomax))
u->SendMessage(ms, _("You are over your maximum number of memos (%d). You will be unable to receive any new memos until you delete some of your current ones."), nc->memos.memomax);
else
u->SendMessage(ms, _("You have reached your maximum number of memos (%d). You will be unable to receive any new memos until you delete some of your current ones."), nc->memos.memomax);
+2 -2
View File
@@ -515,7 +515,7 @@ DNSManager::TCPSocket::Client::~Client()
delete packet;
}
void DNSManager::TCPSocket::Client::Reply(DNSPacket *p) anope_override
void DNSManager::TCPSocket::Client::Reply(DNSPacket *p)
{
delete packet;
packet = p;
@@ -573,7 +573,7 @@ DNSManager::TCPSocket::TCPSocket(const Anope::string &ip, int port) : Socket(-1,
{
}
ClientSocket *DNSManager::TCPSocket::OnAccept(int fd, const sockaddrs &addr) anope_override
ClientSocket *DNSManager::TCPSocket::OnAccept(int fd, const sockaddrs &addr)
{
return new Client(this, fd, addr);
}
+17 -17
View File
@@ -21,20 +21,20 @@
#include "servers.h"
#include "channels.h"
bool CoreIRCDMessageAway::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageAway::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
FOREACH_MOD(I_OnUserAway, OnUserAway(source.GetUser(), params.empty() ? "" : params[0]));
return true;
}
bool CoreIRCDMessageCapab::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageCapab::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
for (unsigned i = 0; i < params.size(); ++i)
Capab.insert(params[i]);
return true;
}
bool CoreIRCDMessageError::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageError::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
Log(LOG_TERMINAL) << "ERROR: " << params[0];
quitmsg = "Received ERROR from uplink: " + params[0];
@@ -42,7 +42,7 @@ bool CoreIRCDMessageError::Run(MessageSource &source, const std::vector<Anope::s
return true;
}
bool CoreIRCDMessageJoin::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageJoin::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
User *user = source.GetUser();
const Anope::string &channels = params[0];
@@ -95,7 +95,7 @@ bool CoreIRCDMessageJoin::Run(MessageSource &source, const std::vector<Anope::st
}
bool CoreIRCDMessageKick::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageKick::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
const Anope::string &channel = params[0];
const Anope::string &users = params[1];
@@ -113,7 +113,7 @@ bool CoreIRCDMessageKick::Run(MessageSource &source, const std::vector<Anope::st
return true;
}
bool CoreIRCDMessageKill::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageKill::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
User *u = finduser(params[0]);
BotInfo *bi;
@@ -135,7 +135,7 @@ bool CoreIRCDMessageKill::Run(MessageSource &source, const std::vector<Anope::st
}
/* XXX We should cache the file somewhere not open/read/close it on every request */
bool CoreIRCDMessageMOTD::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageMOTD::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
Server *s = Server::Find(params[0]);
if (s != Me)
@@ -160,7 +160,7 @@ bool CoreIRCDMessageMOTD::Run(MessageSource &source, const std::vector<Anope::st
return true;
}
bool CoreIRCDMessagePart::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessagePart::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
User *u = source.GetUser();
const Anope::string &reason = params.size() > 1 ? params[1] : "";
@@ -185,13 +185,13 @@ bool CoreIRCDMessagePart::Run(MessageSource &source, const std::vector<Anope::st
return true;
}
bool CoreIRCDMessagePing::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessagePing::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
ircdproto->SendPong(params.size() > 1 ? params[1] : Me->GetSID(), params[0]);
return true;
}
bool CoreIRCDMessagePrivmsg::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessagePrivmsg::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
const Anope::string &receiver = params[0];
Anope::string message = params[1];
@@ -262,7 +262,7 @@ bool CoreIRCDMessagePrivmsg::Run(MessageSource &source, const std::vector<Anope:
return true;
}
bool CoreIRCDMessageQuit::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageQuit::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
const Anope::string &reason = params[0];
User *user = source.GetUser();
@@ -281,7 +281,7 @@ bool CoreIRCDMessageQuit::Run(MessageSource &source, const std::vector<Anope::st
return true;
}
bool CoreIRCDMessageSQuit::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageSQuit::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
Server *s = Server::Find(params[0]);
@@ -298,7 +298,7 @@ bool CoreIRCDMessageSQuit::Run(MessageSource &source, const std::vector<Anope::s
return true;
}
bool CoreIRCDMessageStats::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageStats::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
User *u = source.GetUser();
@@ -349,7 +349,7 @@ bool CoreIRCDMessageStats::Run(MessageSource &source, const std::vector<Anope::s
return true;
}
bool CoreIRCDMessageTime::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageTime::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
time_t t;
time(&t);
@@ -360,7 +360,7 @@ bool CoreIRCDMessageTime::Run(MessageSource &source, const std::vector<Anope::st
return true;
}
bool CoreIRCDMessageTopic::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageTopic::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
Channel *c = findchan(params[0]);
if (c)
@@ -369,14 +369,14 @@ bool CoreIRCDMessageTopic::Run(MessageSource &source, const std::vector<Anope::s
return true;
}
bool CoreIRCDMessageVersion::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageVersion::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
Module *enc = ModuleManager::FindFirstOf(ENCRYPTION);
ircdproto->SendNumeric(351, source.GetSource(), "Anope-%s %s :%s -(%s) -- %s", Anope::Version().c_str(), Config->ServerName.c_str(), ircdproto->GetProtocolName().c_str(), enc ? enc->name.c_str() : "unknown", Anope::VersionBuildString().c_str());
return true;
}
bool CoreIRCDMessageWhois::Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
bool CoreIRCDMessageWhois::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
User *u = finduser(params[0]);