summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt94
-rw-r--r--src/account.cpp2
-rw-r--r--src/base.cpp4
-rw-r--r--src/channels.cpp2
-rw-r--r--src/command.cpp4
-rw-r--r--src/config.cpp33
-rw-r--r--src/hashcomp.cpp2
-rw-r--r--src/init.cpp12
-rw-r--r--src/language.cpp6
-rw-r--r--src/logger.cpp17
-rw-r--r--src/mail.cpp2
-rw-r--r--src/main.cpp8
-rw-r--r--src/memos.cpp2
-rw-r--r--src/messages.cpp44
-rw-r--r--src/misc.cpp36
-rw-r--r--src/modes.cpp14
-rw-r--r--src/module.cpp6
-rw-r--r--src/opertype.cpp2
-rw-r--r--src/process.cpp1
-rw-r--r--src/protocol.cpp15
-rw-r--r--src/regchannel.cpp5
-rw-r--r--src/serialize.cpp6
-rw-r--r--src/servers.cpp2
-rw-r--r--src/siphash.cpp10
-rw-r--r--src/socket_clients.cpp2
-rw-r--r--src/socket_transport.cpp16
-rw-r--r--src/socketengines/socketengine_epoll.cpp4
-rw-r--r--src/sockets.cpp8
-rw-r--r--src/threadengine.cpp8
-rw-r--r--src/tools/CMakeLists.txt18
-rw-r--r--src/tools/anoperc.in6
-rw-r--r--src/tools/anopesmtp.cpp17
-rw-r--r--src/users.cpp5
-rw-r--r--src/version.sh6
-rw-r--r--src/win32/anope_windows.h4
-rw-r--r--src/xline.cpp2
36 files changed, 150 insertions, 275 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b390d164b..d722dd86c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -2,72 +2,49 @@
file(GLOB SRC_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp")
if(WIN32)
- append_to_list(SRC_SRCS win32/dir/dir.cpp)
- append_to_list(SRC_SRCS win32/socket.cpp)
- append_to_list(SRC_SRCS win32/windows.cpp)
- append_to_list(SRC_SRCS win32/dl/dl.cpp)
- append_to_list(SRC_SRCS win32/pipe/pipe.cpp)
- append_to_list(SRC_SRCS win32/pthread/pthread.cpp)
- append_to_list(SRC_SRCS win32/sigaction/sigaction.cpp)
-endif(WIN32)
+ list(APPEND SRC_SRCS win32/dir/dir.cpp)
+ list(APPEND SRC_SRCS win32/socket.cpp)
+ list(APPEND SRC_SRCS win32/windows.cpp)
+ list(APPEND SRC_SRCS win32/dl/dl.cpp)
+ list(APPEND SRC_SRCS win32/pipe/pipe.cpp)
+ list(APPEND SRC_SRCS win32/pthread/pthread.cpp)
+ list(APPEND SRC_SRCS win32/sigaction/sigaction.cpp)
+endif()
if(HAVE_EPOLL)
- append_to_list(SRC_SRCS socketengines/socketengine_epoll.cpp)
-else(HAVE_EPOLL)
- if(HAVE_KQUEUE)
- append_to_list(SRC_SRCS socketengines/socketengine_kqueue.cpp)
- else(HAVE_KQUEUE)
- if(HAVE_POLL)
- append_to_list(SRC_SRCS socketengines/socketengine_poll.cpp)
- else(HAVE_POLL)
- append_to_list(SRC_SRCS socketengines/socketengine_select.cpp)
- endif(HAVE_POLL)
- endif(HAVE_KQUEUE)
-endif(HAVE_EPOLL)
+ list(APPEND SRC_SRCS socketengines/socketengine_epoll.cpp)
+elseif(HAVE_KQUEUE)
+ list(APPEND SRC_SRCS socketengines/socketengine_kqueue.cpp)
+elseif(HAVE_POLL)
+ list(APPEND SRC_SRCS socketengines/socketengine_poll.cpp)
+else()
+ list(APPEND SRC_SRCS socketengines/socketengine_select.cpp)
+endif()
-sort_list(SRC_SRCS)
+list(SORT SRC_SRCS)
# Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though)
set_source_files_properties(${SRC_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
-# Create an empty list to store extra include directories
-set(EXTRA_INCLUDES)
-# Iterate through all the source files
-foreach(SRC ${SRC_SRCS})
- # Temporary variable for the current source's include directories
- set(TEMP_INCLUDES)
- # Calculate the header file dependencies for the given source file
- calculate_depends(${SRC} TEMP_INCLUDES)
- # If there were some extra include directories, add them to the list
- if(TEMP_INCLUDES)
- append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES})
- endif(TEMP_INCLUDES)
-endforeach(SRC)
-# If there were extra include directories, remove the duplicates and add the directories to the include path
-if(EXTRA_INCLUDES)
- remove_list_duplicates(EXTRA_INCLUDES)
- include_directories(${EXTRA_INCLUDES})
-endif(EXTRA_INCLUDES)
-
# Under Windows, we also include a resource file to the build
if(WIN32)
# Make sure that the resource file is seen as an RC file to be compiled with a resource compiler, not a C++ compiler
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc LANGUAGE RC)
# Add the resource file to the list of sources
- append_to_list(SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc)
+ list(APPEND SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc)
# For MinGW, we have to change the compile flags
if(MINGW)
set(RC_CFLAGS "-DMINGW -Ocoff -I${Anope_SOURCE_DIR}/include")
# If any sort of debugging is being enabled, add a _DEBUG define to the flags for the resource compiler
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
set(RC_CFLAGS "${RC_CFLAGS} -D_DEBUG")
- endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
+ endif()
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "${RC_CFLAGS}")
# For anything else, assumingly Visual Studio at this point, use a different set of compile flags
- else(MINGW)
+ else()
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"")
- endif(MINGW)
-endif(WIN32)
+ endif()
+endif()
# If compiling with Visual Studio, create a static library out of win32/win32_memory.cpp to be included with everything else, needed to override its override of new/delete operators
if(MSVC)
@@ -75,29 +52,36 @@ if(MSVC)
add_library(win32_memory STATIC win32/win32_memory.cpp)
set(WIN32_MEMORY win32_memory)
set(EXTRA_LDFLAGS "/OPT:NOREF") # https://sourceware.org/bugzilla/show_bug.cgi?id=12633
-else(MSVC)
+else()
set(WIN32_MEMORY)
-endif(MSVC)
+endif()
# Generate the Anope executable and set it's linker flags, also set it to export it's symbols even though it's not a module
add_executable(${PROGRAM_NAME} ${SRC_SRCS})
set_target_properties(${PROGRAM_NAME} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS} ${EXTRA_LDFLAGS}" ENABLE_EXPORTS ON INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON)
+
# On Windows, also link Anope to the wsock32 and Ws2_32 library, as well as set the version
if(WIN32)
- target_link_libraries(${PROGRAM_NAME} wsock32 Ws2_32 ${LINK_LIBS} ${GETTEXT_LIBRARIES} ${WIN32_MEMORY})
+ target_link_libraries(${PROGRAM_NAME} wsock32 Ws2_32 ${LINK_LIBS} ${WIN32_MEMORY})
set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
-else(WIN32)
- target_link_libraries(${PROGRAM_NAME} ${LINK_LIBS} ${GETTEXT_LIBRARIES})
-endif(WIN32)
+else()
+ target_link_libraries(${PROGRAM_NAME} ${LINK_LIBS})
+endif()
+
+# If being built with localisation we might need to link against libintl.
+if(HAVE_LOCALIZATION AND Intl_LIBRARY)
+ target_link_libraries(${PROGRAM_NAME} ${Intl_LIBRARY})
+endif()
+
# Building the Anope executable requires the version.h header to be generated
add_dependencies(${PROGRAM_NAME} headers)
# Also require the language files if we have gettext
-if(GETTEXT_FOUND)
+if(HAVE_LOCALIZATION)
add_dependencies(${PROGRAM_NAME} language)
-endif(GETTEXT_FOUND)
+endif()
# Get the filename of the Anope executable as it is in on this system
-get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION)
+set(SERVICES_BINARY "$<TARGET_FILE:${PROGRAM_NAME}>")
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
# Add the Anope executable to the list of files for CPack to ignore
add_to_cpack_ignored_files("${SERVICES_BINARY}$" TRUE)
@@ -108,7 +92,7 @@ configure_file(${Anope_SOURCE_DIR}/include/sysconf.h.cmake ${Anope_BINARY_DIR}/i
# Go into the following directories and run their CMakeLists.txt as well
if(NOT DISABLE_TOOLS)
add_subdirectory(tools)
-endif(NOT DISABLE_TOOLS)
+endif()
# Set Anope to be installed to the bin directory
install(TARGETS ${PROGRAM_NAME}
diff --git a/src/account.cpp b/src/account.cpp
index af8557956..65df38978 100644
--- a/src/account.cpp
+++ b/src/account.cpp
@@ -18,7 +18,7 @@
std::set<IdentifyRequest *> IdentifyRequest::Requests;
-IdentifyRequest::IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass) : owner(o), account(acc), password(pass), dispatched(false), success(false)
+IdentifyRequest::IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass) : owner(o), account(acc), password(pass)
{
Requests.insert(this);
}
diff --git a/src/base.cpp b/src/base.cpp
index 824187efa..840d1d359 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -13,10 +13,6 @@
std::map<Anope::string, std::map<Anope::string, Service *> > Service::Services;
std::map<Anope::string, std::map<Anope::string, Anope::string> > Service::Aliases;
-Base::Base() : references(NULL)
-{
-}
-
Base::~Base()
{
if (this->references != NULL)
diff --git a/src/channels.cpp b/src/channels.cpp
index d17cea7d7..08998de77 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -912,7 +912,7 @@ bool Channel::CheckKick(User *user)
return false;
if (mask.empty())
- mask = this->ci->GetIdealBan(user);
+ mask = this->ci ? this->ci->GetIdealBan(user) : "*!*@" + user->GetDisplayedHost();
if (reason.empty())
reason = Language::Translate(user->Account(), CHAN_NOT_ALLOWED_TO_JOIN);
diff --git a/src/command.cpp b/src/command.cpp
index 6e4fa1aaa..4c511777a 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -122,10 +122,6 @@ Command::Command(Module *o, const Anope::string &sname, size_t minparams, size_t
allow_unregistered = require_user = false;
}
-Command::~Command()
-{
-}
-
void Command::SetDesc(const Anope::string &d)
{
this->desc = d;
diff --git a/src/config.cpp b/src/config.cpp
index f1d237a5d..d7b90a105 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -19,7 +19,7 @@
using namespace Configuration;
-File ServicesConf("services.conf", false); // Services configuration file name
+File ServicesConf("anope.conf", false); // Configuration file name
Conf *Config = NULL;
Block::Block(const Anope::string &n) : name(n), linenum(-1)
@@ -33,47 +33,32 @@ const Anope::string &Block::GetName() const
int Block::CountBlock(const Anope::string &bname)
{
- if (!this)
- return 0;
-
return blocks.count(bname);
}
Block* Block::GetBlock(const Anope::string &bname, int num)
{
- if (!this)
- return NULL;
-
std::pair<block_map::iterator, block_map::iterator> it = blocks.equal_range(bname);
for (int i = 0; it.first != it.second; ++it.first, ++i)
if (i == num)
return &it.first->second;
- return NULL;
+ return &(Config->EmptyBlock);
}
bool Block::Set(const Anope::string &tag, const Anope::string &value)
{
- if (!this)
- return false;
-
items[tag] = value;
return true;
}
-const Block::item_map* Block::GetItems() const
+const Block::item_map& Block::GetItems() const
{
- if (this)
- return &items;
- else
- return NULL;
+ return items;
}
template<> const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const
{
- if (!this)
- return def;
-
Anope::map<Anope::string>::const_iterator it = items.find(tag);
if (it != items.end())
return it->second;
@@ -116,7 +101,7 @@ template<typename T> static void ValidateNotZero(const Anope::string &block, con
throw ConfigException("The value for <" + block + ":" + name + "> cannot be zero!");
}
-Conf::Conf() : Block("")
+Conf::Conf() : Block(""), EmptyBlock("")
{
ReadTimeout = 0;
UsePrivmsg = DefPrivmsg = false;
@@ -220,7 +205,7 @@ Conf::Conf() : Block("")
if (password.find(' ') != Anope::string::npos || password[0] == ':')
throw ConfigException("uplink:password is not valid");
- this->Uplinks.push_back(Uplink(host, port, password, ipv6));
+ this->Uplinks.emplace_back(host, port, password, ipv6);
}
for (int i = 0; i < this->CountBlock("module"); ++i)
@@ -602,7 +587,7 @@ void Conf::Post(Conf *old)
Block *Conf::GetModule(Module *m)
{
if (!m)
- return NULL;
+ return &(Config->EmptyBlock);
return GetModule(m->name);
}
@@ -654,10 +639,10 @@ Block *Conf::GetCommand(CommandSource &source)
return b;
}
- return NULL;
+ return &(Config->EmptyBlock);
}
-File::File(const Anope::string &n, bool e) : name(n), executable(e), fp(NULL)
+File::File(const Anope::string &n, bool e) : name(n), executable(e)
{
}
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index e839de4f9..409e125ac 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -91,7 +91,7 @@ bool ci::less::operator()(const Anope::string &s1, const Anope::string &s2) cons
return s1.ci_str().compare(s2.ci_str()) < 0;
}
-sepstream::sepstream(const Anope::string &source, char separator, bool ae) : tokens(source), sep(separator), pos(0), allow_empty(ae)
+sepstream::sepstream(const Anope::string &source, char separator, bool ae) : tokens(source), sep(separator), allow_empty(ae)
{
}
diff --git a/src/init.cpp b/src/init.cpp
index e3866abfc..5df2c1cce 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -23,10 +23,10 @@
#include <sys/wait.h>
#include <sys/stat.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <pwd.h>
+#include <cerrno>
#include <grp.h>
+#include <pwd.h>
+#include <sys/types.h>
#endif
Anope::string Anope::ConfigDir = "conf", Anope::DataDir = "data", Anope::ModuleDir = "lib", Anope::LocaleDir = "locale", Anope::LogDir = "logs";
@@ -57,7 +57,7 @@ static void ParseCommandLineArguments(int ac, char **av)
if (option.empty())
continue;
- CommandLineArguments.push_back(std::make_pair(option, param));
+ CommandLineArguments.emplace_back(option, param);
}
}
@@ -411,7 +411,7 @@ void Anope::Init(int ac, char **av)
Anope::LogDir = arg;
}
- /* Chdir to Services data directory. */
+ /* Chdir to Anope data directory. */
if (chdir(Anope::ServicesDir.c_str()) < 0)
{
throw CoreException("Unable to chdir to " + Anope::ServicesDir + ": " + Anope::LastError());
@@ -493,7 +493,7 @@ void Anope::Init(int ac, char **av)
catch (const ConfigException &ex)
{
Log(LOG_TERMINAL) << ex.GetReason();
- Log(LOG_TERMINAL) << "*** Support resources: Read through the services.conf self-contained";
+ Log(LOG_TERMINAL) << "*** Support resources: Read through the anope.conf self-contained";
Log(LOG_TERMINAL) << "*** documentation. Read the documentation files found in the 'docs'";
Log(LOG_TERMINAL) << "*** folder. Visit our portal located at https://www.anope.org/. Join";
Log(LOG_TERMINAL) << "*** our support channel on /server irc.anope.org channel #anope.";
diff --git a/src/language.cpp b/src/language.cpp
index 8c39941b4..219bf846c 100644
--- a/src/language.cpp
+++ b/src/language.cpp
@@ -15,7 +15,7 @@
#include "config.h"
#include "language.h"
-#if GETTEXT_FOUND
+#if HAVE_LOCALIZATION
# include <libintl.h>
#endif
@@ -24,7 +24,7 @@ std::vector<Anope::string> Language::Domains;
void Language::InitLanguages()
{
-#if GETTEXT_FOUND
+#if HAVE_LOCALIZATION
Log(LOG_DEBUG) << "Initializing Languages...";
Languages.clear();
@@ -73,7 +73,7 @@ const char *Language::Translate(const NickCore *nc, const char *string)
return Translate(nc ? nc->language.c_str() : "", string);
}
-#if GETTEXT_FOUND
+#if HAVE_LOCALIZATION
#if defined(__GLIBC__) && defined(__USE_GNU_GETTEXT)
extern "C" int _nl_msg_cat_cntr;
diff --git a/src/logger.cpp b/src/logger.cpp
index 937fb4d5d..807895396 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -74,11 +74,11 @@ const Anope::string &LogFile::GetName() const
return this->filename;
}
-Log::Log(LogType t, const Anope::string &cat, BotInfo *b) : bi(b), u(NULL), nc(NULL), c(NULL), source(NULL), chan(NULL), ci(NULL), s(NULL), m(NULL), type(t), category(cat)
+Log::Log(LogType t, const Anope::string &cat, BotInfo *b) : bi(b), type(t), category(cat)
{
}
-Log::Log(LogType t, CommandSource &src, Command *_c, ChannelInfo *_ci) : u(src.GetUser()), nc(src.nc), c(_c), source(&src), chan(NULL), ci(_ci), s(NULL), m(NULL), type(t)
+Log::Log(LogType t, CommandSource &src, Command *_c, ChannelInfo *_ci) : u(src.GetUser()), nc(src.nc), c(_c), source(&src), ci(_ci), type(t)
{
if (!c)
throw CoreException("Invalid pointers passed to Log::Log");
@@ -87,35 +87,34 @@ Log::Log(LogType t, CommandSource &src, Command *_c, ChannelInfo *_ci) : u(src.G
throw CoreException("This constructor does not support this log type");
size_t sl = c->name.find('/');
- this->bi = NULL;
if (sl != Anope::string::npos)
this->bi = BotInfo::Find(c->name.substr(0, sl), true);
this->category = c->name;
}
-Log::Log(User *_u, Channel *ch, const Anope::string &cat) : bi(NULL), u(_u), nc(NULL), c(NULL), source(NULL), chan(ch), ci(chan ? *chan->ci : NULL), s(NULL), m(NULL), type(LOG_CHANNEL), category(cat)
+Log::Log(User *_u, Channel *ch, const Anope::string &cat) : u(_u), chan(ch), ci(chan ? *chan->ci : nullptr), type(LOG_CHANNEL), category(cat)
{
if (!chan)
throw CoreException("Invalid pointers passed to Log::Log");
}
-Log::Log(User *_u, const Anope::string &cat, BotInfo *_bi) : bi(_bi), u(_u), nc(NULL), c(NULL), source(NULL), chan(NULL), ci(NULL), s(NULL), m(NULL), type(LOG_USER), category(cat)
+Log::Log(User *_u, const Anope::string &cat, BotInfo *_bi) : bi(_bi), u(_u), type(LOG_USER), category(cat)
{
if (!u)
throw CoreException("Invalid pointers passed to Log::Log");
}
-Log::Log(Server *serv, const Anope::string &cat, BotInfo *_bi) : bi(_bi), u(NULL), nc(NULL), c(NULL), source(NULL), chan(NULL), ci(NULL), s(serv), m(NULL), type(LOG_SERVER), category(cat)
+Log::Log(Server *serv, const Anope::string &cat, BotInfo *_bi) : bi(_bi), s(serv), type(LOG_SERVER), category(cat)
{
if (!s)
throw CoreException("Invalid pointer passed to Log::Log");
}
-Log::Log(BotInfo *b, const Anope::string &cat) : bi(b), u(NULL), nc(NULL), c(NULL), source(NULL), chan(NULL), ci(NULL), s(NULL), m(NULL), type(LOG_NORMAL), category(cat)
+Log::Log(BotInfo *b, const Anope::string &cat) : bi(b), type(LOG_NORMAL), category(cat)
{
}
-Log::Log(Module *mod, const Anope::string &cat, BotInfo *_bi) : bi(_bi), u(NULL), nc(NULL), c(NULL), source(NULL), chan(NULL), ci(NULL), s(NULL), m(mod), type(LOG_MODULE), category(cat)
+Log::Log(Module *mod, const Anope::string &cat, BotInfo *_bi) : bi(_bi), m(mod), type(LOG_MODULE), category(cat)
{
}
@@ -227,7 +226,7 @@ Anope::string Log::BuildPrefix() const
return buffer;
}
-LogInfo::LogInfo(int la, bool rio, bool ldebug) : bot(NULL), last_day(0), log_age(la), raw_io(rio), debug(ldebug)
+LogInfo::LogInfo(int la, bool rio, bool ldebug) : log_age(la), raw_io(rio), debug(ldebug)
{
}
diff --git a/src/mail.cpp b/src/mail.cpp
index ee947c07f..c5e465666 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -13,7 +13,7 @@
#include "mail.h"
#include "config.h"
-Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) : Thread(), sendmail_path(Config->GetBlock("mail")->Get<const Anope::string>("sendmailpath")), send_from(sf), mail_to(mailto), addr(a), subject(s), message(m), dont_quote_addresses(Config->GetBlock("mail")->Get<bool>("dontquoteaddresses")), success(false)
+Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) : Thread(), sendmail_path(Config->GetBlock("mail")->Get<const Anope::string>("sendmailpath")), send_from(sf), mail_to(mailto), addr(a), subject(s), message(m), dont_quote_addresses(Config->GetBlock("mail")->Get<bool>("dontquoteaddresses"))
{
}
diff --git a/src/main.cpp b/src/main.cpp
index 660e14519..4c48c45eb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,4 +1,4 @@
-/* Services -- main source file.
+/* Anope -- main source file.
*
* (C) 2003-2022 Anope Team
* Contact us at team@anope.org
@@ -17,7 +17,7 @@
#include "uplink.h"
#ifndef _WIN32
-#include <limits.h>
+#include <climits>
#else
#include <process.h>
#endif
@@ -46,7 +46,7 @@ class UpdateTimer : public Timer
public:
UpdateTimer(time_t timeout) : Timer(timeout, Anope::CurTime, true) { }
- void Tick(time_t) anope_override
+ void Tick(time_t) override
{
Anope::SaveDatabases();
}
@@ -57,7 +57,7 @@ class ExpireTimer : public Timer
public:
ExpireTimer(time_t timeout) : Timer(timeout, Anope::CurTime, true) { }
- void Tick(time_t) anope_override
+ void Tick(time_t) override
{
FOREACH_MOD(OnExpireTick, ());
}
diff --git a/src/memos.cpp b/src/memos.cpp
index 20d2ce8d3..278cc0157 100644
--- a/src/memos.cpp
+++ b/src/memos.cpp
@@ -76,7 +76,7 @@ Serializable* Memo::Unserialize(Serializable *obj, Serialize::Data &data)
return m;
}
-MemoInfo::MemoInfo() : memomax(0), memos("Memo")
+MemoInfo::MemoInfo() : memos("Memo")
{
}
diff --git a/src/messages.cpp b/src/messages.cpp
index 0d0882b2a..a8ff6f7a7 100644
--- a/src/messages.cpp
+++ b/src/messages.cpp
@@ -22,7 +22,7 @@
using namespace Message;
-void Away::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Away::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
const Anope::string &msg = !params.empty() ? params[0] : "";
@@ -33,7 +33,7 @@ void Away::Run(MessageSource &source, const std::vector<Anope::string> &params)
Log(source.GetUser(), "away") << "is no longer away";
}
-void Capab::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Capab::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
if (params.size() == 1)
{
@@ -47,14 +47,14 @@ void Capab::Run(MessageSource &source, const std::vector<Anope::string> &params)
Servers::Capab.insert(params[i]);
}
-void Error::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Error::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
Log(LOG_TERMINAL) << "ERROR: " << params[0];
Anope::QuitReason = "Received ERROR from uplink: " + params[0];
Anope::Quitting = true;
}
-void Invite::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Invite::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
User *targ = User::Find(params[0]);
Channel *c = Channel::Find(params[1]);
@@ -65,7 +65,7 @@ void Invite::Run(MessageSource &source, const std::vector<Anope::string> &params
FOREACH_MOD(OnInvite, (source.GetUser(), c, targ));
}
-void Join::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Join::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
User *user = source.GetUser();
const Anope::string &channels = params[0];
@@ -92,7 +92,7 @@ void Join::Run(MessageSource &source, const std::vector<Anope::string> &params)
}
std::list<SJoinUser> users;
- users.push_back(std::make_pair(ChannelStatus(), user));
+ users.emplace_back(ChannelStatus(), user);
Channel *chan = Channel::Find(channel);
SJoin(source, channel, chan ? chan->creation_time : Anope::CurTime, "", users);
@@ -167,7 +167,7 @@ void Join::SJoin(MessageSource &source, const Anope::string &chan, time_t ts, co
}
}
-void Kick::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Kick::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
const Anope::string &channel = params[0];
const Anope::string &users = params[1];
@@ -184,7 +184,7 @@ void Kick::Run(MessageSource &source, const std::vector<Anope::string> &params)
c->KickInternal(source, user, reason);
}
-void Kill::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Kill::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
User *u = User::Find(params[0]);
BotInfo *bi;
@@ -199,7 +199,7 @@ void Kill::Run(MessageSource &source, const std::vector<Anope::string> &params)
if (last_time == Anope::CurTime)
{
- Anope::QuitReason = "Kill loop detected. Are Services U:Lined?";
+ Anope::QuitReason = "Kill loop detected. Is Anope U:Lined?";
Anope::Quitting = true;
return;
}
@@ -211,7 +211,7 @@ void Kill::Run(MessageSource &source, const std::vector<Anope::string> &params)
u->KillInternal(source, params[1]);
}
-void Message::Mode::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Message::Mode::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
Anope::string buf;
for (unsigned i = 1; i < params.size(); ++i)
@@ -234,7 +234,7 @@ void Message::Mode::Run(MessageSource &source, const std::vector<Anope::string>
}
/* XXX We should cache the file somewhere not open/read/close it on every request */
-void MOTD::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void MOTD::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
Server *s = Server::Find(params[0]);
if (s != Me)
@@ -257,7 +257,7 @@ void MOTD::Run(MessageSource &source, const std::vector<Anope::string> &params)
IRCD->SendNumeric(422, source.GetSource(), ":- MOTD file not found! Please contact your IRC administrator.");
}
-void Notice::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Notice::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
Anope::string message = params[1];
@@ -273,7 +273,7 @@ void Notice::Run(MessageSource &source, const std::vector<Anope::string> &params
}
}
-void Part::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Part::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
User *u = source.GetUser();
const Anope::string &reason = params.size() > 1 ? params[1] : "";
@@ -295,12 +295,12 @@ void Part::Run(MessageSource &source, const std::vector<Anope::string> &params)
}
}
-void Ping::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Ping::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
IRCD->SendPong(params.size() > 1 ? params[1] : Me->GetSID(), params[0]);
}
-void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{
const Anope::string &receiver = params[0];
Anope::string message = params[1];
@@ -373,7 +373,7 @@ void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> &param
return;
}
-void Quit::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void Quit::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
{