From 7d84e4900fa8f4ef96e8cf4bb67b76be7902e840 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 4 Apr 2021 23:42:15 +0100 Subject: Fix a ton of pedantic compiler warnings. --- include/base.h | 1 - include/clientprotocol.h | 8 ++++---- include/configreader.h | 2 +- include/convto.h | 6 +++--- include/extensible.h | 17 +---------------- include/filelogger.h | 2 +- include/fileutils.h | 6 +++--- include/inspircd.h | 1 + include/inspsocket.h | 3 ++- include/inspstring.h | 2 +- include/logger.h | 7 +------ include/mode.h | 32 +++++++++++--------------------- include/modechange.h | 6 +----- include/modules.h | 13 +++---------- include/modules/cap.h | 2 +- include/modules/dns.h | 2 +- include/modules/extban.h | 2 +- include/modules/regex.h | 6 +++--- include/numeric.h | 8 ++++++-- include/protocol.h | 6 +++--- include/socket.h | 2 +- include/socketengine.h | 5 +---- include/thread.h | 2 +- include/threadsocket.h | 2 +- include/usermanager.h | 12 ++++++------ include/users.h | 3 --- 26 files changed, 58 insertions(+), 100 deletions(-) (limited to 'include') diff --git a/include/base.h b/include/base.h index 4c15f6253..1a733ac79 100644 --- a/include/base.h +++ b/include/base.h @@ -224,7 +224,6 @@ class CoreExport ServiceProvider : public Cullable /** Type of service (must match object type) */ const ServiceType service; ServiceProvider(Module* Creator, const std::string& Name, ServiceType Type); - virtual ~ServiceProvider() = default; /** Retrieves a string that represents the type of this service. */ const char* GetTypeString() const; diff --git a/include/clientprotocol.h b/include/clientprotocol.h index 31079e77b..8c4bf1d19 100644 --- a/include/clientprotocol.h +++ b/include/clientprotocol.h @@ -358,7 +358,7 @@ class ClientProtocol::Message : public ClientProtocol::MessageSource void PushParam(const std::string& str) { params.emplace_back(0, str); } /** Add a non-string parameter to the parameter list. - * @param arg1 Non-string to add, will be copied. + * @param param Non-string to add, will be copied. */ template void PushParam(T&& param) @@ -392,20 +392,20 @@ class ClientProtocol::Message : public ClientProtocol::MessageSource * @param index Index of the parameter to replace. Must be less than GetParams().size(). * @param str String to replace the parameter or placeholder with, will be copied. */ - void ReplaceParam(unsigned int index, const char* str) { params[index] = Param(0, str); } + void ReplaceParam(size_t index, const char* str) { params[index] = Param(0, str); } /** Replace a parameter or a placeholder that is already in the parameter list. * @param index Index of the parameter to replace. Must be less than GetParams().size(). * @param str String to replace the parameter or placeholder with, will be copied. */ - void ReplaceParam(unsigned int index, const std::string& str) { params[index] = Param(0, str); } + void ReplaceParam(size_t index, const std::string& str) { params[index] = Param(0, str); } /** Replace a parameter or a placeholder that is already in the parameter list. * @param index Index of the parameter to replace. Must be less than GetParams().size(). * @param str String to replace the parameter or placeholder with. * The string will NOT be copied, it must remain alive until ClearParams() is called or until the object is destroyed. */ - void ReplaceParamRef(unsigned int index, const std::string& str) { params[index] = Param(str); } + void ReplaceParamRef(size_t index, const std::string& str) { params[index] = Param(str); } /** Add a tag. * @param tagname Raw name of the tag to use in the protocol. diff --git a/include/configreader.h b/include/configreader.h index 1e9cf77c5..a0ecde6b5 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -524,7 +524,7 @@ class CoreExport ConfigReaderThread : public Thread { } - ~ConfigReaderThread() + ~ConfigReaderThread() override { delete Config; } diff --git a/include/convto.h b/include/convto.h index 1fc684829..0827fa17f 100644 --- a/include/convto.h +++ b/include/convto.h @@ -30,7 +30,7 @@ template inline std::string ConvNumeric(const T& in) std::string out; while (quotient) { - out += "0123456789"[std::abs((long)quotient % 10)]; + out += "0123456789"[std::llabs(quotient % 10)]; quotient /= 10; } if (in < 0) @@ -105,7 +105,7 @@ template<> inline char ConvToNum(const std::string& in) // We specialise ConvToNum for char to avoid istringstream treating // the input as a character literal. int16_t num = ConvToNum(in); - return num >= INT8_MIN && num <= INT8_MAX ? num : 0; + return num >= INT8_MIN && num <= INT8_MAX ? static_cast(num) : 0; } template<> inline unsigned char ConvToNum(const std::string& in) @@ -113,5 +113,5 @@ template<> inline unsigned char ConvToNum(const std::string& in) // We specialise ConvToNum for unsigned char to avoid istringstream // treating the input as a character literal. uint16_t num = ConvToNum(in); - return num <= UINT8_MAX ? num : 0; + return num <= UINT8_MAX ? static_cast(num) : 0; } diff --git a/include/extensible.h b/include/extensible.h index 036a191d8..cf9e4762c 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -51,9 +51,6 @@ class CoreExport ExtensionItem */ ExtensionItem(Module* owner, const std::string& key, ExtensibleType exttype); - /** Destroys an instance of the ExtensionItem class. */ - virtual ~ExtensionItem() = default; - /** Sets an ExtensionItem using a value in the internal format. * @param container A container the ExtensionItem should be set on. * @param value A value in the internal format. @@ -157,7 +154,7 @@ class CoreExport Extensible Extensible(); Cullable::Result Cull() override; - virtual ~Extensible(); + ~Extensible() override; void UnhookExtensions(const std::vector>& toRemove); /** @@ -205,9 +202,6 @@ class SimpleExtItem : public ExtensionItem { } - /** Destroys an instance of the SimpleExtItem class. */ - virtual ~SimpleExtItem() = default; - inline T* Get(const Extensible* container) const { return static_cast(GetRaw(container)); @@ -257,9 +251,6 @@ class CoreExport StringExtItem : public SimpleExtItem */ StringExtItem(Module* owner, const std::string& key, ExtensibleType exttype, bool sync = false); - /** Destroys an instance of the StringExtItem class. */ - virtual ~StringExtItem() = default; - /** @copydoc ExtensionItem::FromInternal */ void FromInternal(Extensible* container, const std::string& value) noexcept override; @@ -289,9 +280,6 @@ class CoreExport IntExtItem : public ExtensionItem */ IntExtItem(Module* owner, const std::string& key, ExtensibleType exttype, bool sync = false); - /** Destroys an instance of the IntExtItem class. */ - virtual ~IntExtItem() = default; - /** @copydoc ExtensionItem::Delete */ void Delete(Extensible* container, void* item) override; @@ -343,9 +331,6 @@ class CoreExport BoolExtItem : public ExtensionItem */ BoolExtItem(Module* owner, const std::string& key, ExtensibleType exttype, bool sync = false); - /** Destroys an instance of the BoolExtItem class. */ - virtual ~BoolExtItem() = default; - /** @copydoc ExtensionItem::Delete */ void Delete(Extensible* container, void* item) override; diff --git a/include/filelogger.h b/include/filelogger.h index bd4f80151..f5d2caab6 100644 --- a/include/filelogger.h +++ b/include/filelogger.h @@ -36,7 +36,7 @@ class CoreExport FileLogStream : public LogStream public: FileLogStream(LogLevel loglevel, FileWriter *fw); - virtual ~FileLogStream(); + ~FileLogStream() override; void OnLog(LogLevel loglevel, const std::string& type, const std::string& msg) override; }; diff --git a/include/fileutils.h b/include/fileutils.h index a42b5249b..7914610e4 100644 --- a/include/fileutils.h +++ b/include/fileutils.h @@ -34,9 +34,9 @@ class CoreExport FilePosition unsigned int column; /** Initialises a new file position with the specified name, line, and column. - * @param name The name of the file that the position points to. - * @param line The line of the file that this position points to. - * @param column The column of the file that this position points to. + * @param Name The name of the file that the position points to. + * @param Line The line of the file that this position points to. + * @param Column The column of the file that this position points to. */ FilePosition(const std::string& Name, unsigned int Line, unsigned int Column); diff --git a/include/inspircd.h b/include/inspircd.h index 0eb412888..0603ed71f 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -390,6 +390,7 @@ class CoreExport InspIRCd * @param status The exit code to give to the operating system * (See the ExitStatus enum for valid values) */ + [[noreturn]] void Exit(int status); /** Formats the input string with the specified arguments. diff --git a/include/inspsocket.h b/include/inspsocket.h index 66f2a4544..f54fdf95f 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -400,6 +400,8 @@ class CoreExport BufferedSocket : public StreamSocket */ BufferedSocket(int newfd); + ~BufferedSocket() override; + /** Begin connection to the given address * This will create a socket, register with socket engine, and start the asynchronous * connection process. If an error is detected at this point (such as out of file descriptors), @@ -431,7 +433,6 @@ class CoreExport BufferedSocket : public StreamSocket */ virtual void OnTimeout(); - virtual ~BufferedSocket(); protected: void OnEventHandlerWrite() override; BufferedSocketError BeginConnect(const irc::sockets::sockaddrs& dest, const irc::sockets::sockaddrs& bind, unsigned int timeout); diff --git a/include/inspstring.h b/include/inspstring.h index 17093eb7c..e037f735b 100644 --- a/include/inspstring.h +++ b/include/inspstring.h @@ -36,7 +36,7 @@ va_start(_vaList, last); \ ret.assign(InspIRCd::Format(_vaList, format)); \ va_end(_vaList); \ - } while (false); + } while (false) /** Compose a hex string from raw data. * @param raw The raw data to compose hex from (can be NULL if rawsize is 0) diff --git a/include/logger.h b/include/logger.h index 17b694c43..2327fc13d 100644 --- a/include/logger.h +++ b/include/logger.h @@ -70,7 +70,7 @@ class CoreExport FileWriter /** Close the log file and cancel any events. */ - virtual ~FileWriter(); + ~FileWriter(); }; @@ -104,11 +104,6 @@ class CoreExport LogStream : public Cullable { } - /* A LogStream's destructor should do whatever it needs to close any resources it was using (or indicate that it is no longer using a resource - * in the event that the resource is shared, see for example FileLogStream). - */ - virtual ~LogStream() = default; - /** Changes the loglevel for this LogStream on-the-fly. * This is needed for -nofork. But other LogStreams could use it to change loglevels. */ diff --git a/include/mode.h b/include/mode.h index 78695d39c..a1f8e4ec5 100644 --- a/include/mode.h +++ b/include/mode.h @@ -175,7 +175,6 @@ class CoreExport ModeHandler : public ServiceProvider */ ModeHandler(Module* me, const std::string& name, char modeletter, ParamSpec params, ModeType type, Class mclass = MC_OTHER); Cullable::Result Cull() override; - virtual ~ModeHandler() = default; /** Register this object in the ModeParser */ @@ -254,10 +253,8 @@ class CoreExport ModeHandler : public ServiceProvider /** * Called when a channel mode change access check for your mode occurs. * @param source Contains the user setting the mode. - * @param channel contains the destination channel the modes are being set on. - * @param parameter The parameter for your mode. This is modifiable. - * @param adding This value is true when the mode is being set, or false when it is being unset. - * @return allow, deny, or passthru to check against the required level + * @param channel The destination channel the modes are being set on. + * @param change Information regarding the mode change. */ virtual ModResult AccessCheck(User* source, Channel* channel, Modes::Change& change); @@ -266,11 +263,7 @@ class CoreExport ModeHandler : public ServiceProvider * @param source Contains the user setting the mode. * @param dest For usermodes, contains the destination user the mode is being set on. For channelmodes, this is an undefined value. * @param channel For channel modes, contains the destination channel the modes are being set on. For usermodes, this is an undefined value. - * @param parameter The parameter for your mode, if you indicated that your mode requires a parameter when being set or unset. Note that - * if you alter this value, the new value becomes the one displayed and send out to the network, also, if you set this to an empty string - * but you specified your mode REQUIRES a parameter, this is equivalent to returning MODEACTION_DENY and will prevent the mode from being - * displayed. - * @param adding This value is true when the mode is being set, or false when it is being unset. + * @param change Information regarding the mode change. * @return MODEACTION_ALLOW to allow the mode, or MODEACTION_DENY to prevent the mode, also see the description of 'parameter'. */ virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, Modes::Change& change); @@ -299,7 +292,6 @@ class CoreExport ModeHandler : public ServiceProvider */ virtual void OnParameterInvalid(User* user, Channel* targetchannel, User* targetuser, const std::string& parameter); - /** * If your mode is a listmode, this method will be called to display an empty list (just the end of list numeric) * @param user The user issuing the command @@ -397,8 +389,7 @@ class CoreExport PrefixMode : public ModeHandler * Called when a channel mode change access check for your mode occurs. * @param source Contains the user setting the mode. * @param channel contains the destination channel the modes are being set on. - * @param parameter The parameter for your mode. This is modifiable. - * @param adding This value is true when the mode is being set, or false when it is being unset. + * @param change Information regarding the mode change. * @return allow, deny, or passthru to check against the required level */ ModResult AccessCheck(User* source, Channel* channel, Modes::Change& change) override; @@ -410,8 +401,7 @@ class CoreExport PrefixMode : public ModeHandler * @param source Source of the mode change, an error message is sent to this user if the target is not found * @param dest Unused * @param channel The channel the mode change is happening on - * @param param The nickname or uuid of the target user - * @param adding True when the mode is being set, false when it is being unset + * @param change Information regarding the mode change. * @return MODEACTION_ALLOW if the change happened, MODEACTION_DENY if no change happened * The latter occurs either when the member cannot be found or when the member already has this prefix set * (when setting) or doesn't have this prefix set (when unsetting). @@ -513,14 +503,16 @@ class CoreExport ModeWatcher : public Cullable public: ModuleRef creator; + /** * The constructor initializes the mode and the mode type */ ModeWatcher(Module* creator, const std::string& modename, ModeType type); + /** * The default destructor does nothing. */ - virtual ~ModeWatcher(); + ~ModeWatcher() override; /** * Get the mode name being watched @@ -539,22 +531,20 @@ class CoreExport ModeWatcher : public Cullable * @param source The sender of the mode * @param dest The target user for the mode, if you are watching a user mode * @param channel The target channel for the mode, if you are watching a channel mode - * @param parameter The parameter of the mode, if the mode is supposed to have a parameter. + * @param change Information regarding the mode change. * If you alter the parameter you are given, the mode handler will see your atered version * when it handles the mode. - * @param adding True if the mode is being added and false if it is being removed * @return True to allow the mode change to go ahead, false to abort it. If you abort the * change, the mode handler (and ModeWatcher::AfterMode()) will never see the mode change. */ virtual bool BeforeMode(User* source, User* dest, Channel* channel, Modes::Change& change); + /** * After the mode character has been processed by the ModeHandler, this method will be called. * @param source The sender of the mode * @param dest The target user for the mode, if you are watching a user mode * @param channel The target channel for the mode, if you are watching a channel mode - * @param parameter The parameter of the mode, if the mode is supposed to have a parameter. - * You cannot alter the parameter here, as the mode handler has already processed it. - * @param adding True if the mode is being added and false if it is being removed + * @param change Information regarding the mode change. */ virtual void AfterMode(User* source, User* dest, Channel* channel, const Modes::Change& change); }; diff --git a/include/modechange.h b/include/modechange.h index 1bd0cd053..4d21377c5 100644 --- a/include/modechange.h +++ b/include/modechange.h @@ -89,11 +89,7 @@ class Modes::ChangeList items.insert(items.end(), first, last); } - /** Add a new mode to be changed to this ChangeList - * @param mh Mode handler - * @param adding True if this mode is being set, false if removed - * @param param Mode parameter - */ + /** Add a new mode to be changed to this ChangeList. Parameters are forwarded to the Modes::Change constructor. */ template void push(Args&&... args) { diff --git a/include/modules.h b/include/modules.h index c032e0aa3..8560f45c8 100644 --- a/include/modules.h +++ b/include/modules.h @@ -145,7 +145,7 @@ class ModResult ServerInstance->Logs.Log("MODULE", LOG_DEFAULT, "Exception caught: " + modexcept.GetReason()); \ } \ } \ -} while (0); +} while (0) /** * Custom module result handling loop. This is a paired macro, and should only @@ -330,11 +330,6 @@ class CoreExport Module : public Cullable, public usecountbase */ Cullable::Result Cull() override; - /** Default destructor. - * destroys a module class - */ - virtual ~Module() = default; - /** Retrieves link compatibility data for this module. * @param data The location to store link compatibility data. */ @@ -844,10 +839,8 @@ class CoreExport Module : public Cullable, public usecountbase * Return 1 from this function to block the mode character from being processed entirely. * @param user The user who is sending the mode * @param chan The channel the mode is being sent to (or NULL if a usermode) - * @param mh The mode handler for the mode being changed - * @param param The parameter for the mode or an empty string - * @param adding true of the mode is being added, false if it is being removed - * @return ACR_DENY to deny the mode, ACR_DEFAULT to do standard mode checking, and ACR_ALLOW + * @param change Information regarding the mode change. + * @return MOD_RES_DENY to deny the mode, MOD_RES_DEFAULT to do standard mode checking, and MOD_RES_ALLOW * to skip all permission checking. Please note that for remote mode changes, your return value * will be ignored! */ diff --git a/include/modules/cap.h b/include/modules/cap.h index 9f08826db..150393520 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -177,7 +177,7 @@ namespace Cap Unregister(); } - ~Capability() + ~Capability() override { SetActive(false); } diff --git a/include/modules/dns.h b/include/modules/dns.h index aca01b54f..33baa8284 100644 --- a/include/modules/dns.h +++ b/include/modules/dns.h @@ -188,7 +188,7 @@ namespace DNS { } - virtual ~Request() + ~Request() override { manager->RemoveRequest(this); } diff --git a/include/modules/extban.h b/include/modules/extban.h index a8f986e9e..4f0031aef 100644 --- a/include/modules/extban.h +++ b/include/modules/extban.h @@ -256,7 +256,7 @@ class ExtBan::EventListener public: /** Called when an extban is being checked. * @param user The user which the extban is being checked against. - * @param channel The channel which the extban is set on. + * @param chan The channel which the extban is set on. * @param extban The extban which is being checked against. */ virtual ModResult OnExtBanCheck(User* user, Channel* chan, ExtBan::Base* extban) = 0; diff --git a/include/modules/regex.h b/include/modules/regex.h index 6c9f659da..1ae7acd73 100644 --- a/include/modules/regex.h +++ b/include/modules/regex.h @@ -72,7 +72,7 @@ class Regex::Engine virtual PatternPtr Create(const std::string& pattern, uint8_t options = Regex::OPT_NONE) = 0; /** Compiles a regular expression from the human-writable form. - * @param The pattern to compile in the format /pattern/flags. + * @param pattern The pattern to compile in the format /pattern/flags. * @return A shared pointer to an instance of the Regex::Pattern class. */ PatternPtr CreateHuman(const std::string& pattern); @@ -157,8 +157,8 @@ class Regex::Pattern protected: /** Initializes a new instance of the Pattern class. - * @param Pattern The pattern as a string. - * @param Options The options used when matching this pattern. + * @param pattern The pattern as a string. + * @param options The options used when matching this pattern. */ Pattern(const std::string& pattern, uint8_t options) : optionflags(options) diff --git a/include/numeric.h b/include/numeric.h index b6069e85e..79a569c22 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -50,8 +50,9 @@ class Numeric::Numeric { } - /** Add a parameter to the numeric. The parameter will be converted to a string first with ConvToStr(). - * @param x Parameter to add + /** Add a parameter pack to the numeric. + * @param x1 The first element of the parameter pack. + * @param x2 The rest of the parameter pack. */ template Numeric& push(const T1& x1, T2... x2) @@ -59,6 +60,9 @@ class Numeric::Numeric return push(x1).push(std::forward(x2)...); } + /** Add a parameter to the numeric. The parameter will be converted to a string first with ConvToStr(). + * @param x The parameter to add to the numeric. + */ template Numeric& push(const T& x) { diff --git a/include/protocol.h b/include/protocol.h index 721205ba0..de5e21255 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -83,21 +83,21 @@ class CoreExport ProtocolInterface * @param key The 'key' of the data, e.g. "swhois" for swhois desc on a user * @param data The string representation of the data */ - virtual void SendMetaData(Channel* chan, const std::string& key, const std::string& data) { } + virtual void SendMetaData(const Channel* chan, const std::string& key, const std::string& data) { } /** Send metadata for a user to other linked servers. * @param user The user to send metadata for * @param key The 'key' of the data, e.g. "swhois" for swhois desc on a user * @param data The string representation of the data */ - virtual void SendMetaData(User* user, const std::string& key, const std::string& data) { } + virtual void SendMetaData(const User* user, const std::string& key, const std::string& data) { } /** Send metadata for a user to other linked servers. * @param memb The membership to send metadata for * @param key The 'key' of the data, e.g. "swhois" for swhois desc on a user * @param data The string representation of the data */ - virtual void SendMetaData(Membership* memb, const std::string& key, const std::string& data) { } + virtual void SendMetaData(const Membership* memb, const std::string& key, const std::string& data) { } /** Send metadata related to the server to other linked servers. * @param key The 'key' of the data diff --git a/include/socket.h b/include/socket.h index f26a1ae17..0e9475f3e 100644 --- a/include/socket.h +++ b/include/socket.h @@ -196,7 +196,7 @@ class CoreExport ListenSocket : public EventHandler ListenSocket(std::shared_ptr tag, const irc::sockets::sockaddrs& bind_to); /** Close the socket */ - ~ListenSocket(); + ~ListenSocket() override; /** Handles new connections, called by the socket engine */ diff --git a/include/socketengine.h b/include/socketengine.h index af9504310..081c7f904 100644 --- a/include/socketengine.h +++ b/include/socketengine.h @@ -194,10 +194,6 @@ class CoreExport EventHandler : public Cullable */ EventHandler(); - /** Destructor - */ - virtual ~EventHandler() = default; - /** Called by the socket engine in case of a read event */ virtual void OnEventHandlerRead() = 0; @@ -290,6 +286,7 @@ class CoreExport SocketEngine static void LookupMaxFds(); /** Terminates the program when the socket engine fails to initialize. */ + [[noreturn]] static void InitError(); static void OnSetEvent(EventHandler* eh, int old_mask, int new_mask); diff --git a/include/thread.h b/include/thread.h index 3b15d1846..3f71a7037 100644 --- a/include/thread.h +++ b/include/thread.h @@ -40,7 +40,7 @@ class CoreExport Thread virtual void OnStart() = 0; /** Callback which is executed on the calling thread before this thread is stopped. */ - virtual void OnStop() { }; + virtual void OnStop() { } /** Initialises an instance of the Thread class. */ Thread() = default; diff --git a/include/threadsocket.h b/include/threadsocket.h index 5d0d035ec..13e004a80 100644 --- a/include/threadsocket.h +++ b/include/threadsocket.h @@ -48,7 +48,7 @@ class CoreExport SocketThread : public Thread */ void NotifyParent(); SocketThread(); - virtual ~SocketThread(); + ~SocketThread() override; /** Lock queue. */ void LockQueue() diff --git a/include/usermanager.h b/include/usermanager.h index 7192af736..49ebd0cda 100644 --- a/include/usermanager.h +++ b/include/usermanager.h @@ -97,7 +97,7 @@ class CoreExport UserManager /** Number of unregistered users online right now. * (Unregistered means before USER/NICK/dns) */ - unsigned int unregistered_count; + size_t unregistered_count; /** Perform background user events for all local users such as PING checks, registration timeouts, * penalty management and recvq processing for users who have data in their recvq due to throttling. @@ -157,22 +157,22 @@ class CoreExport UserManager /** Return a count of fully registered connections on the network * @return The number of registered users on the network */ - unsigned int RegisteredUserCount() { return this->clientlist.size() - this->UnregisteredUserCount() - this->ServiceCount(); } + size_t RegisteredUserCount() { return this->clientlist.size() - this->UnregisteredUserCount() - this->ServiceCount(); } /** Return a count of local unregistered (before NICK/USER) users * @return The number of local unregistered (unknown) connections */ - unsigned int UnregisteredUserCount() const { return this->unregistered_count; } + size_t UnregisteredUserCount() const { return this->unregistered_count; } /** Return a count of users on a services servers. * @return The number of users on services servers. */ - unsigned int ServiceCount() const { return this->all_services.size(); } + size_t ServiceCount() const { return this->all_services.size(); } /** Return a count of local registered users * @return The number of registered local users */ - unsigned int LocalUserCount() const { return (this->local_users.size() - this->UnregisteredUserCount()); } + size_t LocalUserCount() const { return (this->local_users.size() - this->UnregisteredUserCount()); } /** Get a hash map containing all users, keyed by their nickname * @return A hash map mapping nicknames to User pointers @@ -203,7 +203,7 @@ class CoreExport UserManager User* Find(const std::string& nickuuid); /** Find a user by their nickname. - * @param The nickname of the user to find. + * @param nick The nickname of the user to find. * @return If the user was found then a pointer to a User object; otherwise, nullptr. */ User* FindNick(const std::string& nick); diff --git a/include/users.h b/include/users.h index 96865f5b7..d52e85492 100644 --- a/include/users.h +++ b/include/users.h @@ -620,9 +620,6 @@ class CoreExport User : public Extensible */ void PurgeEmptyChannels(); - /** Default destructor - */ - virtual ~User() = default; Cullable::Result Cull() override; /** @copydoc Serializable::Deserialize */ -- cgit v1.3.1-10-gc9f91