From e10fe1cd767cf479837eecc1e1b26615d63ea5ac Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Tue, 17 Nov 2009 04:04:24 +0000 Subject: Removed some unnecessary casts, used C++-style casts over C-style casts, fixed a few warnings (one possibly fatal one). git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2655 5417fbe8-f217-4b02-8779-1006273d7864 --- include/services.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/services.h b/include/services.h index 1c0c5f6ea..79ba6482d 100644 --- a/include/services.h +++ b/include/services.h @@ -421,19 +421,18 @@ class CoreExport Extensible /** Class with the ability to keep flags on items, they should extend from this * where T is an enum. */ -template -class CoreExport Flags +template class CoreExport Flags { protected: - std::bitset<128> Flag_Values; + std::bitset<128> Flag_Values; public: - /** Add a flag to this item + /** Add a flag to this item * @param Value The flag */ void SetFlag(T Value) { - Flag_Values[(size_t)Value] = true; + Flag_Values[Value] = true; } /** Remove a flag from this item @@ -441,22 +440,22 @@ class CoreExport Flags */ void UnsetFlag(T Value) { - Flag_Values[(size_t)Value] = false; + Flag_Values[Value] = false; } /** Check if this item has a flag * @param Value The flag * @return true or false */ - const bool HasFlag(T Value) const + bool HasFlag(T Value) const { - return Flag_Values[(size_t)Value]; + return Flag_Values[Value]; } /** Check how many flags are set * @return The number of flags set */ - const size_t FlagCount() const + size_t FlagCount() const { return Flag_Values.count(); } @@ -1838,7 +1837,7 @@ class NickServRelease : public Timer * @param delay The delay before the nick is released */ NickServRelease(NickAlias *nickalias, time_t delay); - + /** Default destructor */ ~NickServRelease(); -- cgit