summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-19 21:59:31 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-19 21:59:31 +0000
commit7723437a81ee0858a448ad599889469c4113dd57 (patch)
treef13ec2db84506c7767d25cd4f860e631ac94f890
parent805253de3686a9710bebec05bf857974ae9a80e4 (diff)
Fix a few warnings. Also move split_usermask into cs_akick, as this is the only place it is used.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2119 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--include/extern.h2
-rw-r--r--src/Makefile3
-rw-r--r--src/core/cs_akick.c33
-rw-r--r--src/module.cpp1
-rw-r--r--src/nickserv.c2
-rw-r--r--src/tools/anopesmtp.c2
-rw-r--r--src/tools/db-convert.c2
-rw-r--r--src/users.c40
8 files changed, 38 insertions, 47 deletions
diff --git a/include/extern.h b/include/extern.h
index 13ed0074d..0539593a0 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -934,8 +934,6 @@ E int is_excepted(ChannelInfo * ci, User * user);
E int is_excepted_mask(ChannelInfo * ci, const char *mask);
E int match_usermask(const char *mask, User * user);
-E void split_usermask(const char *mask, char **nick, char **user,
- char **host);
E char *create_mask(User * u);
diff --git a/src/Makefile b/src/Makefile
index 5320560df..72b9776b9 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,5 @@
OBJS = actions.o base64.o bots.o botserv.o channels.o chanserv.o command.o commands.o compat.o \
- config.o datafiles.o encrypt.o events.o hashcomp.o hostserv.o init.o ircd.o language.o log.o mail.o main.o \
+ config.o datafiles.o encrypt.o hashcomp.o hostserv.o init.o ircd.o language.o log.o mail.o main.o \
memory.o memoserv.o messages.o misc.o modules.o news.o nickserv.o operserv.o \
process.o protocol.o send.o servers.o sessions.o slist.o sockutil.o opertype.o timeout.o users.o module.o modulemanager.o configreader.o \
wildcard.o nickcore.o nickalias.o
@@ -47,7 +47,6 @@ compat.o: compat.c $(INCLUDES)
config.o: config.c $(INCLUDES)
datafiles.o: datafiles.c $(INCLUDES)
encrypt.o: encrypt.c $(INCLUDES)
-events.o: events.c $(INCLUDES)
init.o: init.c $(INCLUDES)
ircd.o: ircd.c $(INCLUDES)
hostserv.o: hostserv.c $(INCLUDES)
diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c
index 50a0d8257..9be8e34e0 100644
--- a/src/core/cs_akick.c
+++ b/src/core/cs_akick.c
@@ -20,6 +20,37 @@ void myChanServHelp(User * u);
+/* Split a usermask up into its constitutent parts. Returned strings are
+ * malloc()'d, and should be free()'d when done with. Returns "*" for
+ * missing parts.
+ */
+
+static void split_usermask(const char *mask, const char **nick, const char **user,
+ const char **host)
+{
+ char *mask2 = sstrdup(mask);
+
+ *nick = strtok(mask2, "!");
+ *user = strtok(NULL, "@");
+ *host = strtok(NULL, "");
+ /* Handle special case: mask == user@host */
+ if (*nick && !*user && strchr(*nick, '@')) {
+ *nick = NULL;
+ *user = strtok(mask2, "@");
+ *host = strtok(NULL, "");
+ }
+ if (!*nick)
+ *nick = "*";
+ if (!*user)
+ *user = "*";
+ if (!*host)
+ *host = "*";
+ *nick = sstrdup(*nick);
+ *user = sstrdup(*user);
+ *host = sstrdup(*host);
+ delete [] mask2;
+}
+
/**
* Add the help response to anopes /cs help output.
@@ -194,7 +225,7 @@ class CommandCSAKick : public Command
} else if (stricmp(cmd, "ADD") == 0) {
NickAlias *na = findnick(mask), *na2;
NickCore *nc = NULL;
- char *nick, *user, *host;
+ const char *nick, *user, *host;
int freemask = 0;
if (readonly) {
diff --git a/src/module.cpp b/src/module.cpp
index e080ac868..f5cc178d2 100644
--- a/src/module.cpp
+++ b/src/module.cpp
@@ -71,7 +71,6 @@ Module::~Module()
CommandHash *current = NULL;
Command *c;
- int status = 0;
/* Kill any active callbacks this module has */
moduleCallBackPrepForUnload(this->name.c_str());
diff --git a/src/nickserv.c b/src/nickserv.c
index 99487a447..45db1be87 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -227,7 +227,7 @@ void load_ns_dbase()
int failed = 0;
uint16 tmp16;
uint32 tmp32;
- char *s, *pass;
+ char *s;
if (!(f = open_db(s_NickServ, NickDBName, "r", NICK_VERSION)))
return;
diff --git a/src/tools/anopesmtp.c b/src/tools/anopesmtp.c
index 80e49caa0..bf1cc68df 100644
--- a/src/tools/anopesmtp.c
+++ b/src/tools/anopesmtp.c
@@ -318,7 +318,7 @@ int smtp_connect(char *host, unsigned short port)
/*************************************************************************/
/* Send a line of text */
-int smtp_send(char *text)
+int smtp_send(const char *text)
{
int result = ano_sockwrite(mail.sock, text, strlen(text));
diff --git a/src/tools/db-convert.c b/src/tools/db-convert.c
index 23170e5fb..5fb7bfd57 100644
--- a/src/tools/db-convert.c
+++ b/src/tools/db-convert.c
@@ -318,7 +318,6 @@ const std::string GetLanguageID(int id)
int main(int argc, char *argv[])
{
dbFILE *f;
- HostCore *firsthc = NULL;
std::ofstream fs;
std::string hashm;
@@ -816,7 +815,6 @@ int main(int argc, char *argv[])
ChannelInfo *ci;
- Memo *memos;
for (i = 0; i < 256; i++)
{
diff --git a/src/users.c b/src/users.c
index 5bda7db9d..dd232e713 100644
--- a/src/users.c
+++ b/src/users.c
@@ -694,9 +694,9 @@ User *do_nick(const char *source, const char *nick, const char *username, const
if (!nc_changed)
{
- NickAlias *tmp = findnick(user->nick);
- if (tmp)
- tmp->status |= status;
+ NickAlias *tmpcore = findnick(user->nick);
+ if (tmpcore)
+ tmpcore->status |= status;
}
else
{
@@ -726,7 +726,6 @@ User *do_nick(const char *source, const char *nick, const char *username, const
}
else
{
- char tsbuf[16];
ntmp->last_seen = time(NULL);
if (ntmp->last_usermask)
@@ -947,39 +946,6 @@ int match_usermask(const char *mask, User * user)
/*************************************************************************/
-/* Split a usermask up into its constitutent parts. Returned strings are
- * malloc()'d, and should be free()'d when done with. Returns "*" for
- * missing parts.
- */
-
-void split_usermask(const char *mask, char **nick, char **user,
- char **host)
-{
- char *mask2 = sstrdup(mask);
-
- *nick = strtok(mask2, "!");
- *user = strtok(NULL, "@");
- *host = strtok(NULL, "");
- /* Handle special case: mask == user@host */
- if (*nick && !*user && strchr(*nick, '@')) {
- *nick = NULL;
- *user = strtok(mask2, "@");
- *host = strtok(NULL, "");
- }
- if (!*nick)
- *nick = "*";
- if (!*user)
- *user = "*";
- if (!*host)
- *host = "*";
- *nick = sstrdup(*nick);
- *user = sstrdup(*user);
- *host = sstrdup(*host);
- delete [] mask2;
-}
-
-/*************************************************************************/
-
/* Given a user, return a mask that will most likely match any address the
* user will have from that location. For IP addresses, wildcards the
* appropriate subnet mask (e.g. 35.1.1.1 -> 35.*; 128.2.1.1 -> 128.2.*);