1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 21:36:37 +02:00

Make functions that don't use this static.

This commit is contained in:
Sadie Powell
2024-02-27 10:40:23 +00:00
parent 73d4ac6de0
commit b5b3c74477
35 changed files with 61 additions and 61 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ class CommandBSInfo final
: public Command
{
private:
void send_bot_channels(std::vector<Anope::string> &buffers, const BotInfo *bi)
static void send_bot_channels(std::vector<Anope::string> &buffers, const BotInfo *bi)
{
Anope::string buf;
for (const auto &[_, ci] : *RegisteredChannelList)
+1 -1
View File
@@ -1091,7 +1091,7 @@ class BSKick final
}
}
void bot_kick(ChannelInfo *ci, User *u, const char *message, ...) ATTR_FORMAT(4, 5)
static void bot_kick(ChannelInfo *ci, User *u, const char *message, ...) ATTR_FORMAT(3, 4)
{
va_list args;
char buf[1024];
+1 -1
View File
@@ -713,7 +713,7 @@ class CommandCSLevels final
source.Reply(_("Setting \002%s\002 not known. Type \002%s%s HELP LEVELS\002 for a list of valid settings."), what.c_str(), Config->StrictPrivmsg.c_str(), source.service->nick.c_str());
}
void DoList(CommandSource &source, ChannelInfo *ci)
static void DoList(CommandSource &source, ChannelInfo *ci)
{
source.Reply(_("Access level settings for channel %s:"), ci->name.c_str());
+5 -5
View File
@@ -15,13 +15,13 @@
class CommandCSClone final
: public Command
{
void CopySetting(ChannelInfo *ci, ChannelInfo *target_ci, const Anope::string &setting)
static void CopySetting(ChannelInfo *ci, ChannelInfo *target_ci, const Anope::string &setting)
{
if (ci->HasExt(setting))
target_ci->Extend<bool>(setting);
}
void CopyAccess(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
static void CopyAccess(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
{
std::set<Anope::string> masks;
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1024");
@@ -58,7 +58,7 @@ class CommandCSClone final
source.Reply(_("%d access entries from \002%s\002 have been cloned to \002%s\002."), count, ci->name.c_str(), target_ci->name.c_str());
}
void CopyAkick(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
static void CopyAkick(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
{
target_ci->ClearAkick();
for (unsigned i = 0; i < ci->GetAkickCount(); ++i)
@@ -73,7 +73,7 @@ class CommandCSClone final
source.Reply(_("All akick entries from \002%s\002 have been cloned to \002%s\002."), ci->name.c_str(), target_ci->name.c_str());
}
void CopyBadwords(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
static void CopyBadwords(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
{
BadWords *target_badwords = target_ci->Require<BadWords>("badwords"),
*badwords = ci->Require<BadWords>("badwords");
@@ -98,7 +98,7 @@ class CommandCSClone final
source.Reply(_("All badword entries from \002%s\002 have been cloned to \002%s\002."), ci->name.c_str(), target_ci->name.c_str());
}
void CopyLevels(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
static void CopyLevels(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
{
for (const auto &[priv, level] : ci->GetLevelEntries())
{
+1 -1
View File
@@ -104,7 +104,7 @@ class CommandEntryMessage final
: public Command
{
private:
void DoList(CommandSource &source, ChannelInfo *ci)
static void DoList(CommandSource &source, ChannelInfo *ci)
{
EntryMessageList *messages = ci->Require<EntryMessageList>("entrymsg");
+1 -1
View File
@@ -294,7 +294,7 @@ class CommandCSFlags final
source.Reply(_("Flags for \002%s\002 on %s set to +\002%s\002"), access->Mask().c_str(), ci->name.c_str(), access->AccessSerialize().c_str());
}
void DoList(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
static void DoList(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
{
const Anope::string &arg = params.size() > 2 ? params[2] : "";
+1 -1
View File
@@ -247,7 +247,7 @@ Serializable *ModeLockImpl::Unserialize(Serializable *obj, Serialize::Data &data
class CommandCSMode final
: public Command
{
bool CanSet(CommandSource &source, ChannelInfo *ci, ChannelMode *cm, bool self)
static bool CanSet(CommandSource &source, ChannelInfo *ci, ChannelMode *cm, bool self)
{
if (!ci || !cm || cm->type != MODE_STATUS)
return false;
+2 -2
View File
@@ -185,7 +185,7 @@ public:
class CommandSeen final
: public Command
{
void SimpleSeen(CommandSource &source, const std::vector<Anope::string> &params)
static void SimpleSeen(CommandSource &source, const std::vector<Anope::string> &params)
{
if (!source.c || !source.c->ci)
{
@@ -440,7 +440,7 @@ public:
}
private:
void UpdateUser(const User *u, const TypeInfo Type, const Anope::string &nick, const Anope::string &nick2, const Anope::string &channel, const Anope::string &message)
static void UpdateUser(const User *u, const TypeInfo Type, const Anope::string &nick, const Anope::string &nick2, const Anope::string &channel, const Anope::string &message)
{
if (simple || !u->server->IsSynced())
return;
+2 -2
View File
@@ -14,7 +14,7 @@
class CommandCSUp final
: public Command
{
void SetModes(User *u, Channel *c)
static void SetModes(User *u, Channel *c)
{
if (!c->ci)
return;
@@ -133,7 +133,7 @@ public:
class CommandCSDown final
: public Command
{
void RemoveAll(User *u, Channel *c)
static void RemoveAll(User *u, Channel *c)
{
ChanUserContainer *cu = c->FindUser(u);
if (cu != NULL)
+2 -2
View File
@@ -189,14 +189,14 @@ class MChanstats final
sql->Run(&sqlinterface, q);
}
size_t CountWords(const Anope::string &msg)
static size_t CountWords(const Anope::string &msg)
{
size_t words = 0;
for (size_t pos = 0; pos != Anope::string::npos; pos = msg.find(" ", pos+1))
words++;
return words;
}
size_t CountSmileys(const Anope::string &msg, const Anope::string &smileylist)
static size_t CountSmileys(const Anope::string &msg, const Anope::string &smileylist)
{
size_t smileys = 0;
spacesepstream sep(smileylist);
+2 -2
View File
@@ -31,7 +31,7 @@ class Packet final
return name.find_first_not_of("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-") == Anope::string::npos;
}
void PackName(unsigned char *output, unsigned short output_size, unsigned short &pos, const Anope::string &name)
static void PackName(unsigned char *output, unsigned short output_size, unsigned short &pos, const Anope::string &name)
{
if (pos + name.length() + 2 > output_size)
throw SocketException("Unable to pack name");
@@ -51,7 +51,7 @@ class Packet final
output[pos++] = 0;
}
Anope::string UnpackName(const unsigned char *input, unsigned short input_size, unsigned short &pos)
static Anope::string UnpackName(const unsigned char *input, unsigned short input_size, unsigned short &pos)
{
Anope::string name;
unsigned short pos_ptr = pos, lowest_ptr = input_size;
+1 -1
View File
@@ -30,7 +30,7 @@ class EBCRYPT final
return salt;
}
Anope::string Generate(const Anope::string &data, const Anope::string &salt)
static Anope::string Generate(const Anope::string &data, const Anope::string &salt)
{
char hash[64];
_crypt_blowfish_rn(data.c_str(), salt.c_str(), hash, sizeof(hash));
+2 -2
View File
@@ -208,7 +208,7 @@ class MD5Context final
/* Encodes input (unsigned) into output (unsigned char). Assumes len is
* a multiple of 4.
*/
void Encode(unsigned char *output, unsigned *input, unsigned len)
static void Encode(unsigned char *output, unsigned *input, unsigned len)
{
for (unsigned i = 0, j = 0; j < len; ++i, j += 4)
{
@@ -222,7 +222,7 @@ class MD5Context final
/* Decodes input (unsigned char) into output (unsigned). Assumes len is
* a multiple of 4.
*/
void Decode(unsigned *output, const unsigned char *input, unsigned len)
static void Decode(unsigned *output, const unsigned char *input, unsigned len)
{
for (unsigned i = 0, j = 0; j < len; ++i, j += 4)
output[i] = static_cast<unsigned>(input[j]) | (static_cast<unsigned>(input[j + 1]) << 8) | (static_cast<unsigned>(input[j + 2]) << 16) | (static_cast<unsigned>(input[j + 3]) << 24);
+1 -1
View File
@@ -67,7 +67,7 @@ struct HostRequest final
class CommandHSRequest final
: public Command
{
bool isvalidchar(char c)
static bool isvalidchar(char c)
{
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '.' || c == '-';
}
+1 -1
View File
@@ -108,7 +108,7 @@ public:
class CommandHSSetAll final
: public Command
{
void Sync(const NickAlias *na)
static void Sync(const NickAlias *na)
{
if (!na || !na->HasVhost())
return;
+1 -1
View File
@@ -17,7 +17,7 @@ class MemoServCore final
{
Reference<BotInfo> MemoServ;
bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)
static bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)
{
Anope::string subject = Language::Translate(nc, Config->GetBlock("mail")->Get<const Anope::string>("memo_subject").c_str()),
message = Language::Translate(Config->GetBlock("mail")->Get<const Anope::string>("memo_message").c_str());
+1 -1
View File
@@ -75,7 +75,7 @@ private:
return;
}
void DoList(CommandSource &source, NickCore *nc, const Anope::string &mask)
static void DoList(CommandSource &source, NickCore *nc, const Anope::string &mask)
{
unsigned i, end;
+1 -1
View File
@@ -91,7 +91,7 @@ AJoinList::~AJoinList()
class CommandNSAJoin final
: public Command
{
void DoList(CommandSource &source, NickCore *nc)
static void DoList(CommandSource &source, NickCore *nc)
{
AJoinList *channels = nc->Require<AJoinList>("ajoinlist");
+1 -1
View File
@@ -250,7 +250,7 @@ private:
source.Reply(_("\002%s\002 deleted from %s's certificate list."), certfp.c_str(), nc->display.c_str());
}
void DoList(CommandSource &source, const NickCore *nc)
static void DoList(CommandSource &source, const NickCore *nc)
{
NSCertList *cl = nc->GetExt<NSCertList>("certificates");
+1 -1
View File
@@ -18,7 +18,7 @@ class NSMaxEmail final
bool clean = false;
/* strip dots from username, and remove anything after the first + */
Anope::string CleanMail(const Anope::string &email)
static Anope::string CleanMail(const Anope::string &email)
{
size_t host = email.find('@');
if (host == Anope::string::npos)
+1 -1
View File
@@ -150,7 +150,7 @@ public:
class CommandOSDefcon final
: public Command
{
void SendLevels(CommandSource &source)
static void SendLevels(CommandSource &source)
{
if (DConfig.Check(DEFCON_NO_NEW_CHANNELS))
source.Reply(_("* No new channel registrations"));
+2 -2
View File
@@ -209,7 +209,7 @@ public:
class CommandOSDNS final
: public Command
{
void DisplayPoolState(CommandSource &source)
static void DisplayPoolState(CommandSource &source)
{
if (dns_servers->empty())
{
@@ -564,7 +564,7 @@ class CommandOSDNS final
source.Reply(_("IP %s does not exist for %s."), params[2].c_str(), s->GetName().c_str());
}
void OnSet(CommandSource &source, const std::vector<Anope::string> &params)
static void OnSet(CommandSource &source, const std::vector<Anope::string> &params)
{
DNSServer *s = DNSServer::Find(params[1]);
+2 -2
View File
@@ -161,7 +161,7 @@ class CommandOSIgnore final
: public Command
{
private:
Anope::string RealMask(const Anope::string &mask)
static Anope::string RealMask(const Anope::string &mask)
{
/* If it s an existing user, we ignore the hostmask. */
User *u = User::Find(mask, true);
@@ -245,7 +245,7 @@ private:
}
}
void DoList(CommandSource &source)
static void DoList(CommandSource &source)
{
if (!ignore_service)
return;
+1 -1
View File
@@ -51,7 +51,7 @@ struct MyOper final
class CommandOSOper final
: public Command
{
bool HasPrivs(CommandSource &source, OperType *ot) const
static bool HasPrivs(CommandSource &source, OperType *ot)
{
for (const auto &command : ot->GetCommands())
{
+2 -2
View File
@@ -174,7 +174,7 @@ class CommandOSSession final
: public Command
{
private:
void DoList(CommandSource &source, const std::vector<Anope::string> &params)
static void DoList(CommandSource &source, const std::vector<Anope::string> &params)
{
Anope::string param = params[1];
@@ -216,7 +216,7 @@ private:
return;
}
void DoView(CommandSource &source, const std::vector<Anope::string> &params)
static void DoView(CommandSource &source, const std::vector<Anope::string> &params)
{
Anope::string param = params[1];
Session *session = session_service->FindSession(param);
+3 -3
View File
@@ -129,14 +129,14 @@ private:
}
}
void DoStatsReset(CommandSource &source)
static void DoStatsReset(CommandSource &source)
{
MaxUserCount = UserListByNick.size();
source.Reply(_("Statistics reset."));
return;
}
void DoStatsUptime(CommandSource &source)
static void DoStatsUptime(CommandSource &source)
{
time_t uptime = Anope::CurTime - Anope::StartTime;
source.Reply(_("Current users: \002%zu\002 (\002%d\002 ops)"), UserListByNick.size(), OperCount);
@@ -146,7 +146,7 @@ private:
return;
}
void DoStatsUplink(CommandSource &source)
static void DoStatsUplink(CommandSource &source)
{
Anope::string buf;
for (const auto &capab : Servers::Capab)
+1 -1
View File
@@ -514,7 +514,7 @@ class ProtoBahamut final
IRCDMessageSJoin message_sjoin;
IRCDMessageTopic message_topic;
void AddModes()
static void AddModes()
{
/* Add user modes */
ModeManager::AddUserMode(new UserModeOperOnly("SERV_ADMIN", 'A'));
+1 -1
View File
@@ -721,7 +721,7 @@ class ProtoHybrid final
bool use_server_side_mlock;
void AddModes()
static void AddModes()
{
/* Add user modes */
ModeManager::AddUserMode(new UserModeOperOnly("ADMIN", 'a'));
+7 -7
View File
@@ -69,7 +69,7 @@ class InspIRCdProto final
: public IRCDProto
{
private:
void SendChgIdentInternal(const Anope::string &nick, const Anope::string &vIdent)
static void SendChgIdentInternal(const Anope::string &nick, const Anope::string &vIdent)
{
if (!Servers::Capab.count("CHGIDENT"))
Log() << "CHGIDENT not loaded!";
@@ -77,7 +77,7 @@ private:
Uplink::Send("CHGIDENT", nick, vIdent);
}
void SendChgHostInternal(const Anope::string &nick, const Anope::string &vhost)
static void SendChgHostInternal(const Anope::string &nick, const Anope::string &vhost)
{
if (!Servers::Capab.count("CHGHOST"))
Log() << "CHGHOST not loaded!";
@@ -85,17 +85,17 @@ private:
Uplink::Send("CHGHOST", nick, vhost);
}
void SendAddLine(const Anope::string &xtype, const Anope::string &mask, time_t duration, const Anope::string &addedby, const Anope::string &reason)
static void SendAddLine(const Anope::string &xtype, const Anope::string &mask, time_t duration, const Anope::string &addedby, const Anope::string &reason)
{
Uplink::Send("ADDLINE", xtype, mask, addedby, Anope::CurTime, duration, reason);
}
void SendDelLine(const Anope::string &xtype, const Anope::string &mask)
static void SendDelLine(const Anope::string &xtype, const Anope::string &mask)
{
Uplink::Send("DELLINE", xtype, mask);
}
void SendAccount(const Anope::string &uid, NickAlias *na)
static void SendAccount(const Anope::string &uid, NickAlias *na)
{
Uplink::Send("METADATA", uid, "accountid", na ? na->nc->GetId() : Anope::string());
Uplink::Send("METADATA", uid, "accountname", na ? na->nc->display : Anope::string());
@@ -782,7 +782,7 @@ public:
return IsValid(value, false);
}
bool IsValid(const Anope::string &value, bool historymode) const
static bool IsValid(const Anope::string &value, bool historymode)
{
if (value.empty())
return false; // empty param is never valid
@@ -2027,7 +2027,7 @@ class ProtoInspIRCd final
bool use_server_side_topiclock, use_server_side_mlock;
void SendChannelMetadata(Channel *c, const Anope::string &metadataname, const Anope::string &value)
static void SendChannelMetadata(Channel *c, const Anope::string &metadataname, const Anope::string &value)
{
Uplink::Send("METADATA", c->name, c->creation_time, metadataname, value);
}
+1 -1
View File
@@ -624,7 +624,7 @@ class ProtongIRCd final
IRCDMessageServer message_server;
IRCDMessageTopic message_topic;
void AddModes()
static void AddModes()
{
/* Add user modes */
ModeManager::AddUserMode(new UserMode("NOCTCP", 'b'));
+1 -1
View File
@@ -368,7 +368,7 @@ class ProtoPlexus final
IRCDMessageServer message_server;
IRCDMessageUID message_uid;
void AddModes()
static void AddModes()
{
/* Add user modes */
ModeManager::AddUserMode(new UserModeOperOnly("ADMIN", 'a'));
+2 -2
View File
@@ -18,7 +18,7 @@ static ServiceReference<IRCDProto> hybrid("IRCDProto", "hybrid");
class RatboxProto final
: public IRCDProto
{
BotInfo *FindIntroduced()
static BotInfo *FindIntroduced()
{
BotInfo *bi = Config->GetClient("OperServ");
@@ -294,7 +294,7 @@ class ProtoRatbox final
IRCDMessageTBurst message_tburst;
IRCDMessageUID message_uid;
void AddModes()
static void AddModes()
{
/* user modes */
ModeManager::AddUserMode(new UserModeOperOnly("ADMIN", 'a'));
+1 -1
View File
@@ -356,7 +356,7 @@ class ProtoSolanum final
bool use_server_side_mlock;
void AddModes()
static void AddModes()
{
/* Add user modes */
ModeManager::AddUserMode(new UserMode("NOFORWARD", 'Q'));
+1 -1
View File
@@ -112,7 +112,7 @@ public:
}
private:
inline void Pack(std::vector<char> &buffer, const char *buf, size_t sz = 0)
static inline void Pack(std::vector<char> &buffer, const char *buf, size_t sz = 0)
{
if (!sz)
sz = strlen(buf);
+6 -6
View File
@@ -121,7 +121,7 @@ private:
}
}
bool DoCheckAuthentication(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
static bool DoCheckAuthentication(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
{
Anope::string username = request.data.size() > 0 ? request.data[0] : "";
Anope::string password = request.data.size() > 1 ? request.data[1] : "";
@@ -139,7 +139,7 @@ private:
return true;
}
void DoStats(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
static void DoStats(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
{
request.reply("uptime", stringify(Anope::CurTime - Anope::StartTime));
request.reply("uplinkname", Me->GetLinks().front()->GetName());
@@ -156,7 +156,7 @@ private:
request.reply("channelcount", stringify(ChannelList.size()));
}
void DoChannel(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
static void DoChannel(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
{
if (request.data.empty())
return;
@@ -205,7 +205,7 @@ private:
}
}
void DoUser(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
static void DoUser(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
{
if (request.data.empty())
return;
@@ -247,7 +247,7 @@ private:
}
}
void DoOperType(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
static void DoOperType(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
{
for (auto *ot : Config->MyOperTypes)
{
@@ -260,7 +260,7 @@ private:
}
}
void DoNotice(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
static void DoNotice(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request)
{
Anope::string from = request.data.size() > 0 ? request.data[0] : "";
Anope::string to = request.data.size() > 1 ? request.data[1] : "";