summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-16 23:50:33 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-16 23:50:33 +0000
commitb766b3a5976e3392a833e441ade8c06b47d8aebe (patch)
tree04d35cffd9f84d22059cb150ec4fa3ad6749f537
parent834f4d1bf0c228f35f392808d3882ec3c1a43444 (diff)
Minor edits to fix compile errors/warnings with clang and a small compile warning under Windows (gotta work on the other 450+ Windows warnings sometime).
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@3006 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--ReadFile.cmake1
-rw-r--r--include/configreader.h14
-rw-r--r--include/services.h2
-rw-r--r--src/core/cs_access.c3
-rw-r--r--src/hostserv.c6
-rw-r--r--src/modes.cpp25
-rw-r--r--src/users.c14
7 files changed, 32 insertions, 33 deletions
diff --git a/ReadFile.cmake b/ReadFile.cmake
index 205764d01..be60f1fa7 100644
--- a/ReadFile.cmake
+++ b/ReadFile.cmake
@@ -3,4 +3,3 @@
file(READ "${FILE}" RESULT)
message("${RESULT}")
-
diff --git a/include/configreader.h b/include/configreader.h
index c6dbbefb8..7015eab99 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -453,7 +453,7 @@ class ServerConfig
bool StrictPasswords;
/* How many times you're allowed to give a bad password before being killed */
unsigned BadPassLimit;
- /* How long before bad passwords are forgotten */
+ /* How long before bad passwords are forgotten */
time_t BadPassTimeout;
/* Delay between automatic database updates */
time_t UpdateTimeout;
@@ -510,7 +510,7 @@ class ServerConfig
char *NSGuestNickPrefix;
/* Allow users to set kill immed on */
bool NSAllowKillImmed;
- /* Don't allow nicks to use /ns group to regroup nicks */
+ /* Don't allow nicks to use /ns group to regroup nicks */
bool NSNoGroupChange;
/* Default flags for newly registered nicks */
Flags<NickCoreFlag> NSDefFlags;
@@ -579,9 +579,9 @@ class ServerConfig
unsigned MSMaxMemos;
/* Time you must wait between sending memos */
time_t MSSendDelay;
- /* Notify all of the aliases of the core the memo was sent to */
+ /* Notify all of the aliases of the core the memo was sent to */
bool MSNotifyAll;
- /* Who can use memos reciepts */
+ /* Who can use memos reciepts */
unsigned MSMemoReceipt;
/* Defai;t BotServ flags */
@@ -686,13 +686,13 @@ class ServerConfig
unsigned DefSessionLimit;
/* How long before exceptions expire */
time_t ExceptionExpiry;
- /* How many times to kill before adding an KILL */
+ /* How many times to kill before adding an KILL */
int MaxSessionKill;
/* Max limit that can be used for exceptions */
unsigned MaxSessionLimit;
/* How long session akills should last */
time_t SessionAutoKillExpiry;
- /* Reason to use for session kills */
+ /* Reason to use for session kills */
char *SessionLimitExceeded;
/* Optional second reason */
char *SessionLimitDetailsLoc;
@@ -776,7 +776,7 @@ class ConfigException : public CoreException
* Actually no, it does nothing. Never mind.
* @throws Nothing!
*/
- virtual ~ConfigException() throw() { };
+ virtual ~ConfigException() throw() { }
};
#define CONF_NO_ERROR 0x000000
diff --git a/include/services.h b/include/services.h
index a38c8a207..2741e0178 100644
--- a/include/services.h
+++ b/include/services.h
@@ -456,7 +456,7 @@ class CoreExport HostInfo
* @param creator Who created the vhost
* @param time When the vhost was craated
*/
- void SetVhost(const std::string &ident, const std::string &host, const std::string &creator, time_t time = time(NULL));
+ void SetVhost(const std::string &ident, const std::string &host, const std::string &creator, time_t created = time(NULL));
/** Remove a users vhost
**/
diff --git a/src/core/cs_access.c b/src/core/cs_access.c
index fdca01dfd..bc68c8c58 100644
--- a/src/core/cs_access.c
+++ b/src/core/cs_access.c
@@ -88,7 +88,7 @@ static int access_view(User *u, int index, ChannelInfo *ci, int *sent_header)
if (!access || !access->in_use)
return 0;
-
+
if (!*sent_header)
{
notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LIST_HEADER, ci->name.c_str());
@@ -121,6 +121,7 @@ static int access_view_callback(User *u, int num, va_list args)
{
ChannelInfo *ci = va_arg(args, ChannelInfo *);
int *sent_header = va_arg(args, int *);
+ if (num < 1 || num > ci->GetAccessCount())
return 0;
return access_view(u, num - 1, ci, sent_header);
}
diff --git a/src/hostserv.c b/src/hostserv.c
index 262bf30b0..53ccd57da 100644
--- a/src/hostserv.c
+++ b/src/hostserv.c
@@ -111,12 +111,12 @@ void hostserv(User * u, char *buf)
* @param creator Who created the vhost
* @param time When the vhost was craated
*/
-void HostInfo::SetVhost(const std::string &ident, const std::string &host, const std::string &creator, time_t time)
+void HostInfo::SetVhost(const std::string &ident, const std::string &host, const std::string &creator, time_t created)
{
Ident = ident;
Host = host;
Creator = creator;
- Time = time;
+ Time = created;
}
/** Remove a users vhost
@@ -197,7 +197,7 @@ void do_on_id(User *u)
NickAlias *na = findnick(u->nick);
if (!na || !na->hostinfo.HasVhost())
return;
-
+
if (!u->vhost || u->vhost != na->hostinfo.GetHost() || (!na->hostinfo.GetIdent().empty() && u->GetVIdent() != na->hostinfo.GetIdent()))
{
ircdproto->SendVhost(u, na->hostinfo.GetIdent(), na->hostinfo.GetHost());
diff --git a/src/modes.cpp b/src/modes.cpp
index 5d20c8b7e..3b3c1045f 100644
--- a/src/modes.cpp
+++ b/src/modes.cpp
@@ -480,17 +480,16 @@ void StackerInfo::AddMode(void *Mode, bool Set, const std::string &Param)
*/
StackerInfo *ModeManager::GetInfo(void *Item)
{
- for (std::list<std::pair<void *, StackerInfo *> >::const_iterator it = StackerObjects.begin(); it !=
-StackerObjects.end(); ++it)
- {
- const std::pair<void *, StackerInfo *> &PItem = *it;
- if (PItem.first == Item)
- return PItem.second;
- }
+ for (std::list<std::pair<void *, StackerInfo *> >::const_iterator it = StackerObjects.begin(); it != StackerObjects.end(); ++it)
+ {
+ const std::pair<void *, StackerInfo *> &PItem = *it;
+ if (PItem.first == Item)
+ return PItem.second;
+ }
- StackerInfo *s = new StackerInfo;
- StackerObjects.push_back(std::make_pair(Item, s));
- return s;
+ StackerInfo *s = new StackerInfo;
+ StackerObjects.push_back(std::make_pair(Item, s));
+ return s;
}
/** Build a list of mode strings to send to the IRCd from the mode stacker
@@ -566,7 +565,7 @@ std::list<std::string> ModeManager::BuildModeStrings(StackerInfo *info)
if (!buf.empty())
ret.push_back(buf + parambuf);
-
+
return ret;
}
@@ -628,7 +627,7 @@ bool ModeManager::AddUserMode(UserMode *um)
um->Name = static_cast<UserModeName>(UMODE_END + ++GenericUserModes);
Alog() << "ModeManager: Added generic support for user mode " << um->ModeChar;
}
- ModeManager::UserModesByName.insert(std::make_pair(um->Name, um)).second;
+ ModeManager::UserModesByName.insert(std::make_pair(um->Name, um));
ModeManager::Modes.push_back(um);
FOREACH_MOD(I_OnUserModeAdd, OnUserModeAdd(um));
@@ -652,7 +651,7 @@ bool ModeManager::AddChannelMode(ChannelMode *cm)
cm->Name = static_cast<ChannelModeName>(CMODE_END + ++GenericChannelModes);
Alog() << "ModeManager: Added generic support for channel mode " << cm->ModeChar;
}
- ModeManager::ChannelModesByName.insert(std::make_pair(cm->Name, cm)).second;
+ ModeManager::ChannelModesByName.insert(std::make_pair(cm->Name, cm));
ModeManager::Modes.push_back(cm);
/* Apply this mode to the new default mlock if its used */
diff --git a/src/users.c b/src/users.c
index 4ff223ee6..8614a6beb 100644
--- a/src/users.c
+++ b/src/users.c
@@ -243,12 +243,12 @@ User::~User()
if (is_oper(this))
opcnt--;
-
+
while (!this->chans.empty())
{
this->chans.front()->chan->DeleteUser(this);
}
-
+
if (this->prev)
this->prev->next = this->next;
else
@@ -460,7 +460,7 @@ void User::Logout()
{
if (!this->nc)
return;
-
+
std::list<User *>::iterator it = std::find(this->nc->Users.begin(), this->nc->Users.end(), this);
if (it != this->nc->Users.end())
{
@@ -492,7 +492,7 @@ const bool User::IsIdentified(bool CheckNick) const
{
return true;
}
-
+
return false;
}
@@ -955,7 +955,7 @@ User *do_nick(const char *source, const char *nick, const char *username, const
{
const char *logrealname = normalizeBuffer(user->realname);
Alog() << "LOGUSERS: " << user->nick << " (" << user->GetIdent() << "@" << user->host
- << (ircd->vhost ? " => " : "") << (ircd->vhost ? user->GetDisplayedHost() : "") << ") ("
+ << (ircd->vhost ? " => " : "") << (ircd->vhost ? user->GetDisplayedHost() : "") << ") ("
<< logrealname << ") " << "changed nick to " << nick << " (" << user->server->name << ").";
if (logrealname)
delete [] logrealname;
@@ -1082,7 +1082,7 @@ void do_kill(const std::string &nick, const std::string &msg)
return;
}
Alog(LOG_DEBUG) << nick << " killed";
- if ((na = findnick(user->nick)) && !na->HasFlag(NS_FORBIDDEN) && !na->nc->HasFlag(NI_SUSPENDED) && (user->IsRecognized() || user->IsIdentified(true)))
+ if ((na = findnick(user->nick)) && !na->HasFlag(NS_FORBIDDEN) && !na->nc->HasFlag(NI_SUSPENDED) && (user->IsRecognized() || user->IsIdentified(true)))
{
na->last_seen = time(NULL);
if (na->last_quit)
@@ -1267,7 +1267,7 @@ void UserSetInternalModes(User *user, int ac, const char **av)
Alog(LOG_DEBUG) << "Changing user modes for " << user->nick << " to " << merge_args(ac, av);
- for (; *modes; *modes++)
+ for (; *modes; modes++)
{
UserMode *um;