diff options
author | Adam <Adam@anope.org> | 2012-02-18 15:04:26 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-02-18 15:04:26 -0500 |
commit | ee5cd8493e34a1c049066ead25e9094b30cd49b5 (patch) | |
tree | 846c6dcd9bb2c4d721c6290a9b9d6b6ed880acdb /include | |
parent | 41e8d276023e8fefc22fb89c2f81ae17b8222155 (diff) |
Use C++11's explicit override feature if available
Diffstat (limited to 'include')
-rw-r--r-- | include/CMakeLists.txt | 2 | ||||
-rw-r--r-- | include/account.h | 8 | ||||
-rw-r--r-- | include/dns.h | 4 | ||||
-rw-r--r-- | include/memo.h | 4 | ||||
-rw-r--r-- | include/modes.h | 8 | ||||
-rw-r--r-- | include/regchannel.h | 20 | ||||
-rw-r--r-- | include/services.h | 6 | ||||
-rw-r--r-- | include/signals.h | 2 | ||||
-rw-r--r-- | include/sockets.h | 22 |
9 files changed, 41 insertions, 35 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index e04fe31a8..049aa478a 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -19,7 +19,7 @@ endif(NOT WIN32) set(PCH_SOURCES_GCH "") if(CMAKE_COMPILER_IS_GNUCXX) - string(REPLACE " " ";" PCH_CXXFLAGS ${CXXFLAGS}) + string(REPLACE " " ";" PCH_CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_FLAGS}") file(GLOB PCH_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h") sort_list(PCH_SOURCES) diff --git a/include/account.h b/include/account.h index ffdc7b18f..5cc8c1459 100644 --- a/include/account.h +++ b/include/account.h @@ -132,8 +132,8 @@ class CoreExport NickAlias : public Base, public Extensible, public Flags<NickNa time_t last_seen; /* When it was seen online for the last time */ NickCore *nc; /* I'm an alias of this */ - Anope::string serialize_name() const; - serialized_data serialize(); + Anope::string serialize_name() const anope_override; + serialized_data serialize() anope_override; static void unserialize(serialized_data &); /** Release a nick @@ -216,8 +216,8 @@ class CoreExport NickCore : public Base, public Extensible, public Flags<NickCor time_t lastmail; /* Last time this nick record got a mail */ std::list<NickAlias *> aliases; /* List of aliases */ - Anope::string serialize_name() const; - serialized_data serialize(); + Anope::string serialize_name() const anope_override; + serialized_data serialize() anope_override; static void unserialize(serialized_data &); /** Checks whether this account is a services oper or not. diff --git a/include/dns.h b/include/dns.h index c70b6b7b3..3102ec72c 100644 --- a/include/dns.h +++ b/include/dns.h @@ -121,7 +121,7 @@ class CoreExport DNSRequest : public Timer, public Question virtual void OnError(const DNSQuery *r); - void Tick(time_t); + void Tick(time_t) anope_override; }; /** A full packet sent or recieved to/from the nameserver, may contain multiple queries @@ -182,7 +182,7 @@ class CoreExport DNSManager : public Timer, public Socket /** Tick this timer, used to clear the DNS cache. */ - void Tick(time_t now); + void Tick(time_t now) anope_override; /** Cleanup all pending DNS queries for a module * @param mod The module diff --git a/include/memo.h b/include/memo.h index a6df46861..420def504 100644 --- a/include/memo.h +++ b/include/memo.h @@ -38,8 +38,8 @@ class CoreExport Memo : public Flags<MemoFlag>, public Serializable public: Memo(); - Anope::string serialize_name() const; - serialized_data serialize(); + Anope::string serialize_name() const anope_override; + serialized_data serialize() anope_override; static void unserialize(serialized_data &); Anope::string owner; diff --git a/include/modes.h b/include/modes.h index b1195d27d..9cfc607cc 100644 --- a/include/modes.h +++ b/include/modes.h @@ -304,7 +304,7 @@ class CoreExport ChannelModeKey : public ChannelModeParam public: ChannelModeKey(char modeChar) : ChannelModeParam(CMODE_KEY, modeChar) { } - bool IsValid(const Anope::string &value) const; + bool IsValid(const Anope::string &value) const anope_override; }; /** This class is used for channel mode +A (Admin only) @@ -316,7 +316,7 @@ class CoreExport ChannelModeAdmin : public ChannelMode ChannelModeAdmin(char modeChar) : ChannelMode(CMODE_ADMINONLY, modeChar) { } /* Opers only */ - bool CanSet(User *u) const; + bool CanSet(User *u) const anope_override; }; /** This class is used for channel mode +O (Opers only) @@ -328,7 +328,7 @@ class CoreExport ChannelModeOper : public ChannelMode ChannelModeOper(char modeChar) : ChannelMode(CMODE_OPERONLY, modeChar) { } /* Opers only */ - bool CanSet(User *u) const; + bool CanSet(User *u) const anope_override; }; /** This class is used for channel mode +r (registered channel) @@ -340,7 +340,7 @@ class CoreExport ChannelModeRegistered : public ChannelMode ChannelModeRegistered(char modeChar) : ChannelMode(CMODE_REGISTERED, modeChar) { } /* No one mlocks +r */ - bool CanSet(User *u) const; + bool CanSet(User *u) const anope_override; }; enum StackerType diff --git a/include/regchannel.h b/include/regchannel.h index 614b98f19..851d98f19 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -88,8 +88,8 @@ struct CoreExport BadWord : Serializable Anope::string word; BadWordType type; - Anope::string serialize_name() const; - serialized_data serialize(); + Anope::string serialize_name() const anope_override; + serialized_data serialize() anope_override; static void unserialize(serialized_data &); }; @@ -118,8 +118,8 @@ class CoreExport AutoKick : public Flags<AutoKickFlag>, public Serializable time_t addtime; time_t last_used; - Anope::string serialize_name() const; - serialized_data serialize(); + Anope::string serialize_name() const anope_override; + serialized_data serialize() anope_override; static void unserialize(serialized_data &); }; @@ -135,8 +135,8 @@ struct CoreExport ModeLock : Serializable ModeLock(ChannelInfo *ch, bool s, ChannelModeName n, const Anope::string &p, const Anope::string &se = "", time_t c = Anope::CurTime); - Anope::string serialize_name() const; - serialized_data serialize(); + Anope::string serialize_name() const anope_override; + serialized_data serialize() anope_override; static void unserialize(serialized_data &); }; @@ -153,8 +153,8 @@ struct CoreExport LogSetting : Serializable Anope::string creator; time_t created; - Anope::string serialize_name() const; - serialized_data serialize(); + Anope::string serialize_name() const anope_override; + serialized_data serialize() anope_override; static void unserialize(serialized_data &); }; @@ -212,8 +212,8 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, int16_t floodlines, floodsecs; /* For FLOOD kicker */ int16_t repeattimes; /* For REPEAT kicker */ - Anope::string serialize_name() const; - serialized_data serialize(); + Anope::string serialize_name() const anope_override; + serialized_data serialize() anope_override; static void unserialize(serialized_data &); /** Change the founder of the channek diff --git a/include/services.h b/include/services.h index abe262cad..c03991a13 100644 --- a/include/services.h +++ b/include/services.h @@ -53,6 +53,12 @@ # include "anope_windows.h" #endif +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define anope_override override +#else +# define anope_override +#endif + /** * RFC: defination of a valid nick * nickname = ( letter / special ) *8( letter / digit / special / "-" ) diff --git a/include/signals.h b/include/signals.h index 70fdead42..f057bdfee 100644 --- a/include/signals.h +++ b/include/signals.h @@ -42,7 +42,7 @@ class Signal : public Pipe * important. This is always called on the main thread, even on systems that * spawn threads for signals, like Windows. */ - virtual void OnNotify() = 0; + virtual void OnNotify() anope_override = 0; }; #endif diff --git a/include/sockets.h b/include/sockets.h index a7a8bb257..16cd10a1a 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -272,12 +272,12 @@ class CoreExport BufferedSocket : public virtual Socket /** Called when there is something to be received for this socket * @return true on success, false to drop this socket */ - bool ProcessRead(); + bool ProcessRead() anope_override; /** Called when the socket is ready to be written to * @return true on success, false to drop this socket */ - bool ProcessWrite(); + bool ProcessWrite() anope_override; /** Called with a line received from the socket * @param buf The line @@ -327,12 +327,12 @@ class CoreExport BinarySocket : public virtual Socket /** Called when there is something to be received for this socket * @return true on success, false to drop this socket */ - bool ProcessRead(); + bool ProcessRead() anope_override; /** Called when the socket is ready to be written to * @return true on success, false to drop this socket */ - bool ProcessWrite(); + bool ProcessWrite() anope_override; /** Write data to the socket * @param buffer The data to write @@ -395,12 +395,12 @@ class CoreExport ConnectionSocket : public virtual Socket * Used to determine whether or not this socket is connected yet. * @return true to continue to call ProcessRead/ProcessWrite, false to not continue */ - bool Process(); + bool Process() anope_override; /** Called when there is an error for this socket * @return true on success, false to drop this socket */ - void ProcessError(); + void ProcessError() anope_override; /** Called on a successful connect */ @@ -430,12 +430,12 @@ class CoreExport ClientSocket : public virtual Socket * Used to determine whether or not this socket is connected yet. * @return true to continue to call ProcessRead/ProcessWrite, false to not continue */ - bool Process(); + bool Process() anope_override; /** Called when there is an error for this socket * @return true on success, false to drop this socket */ - void ProcessError(); + void ProcessError() anope_override; /** Called when a client has been accepted() successfully. */ @@ -464,15 +464,15 @@ class CoreExport Pipe : public Socket /** Called when data is to be read */ - bool ProcessRead(); + bool ProcessRead() anope_override; /** Called when this pipe needs to be woken up */ void Notify(); - /** Should be overloaded to do something useful + /** Overload to do something useful */ - virtual void OnNotify(); + virtual void OnNotify() = 0; }; extern uint32_t TotalRead; |