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 --- src/core/cs_list.c | 4 +--- src/core/os_akill.c | 2 +- src/core/os_news.c | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/core') diff --git a/src/core/cs_list.c b/src/core/cs_list.c index 68975cadf..93ffeffa5 100644 --- a/src/core/cs_list.c +++ b/src/core/cs_list.c @@ -36,9 +36,7 @@ public: int count = 0, from = 0, to = 0, tofree = 0; char *tmp = NULL; char *s = NULL; - bool forbidden, suspended, channoexpire; - - forbidden = suspended = noexpire = false; + bool forbidden = false, suspended = false, channoexpire = false; if (!(!CSListOpersOnly || (is_oper(u)))) { diff --git a/src/core/os_akill.c b/src/core/os_akill.c index d7f2cddbd..32169e2d4 100644 --- a/src/core/os_akill.c +++ b/src/core/os_akill.c @@ -176,7 +176,7 @@ class CommandOSAKill : public Command } else { - if ((res = slist_indexof(&akills, (void *)mask)) == -1) + if ((res = slist_indexof(&akills, const_cast(static_cast(mask)))) == -1) // XXX: possibly unsafe cast { notice_lang(s_OperServ, u, OPER_AKILL_NOT_FOUND, mask); return MOD_CONT; diff --git a/src/core/os_news.c b/src/core/os_news.c index e06be7223..6720dd026 100644 --- a/src/core/os_news.c +++ b/src/core/os_news.c @@ -109,7 +109,7 @@ void load_news() news = new NewsItem; SAFE(read_int16(&type, f)); - news->type = (NewsType)type; + news->type = static_cast(type); SAFE(read_int32(&news->num, f)); SAFE(read_string(&text, f)); news->Text = text; @@ -219,7 +219,7 @@ static void DisplayNews(User *u, NewsType Type) static int add_newsitem(User * u, const char *text, NewsType type) { int num = 0; - + for (unsigned i = News.size(); i > 0; --i) { if (News[i - 1]->type == type) @@ -228,7 +228,7 @@ static int add_newsitem(User * u, const char *text, NewsType type) break; } } - + NewsItem *news = new NewsItem; news->type = type; news->num = num + 1; -- cgit