summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:09 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:09 +0000
commit29aea837f59c17fad0dc6020a488124f3ea7d630 (patch)
tree94701c01ec03db1a096e4f457fa9601891321ca7 /src
parent1e918b949ce6d96b7f294f659d907546e5d60e44 (diff)
Various strict fixes..
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1185 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/core/enc_md5.c32
-rw-r--r--src/core/enc_old.c32
-rw-r--r--src/core/enc_sha1.c6
-rw-r--r--src/core/hs_delall.c2
-rw-r--r--src/core/hs_group.c2
-rw-r--r--src/core/hs_set.c2
-rw-r--r--src/core/hs_setall.c4
-rw-r--r--src/core/ms_list.c12
-rw-r--r--src/core/ns_access.c4
-rw-r--r--src/core/ns_forbid.c4
-rw-r--r--src/core/ns_group.c10
-rw-r--r--src/core/ns_identify.c2
-rw-r--r--src/core/ns_register.c16
-rw-r--r--src/core/ns_saset.c4
-rw-r--r--src/core/ns_set.c4
-rw-r--r--src/core/ns_suspend.c2
-rw-r--r--src/core/os_admin.c4
-rw-r--r--src/core/os_akill.c15
-rw-r--r--src/core/os_kick.c8
-rw-r--r--src/core/os_oper.c4
-rw-r--r--src/core/os_quit.c4
-rw-r--r--src/core/os_reload.c4
-rw-r--r--src/core/os_restart.c4
-rw-r--r--src/core/os_sgline.c8
-rw-r--r--src/core/os_shutdown.c4
-rw-r--r--src/core/os_sqline.c8
-rw-r--r--src/core/os_staff.c6
27 files changed, 90 insertions, 117 deletions
diff --git a/src/core/enc_md5.c b/src/core/enc_md5.c
index 69344d7e6..3238adb4a 100644
--- a/src/core/enc_md5.c
+++ b/src/core/enc_md5.c
@@ -120,8 +120,7 @@ Rotation is separate from addition to prevent recomputation.
/* MD5 initialization. Begins an MD5 operation, writing a new context.
*/
-void MD5Init (context)
-MD5_CTX *context; /* context */
+void MD5Init(MD5_CTX *context)
{
context->count[0] = context->count[1] = 0;
/* Load magic initialization constants.
@@ -136,10 +135,7 @@ MD5_CTX *context; /* context */
operation, processing another message block, and updating the
context.
*/
-void MD5Update (context, input, inputLen)
-MD5_CTX *context; /* context */
-unsigned char *input; /* input block */
-unsigned int inputLen; /* length of input block */
+void MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
{
unsigned int i, index, partLen;
@@ -178,9 +174,7 @@ unsigned int inputLen; /* length of input block */
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
the message digest and zeroizing the context.
*/
-void MD5Final (digest, context)
-unsigned char digest[16]; /* message digest */
-MD5_CTX *context; /* context */
+void MD5Final (unsigned char digest[16], MD5_CTX *context)
{
unsigned char bits[8];
unsigned int index, padLen;
@@ -206,9 +200,7 @@ MD5_CTX *context; /* context */
/* MD5 basic transformation. Transforms state based on block.
*/
-void MD5Transform (state, block)
-UINT4 state[4];
-unsigned char block[64];
+void MD5Transform (UINT4 state[4], unsigned char block[64])
{
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
@@ -299,10 +291,7 @@ unsigned char block[64];
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
a multiple of 4.
*/
-void Encode (output, input, len)
-unsigned char *output;
-UINT4 *input;
-unsigned int len;
+void Encode (unsigned char *output, UINT4 *input, unsigned int len)
{
unsigned int i, j;
@@ -317,10 +306,7 @@ unsigned int len;
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
a multiple of 4.
*/
-void Decode (output, input, len)
-UINT4 *output;
-unsigned char *input;
-unsigned int len;
+void Decode (UINT4 *output, unsigned char *input, unsigned int len)
{
unsigned int i, j;
@@ -344,12 +330,12 @@ int md5_encrypt(const char *src, int len, char *dest, int size)
return -1;
MD5Init(&context);
- MD5Update(&context, src, len);
- MD5Final(dest, &context);
+ MD5Update(&context, (unsigned char *)src, len);
+ MD5Final((unsigned char *)dest, &context);
if(debug) {
memset(tmp,0,33);
- binary_to_hex(dest,tmp,16);
+ binary_to_hex((unsigned char *)dest,tmp,16);
/* Dont log source if we were encrypting in place :) */
if (memcmp(src, dest, 16) != 0) {
alog("enc_md5: hashed from [%s] to [%s]",src,tmp);
diff --git a/src/core/enc_old.c b/src/core/enc_old.c
index 8c7d88e8e..77c1964c0 100644
--- a/src/core/enc_old.c
+++ b/src/core/enc_old.c
@@ -138,8 +138,7 @@ Rotation is separate from addition to prevent recomputation.
/* MD5 initialization. Begins an MD5 operation, writing a new context.
*/
-static void MD5Init(context)
-MD5_CTX *context; /* context */
+static void MD5Init(MD5_CTX *context)
{
context->count[0] = context->count[1] = 0;
/* Load magic initialization constants.
@@ -154,10 +153,7 @@ MD5_CTX *context; /* context */
operation, processing another message block, and updating the
context.
*/
-static void MD5Update(context, input, inputLen)
-MD5_CTX *context; /* context */
-unsigned char *input; /* input block */
-unsigned int inputLen; /* length of input block */
+static void MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
{
unsigned int i, index, partLen;
@@ -195,9 +191,7 @@ unsigned int inputLen; /* length of input block */
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
the message digest and zeroizing the context.
*/
-static void MD5Final(digest, context)
-unsigned char digest[16]; /* message digest */
-MD5_CTX *context; /* context */
+static void MD5Final(unsigned char digest[16], MD5_CTX *context)
{
unsigned char bits[8];
unsigned int index, padLen;
@@ -223,9 +217,7 @@ MD5_CTX *context; /* context */
/* MD5 basic transformation. Transforms state based on block.
*/
-static void MD5Transform(state, block)
-UINT4 state[4];
-unsigned char block[64];
+static void MD5Transform(UINT4 state[4], unsigned char block[64])
{
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
@@ -316,10 +308,7 @@ unsigned char block[64];
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
a multiple of 4.
*/
-static void Encode(output, input, len)
-unsigned char *output;
-UINT4 *input;
-unsigned int len;
+static void Encode(unsigned char *output, UINT4 *input, unsigned int len)
{
unsigned int i, j;
@@ -334,10 +323,7 @@ unsigned int len;
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
a multiple of 4.
*/
-static void Decode(output, input, len)
-UINT4 *output;
-unsigned char *input;
-unsigned int len;
+static void Decode(UINT4 *output, unsigned char *input, unsigned int len)
{
unsigned int i, j;
@@ -374,14 +360,14 @@ int old_encrypt(const char *src, int len, char *dest, int size)
memset(&digest, 0, sizeof(digest));
MD5Init(&context);
- MD5Update(&context, src, len);
- MD5Final(digest, &context);
+ MD5Update(&context, (unsigned char *)src, len);
+ MD5Final((unsigned char *)digest, &context);
for (i = 0; i < 32; i += 2)
dest[i / 2] = XTOI(digest[i]) << 4 | XTOI(digest[i + 1]);
if(debug) {
memset(tmp,0,33);
- binary_to_hex(dest,tmp,16);
+ binary_to_hex((unsigned char *)dest,tmp,16);
alog("enc_old: Converted [%s] to [%s]",src,tmp);
}
diff --git a/src/core/enc_sha1.c b/src/core/enc_sha1.c
index 6a2f22860..f4384dadf 100644
--- a/src/core/enc_sha1.c
+++ b/src/core/enc_sha1.c
@@ -186,12 +186,12 @@ int sha1_encrypt(const char *src, int len, char *dest, int size)
memset(dest,0,size);
SHA1Init(&context);
- SHA1Update(&context, src, len);
- SHA1Final(dest, &context);
+ SHA1Update(&context, (unsigned char *)src, len);
+ SHA1Final((unsigned char *)dest, &context);
if(debug) {
memset(tmp,0,41);
- binary_to_hex(dest,tmp,20);
+ binary_to_hex((unsigned char *)dest,(char *)tmp,20);
/* Dont log source if we were encrypting in place :) */
if (memcmp(src, dest, 20) != 0) {
alog("enc_sha1: hashed from [%s] to [%s]",src,tmp);
diff --git a/src/core/hs_delall.c b/src/core/hs_delall.c
index bc26a9032..b3b1b9378 100644
--- a/src/core/hs_delall.c
+++ b/src/core/hs_delall.c
@@ -84,7 +84,7 @@ int do_delall(User * u)
}
nc = na->nc;
for (i = 0; i < nc->aliases.count; i++) {
- na = nc->aliases.list[i];
+ na = (NickAlias *)nc->aliases.list[i];
delHostCore(na->nick);
}
alog("vHosts for all nicks in group \002%s\002 deleted by oper \002%s\002", nc->display, u->nick);
diff --git a/src/core/hs_group.c b/src/core/hs_group.c
index a88d772e3..d5dbf67b0 100644
--- a/src/core/hs_group.c
+++ b/src/core/hs_group.c
@@ -77,7 +77,7 @@ int do_group(User * u)
char *creator = NULL;
HostCore *head = NULL;
time_t time;
- boolean found = false;
+ bool found = false;
head = hostCoreListHead();
diff --git a/src/core/hs_set.c b/src/core/hs_set.c
index d236830d0..3bace055e 100644
--- a/src/core/hs_set.c
+++ b/src/core/hs_set.c
@@ -71,7 +71,7 @@ int myDoSet(User * u)
{
char *nick = strtok(NULL, " ");
char *rawhostmask = strtok(NULL, " ");
- char *hostmask = smalloc(HOSTMAX);
+ char *hostmask = (char *)smalloc(HOSTMAX);
NickAlias *na;
int32 tmp_time;
diff --git a/src/core/hs_setall.c b/src/core/hs_setall.c
index 9f355b1f7..bd398823e 100644
--- a/src/core/hs_setall.c
+++ b/src/core/hs_setall.c
@@ -71,9 +71,9 @@ void myHostServHelp(User * u)
int do_setall(User * u)
{
- char *nick = strtok(NULL, " ");
+ char *nick = (char *)strtok(NULL, " ");
char *rawhostmask = strtok(NULL, " ");
- char *hostmask = smalloc(HOSTMAX);
+ char *hostmask = (char *)smalloc(HOSTMAX);
NickAlias *na;
int32 tmp_time;
diff --git a/src/core/ms_list.c b/src/core/ms_list.c
index b0a203afd..9d795cf70 100644
--- a/src/core/ms_list.c
+++ b/src/core/ms_list.c
@@ -16,8 +16,7 @@
#include "module.h"
int do_list(User * u);
int list_memo_callback(User * u, int num, va_list args);
-int list_memo(User * u, int index, MemoInfo * mi, int *sent_header,
- int new, const char *chan);
+int list_memo(User * u, int index, MemoInfo * mi, int *sent_header, int newi, const char *chan);
void myMemoServHelp(User * u);
/**
@@ -159,12 +158,11 @@ int list_memo_callback(User * u, int num, va_list args)
* @param int Memo index
* @param mi MemoInfo Struct
* @param send_header If we are to send the headers
- * @param new If we are listing new memos
+ * @param newi If we are listing new memos
* @param chan Channel name
* @return MOD_CONT
*/
-int list_memo(User * u, int index, MemoInfo * mi, int *sent_header,
- int new, const char *chan)
+int list_memo(User * u, int index, MemoInfo * mi, int *sent_header, int newi, const char *chan)
{
Memo *m;
char timebuf[64];
@@ -175,11 +173,11 @@ int list_memo(User * u, int index, MemoInfo * mi, int *sent_header,
if (!*sent_header) {
if (chan) {
notice_lang(s_MemoServ, u,
- new ? MEMO_LIST_CHAN_NEW_MEMOS :
+ newi ? MEMO_LIST_CHAN_NEW_MEMOS :
MEMO_LIST_CHAN_MEMOS, chan, s_MemoServ, chan);
} else {
notice_lang(s_MemoServ, u,
- new ? MEMO_LIST_NEW_MEMOS : MEMO_LIST_MEMOS,
+ newi ? MEMO_LIST_NEW_MEMOS : MEMO_LIST_MEMOS,
u->nick, s_MemoServ);
}
notice_lang(s_MemoServ, u, MEMO_LIST_HEADER);
diff --git a/src/core/ns_access.c b/src/core/ns_access.c
index 40e925012..a4a2962ad 100644
--- a/src/core/ns_access.c
+++ b/src/core/ns_access.c
@@ -138,7 +138,7 @@ int do_access(User * u)
na->nc->accesscount++;
na->nc->access =
- srealloc(na->nc->access, sizeof(char *) * na->nc->accesscount);
+ (char **)srealloc(na->nc->access, sizeof(char *) * na->nc->accesscount);
na->nc->access[na->nc->accesscount - 1] = sstrdup(mask);
notice_lang(s_NickServ, u, NICK_ACCESS_ADDED, mask);
@@ -162,7 +162,7 @@ int do_access(User * u)
(na->nc->accesscount - i) * sizeof(char *));
if (na->nc->accesscount) /* if there are any entries left... */
na->nc->access =
- srealloc(na->nc->access,
+ (char **)srealloc(na->nc->access,
na->nc->accesscount * sizeof(char *));
else {
free(na->nc->access);
diff --git a/src/core/ns_forbid.c b/src/core/ns_forbid.c
index b3ecc5531..8fb5402a1 100644
--- a/src/core/ns_forbid.c
+++ b/src/core/ns_forbid.c
@@ -139,14 +139,14 @@ NickAlias *makenick(const char *nick)
NickCore *nc;
/* First make the core */
- nc = scalloc(1, sizeof(NickCore));
+ nc = (NickCore *)scalloc(1, sizeof(NickCore));
nc->display = sstrdup(nick);
slist_init(&nc->aliases);
insert_core(nc);
alog("%s: group %s has been created", s_NickServ, nc->display);
/* Then make the alias */
- na = scalloc(1, sizeof(NickAlias));
+ na = (NickAlias *)scalloc(1, sizeof(NickAlias));
na->nick = sstrdup(nick);
na->nc = nc;
slist_add(&nc->aliases, na);
diff --git a/src/core/ns_group.c b/src/core/ns_group.c
index 926d062f0..5ee2b6483 100644
--- a/src/core/ns_group.c
+++ b/src/core/ns_group.c
@@ -119,14 +119,14 @@ int do_group(User * u)
return MOD_CONT;
}
}
- for (i = 0; i < servadmins.count && (nc = servadmins.list[i]); i++) {
+ for (i = 0; i < servadmins.count && (nc = (NickCore *)servadmins.list[i]); i++) {
if (stristr(u->nick, nc->display) && !is_oper(u)) {
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED,
u->nick);
return MOD_CONT;
}
}
- for (i = 0; i < servopers.count && (nc = servopers.list[i]); i++) {
+ for (i = 0; i < servopers.count && (nc = (NickCore *)servopers.list[i]); i++) {
if (stristr(u->nick, nc->display) && !is_oper(u)) {
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED,
u->nick);
@@ -193,7 +193,7 @@ int do_group(User * u)
if (na) {
na->last_usermask =
- scalloc(strlen(common_get_vident(u)) +
+ (char *)scalloc(strlen(common_get_vident(u)) +
strlen(common_get_vhost(u)) + 2, 1);
sprintf(na->last_usermask, "%s@%s", common_get_vident(u),
common_get_vhost(u));
@@ -264,7 +264,7 @@ NickAlias *makealias(const char *nick, NickCore * nc)
NickAlias *na;
/* Just need to make the alias */
- na = scalloc(1, sizeof(NickAlias));
+ na = (NickAlias *)scalloc(1, sizeof(NickAlias));
na->nick = sstrdup(nick);
na->nc = nc;
slist_add(&nc->aliases, na);
@@ -309,7 +309,7 @@ int do_glist(User * u)
nick ? NICK_GLIST_HEADER_X : NICK_GLIST_HEADER,
na->nc->display);
for (i = 0; i < na->nc->aliases.count; i++) {
- na2 = na->nc->aliases.list[i];
+ na2 = (NickAlias *)na->nc->aliases.list[i];
if (na2->nc == na->nc) {
if (!(wont_expire = na2->status & NS_NO_EXPIRE)) {
expt = na2->last_seen + NSExpire;
diff --git a/src/core/ns_identify.c b/src/core/ns_identify.c
index cbeb7705e..c0de8bf0e 100644
--- a/src/core/ns_identify.c
+++ b/src/core/ns_identify.c
@@ -108,7 +108,7 @@ int do_identify(User * u)
if (na->last_usermask)
free(na->last_usermask);
na->last_usermask =
- scalloc(strlen(common_get_vident(u)) +
+ (char *)scalloc(strlen(common_get_vident(u)) +
strlen(common_get_vhost(u)) + 2, 1);
sprintf(na->last_usermask, "%s@%s", common_get_vident(u),
common_get_vhost(u));
diff --git a/src/core/ns_register.c b/src/core/ns_register.c
index 30046a7f8..cb5abab8e 100644
--- a/src/core/ns_register.c
+++ b/src/core/ns_register.c
@@ -146,14 +146,14 @@ int do_register(User * u)
return MOD_CONT;
}
}
- for (i = 0; i < servadmins.count && (nc = servadmins.list[i]); i++) {
+ for (i = 0; i < servadmins.count && (nc = (NickCore *)servadmins.list[i]); i++) {
if (stristr(u->nick, nc->display) && !is_oper(u)) {
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED,
u->nick);
return MOD_CONT;
}
}
- for (i = 0; i < servopers.count && (nc = servopers.list[i]); i++) {
+ for (i = 0; i < servopers.count && (nc = (NickCore *)servopers.list[i]); i++) {
if (stristr(u->nick, nc->display) && !is_oper(u)) {
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED,
u->nick);
@@ -308,7 +308,7 @@ int do_confirm(User * u)
char tmp_pass[PASSMAX];
len = strlen(pass);
- na->nc->pass = smalloc(PASSMAX);
+ na->nc->pass = (char *)smalloc(PASSMAX);
if (enc_encrypt(pass, len, na->nc->pass, PASSMAX - 1) < 0) {
memset(pass, 0, strlen(pass));
alog("%s: Failed to encrypt password for %s (register)",
@@ -334,7 +334,7 @@ int do_confirm(User * u)
na->last_realname = sstrdup("unknown");
} else {
na->last_usermask =
- scalloc(strlen(common_get_vident(u)) +
+ (char *)scalloc(strlen(common_get_vident(u)) +
strlen(common_get_vhost(u)) + 2, 1);
sprintf(na->last_usermask, "%s@%s", common_get_vident(u),
common_get_vhost(u));
@@ -343,7 +343,7 @@ int do_confirm(User * u)
na->time_registered = na->last_seen = time(NULL);
if (NSAddAccessOnReg) {
na->nc->accesscount = 1;
- na->nc->access = scalloc(sizeof(char *), 1);
+ na->nc->access = (char **)scalloc(sizeof(char *), 1);
na->nc->access[0] = create_mask(u);
} else {
na->nc->accesscount = 0;
@@ -409,7 +409,7 @@ NickRequest *makerequest(const char *nick)
{
NickRequest *nr;
- nr = scalloc(1, sizeof(NickRequest));
+ nr = (NickRequest *)scalloc(1, sizeof(NickRequest));
nr->nick = sstrdup(nick);
insert_requestnick(nr);
alog("%s: Nick %s has been requested", s_NickServ, nr->nick);
@@ -424,14 +424,14 @@ NickAlias *makenick(const char *nick)
NickCore *nc;
/* First make the core */
- nc = scalloc(1, sizeof(NickCore));
+ nc = (NickCore *)scalloc(1, sizeof(NickCore));
nc->display = sstrdup(nick);
slist_init(&nc->aliases);
insert_core(nc);
alog("%s: group %s has been created", s_NickServ, nc->display);
/* Then make the alias */
- na = scalloc(1, sizeof(NickAlias));
+ na = (NickAlias *)scalloc(1, sizeof(NickAlias));
na->nick = sstrdup(nick);
na->nc = nc;
slist_add(&nc->aliases, na);
diff --git a/src/core/ns_saset.c b/src/core/ns_saset.c
index bc5c1af00..31d218e17 100644
--- a/src/core/ns_saset.c
+++ b/src/core/ns_saset.c
@@ -199,7 +199,7 @@ int do_saset_display(User * u, NickCore * nc, char *param)
/* First check whether param is a valid nick of the group */
for (i = 0; i < nc->aliases.count; i++) {
- na = nc->aliases.list[i];
+ na = (NickAlias *)nc->aliases.list[i];
if (stricmp(na->nick, param) == 0) {
param = na->nick; /* Because case may differ */
break;
@@ -243,7 +243,7 @@ int do_saset_password(User * u, NickCore * nc, char *param)
if (nc->pass)
free(nc->pass);
- nc->pass = smalloc(PASSMAX);
+ nc->pass = (char *)smalloc(PASSMAX);
if (enc_encrypt(param, len, nc->pass, PASSMAX - 1) < 0) {
memset(param, 0, len);
alog("%s: Failed to encrypt password for %s (set)", s_NickServ,
diff --git a/src/core/ns_set.c b/src/core/ns_set.c
index 2234a4899..17ab357f0 100644
--- a/src/core/ns_set.c
+++ b/src/core/ns_set.c
@@ -178,7 +178,7 @@ int do_set_display(User * u, NickCore * nc, char *param)
/* First check whether param is a valid nick of the group */
for (i = 0; i < nc->aliases.count; i++) {
- na = nc->aliases.list[i];
+ na = (NickAlias *)nc->aliases.list[i];
if (!stricmp(na->nick, param)) {
param = na->nick; /* Because case may differ */
break;
@@ -216,7 +216,7 @@ int do_set_password(User * u, NickCore * nc, char *param)
if (nc->pass)
free(nc->pass);
- nc->pass = smalloc(PASSMAX);
+ nc->pass = (char *)smalloc(PASSMAX);
if (enc_encrypt(param, len, nc->pass, PASSMAX - 1) < 0) {
memset(param, 0, len);
alog("%s: Failed to encrypt password for %s (set)", s_NickServ,
diff --git a/src/core/ns_suspend.c b/src/core/ns_suspend.c
index a2961e060..dd042f621 100644
--- a/src/core/ns_suspend.c
+++ b/src/core/ns_suspend.c
@@ -111,7 +111,7 @@ int do_suspend(User * u)
na->nc->flags &= ~(NI_KILLPROTECT | NI_KILL_QUICK | NI_KILL_IMMED);
for (i = 0; i < na->nc->aliases.count; i++) {
- na2 = na->nc->aliases.list[i];
+ na2 = (NickAlias *)na->nc->aliases.list[i];
if (na2->nc == na->nc) {
na2->status &= ~(NS_IDENTIFIED | NS_RECOGNIZED);
na2->last_quit = sstrdup(reason);
diff --git a/src/core/os_admin.c b/src/core/os_admin.c
index 4df67ccd7..b3da7dc67 100644
--- a/src/core/os_admin.c
+++ b/src/core/os_admin.c
@@ -197,7 +197,7 @@ int do_admin(User * u)
|| match_wild_nocase(nick,
((NickCore *) servadmins.
list[i])->display))
- admin_list(i + 1, servadmins.list[i], u, &sent_header);
+ admin_list(i + 1, (NickCore *)servadmins.list[i], u, &sent_header);
if (!sent_header)
notice_lang(s_OperServ, u, OPER_ADMIN_NO_MATCH);
@@ -230,7 +230,7 @@ int admin_list_callback(SList * slist, int number, void *item,
User *u = va_arg(args, User *);
int *sent_header = va_arg(args, int *);
- return admin_list(number, item, u, sent_header);
+ return admin_list(number, (NickCore *)item, u, sent_header);
}
int admin_list(int number, NickCore * nc, User * u, int *sent_header)
diff --git a/src/core/os_akill.c b/src/core/os_akill.c
index 8233eec93..7c1ce828d 100644
--- a/src/core/os_akill.c
+++ b/src/core/os_akill.c
@@ -80,8 +80,11 @@ int do_akill(User * u)
char *cmd = strtok(NULL, " ");
char breason[BUFSIZE];
- if (!cmd)
- cmd = "";
+ if (!cmd)
+ {
+ syntax_error(s_OperServ, u, "AKILL", OPER_AKILL_SYNTAX);
+ return MOD_CONT;
+ }
if (!stricmp(cmd, "ADD")) {
int deleted = 0;
@@ -264,7 +267,7 @@ int do_akill(User * u)
((Akill *) akills.list[i])->host);
if (!stricmp(mask, amask)
|| match_wild_nocase(mask, amask))
- akill_list(i + 1, akills.list[i], u, &sent_header);
+ akill_list(i + 1, (Akill *)akills.list[i], u, &sent_header);
}
if (!sent_header)
@@ -303,7 +306,7 @@ int do_akill(User * u)
((Akill *) akills.list[i])->host);
if (!stricmp(mask, amask)
|| match_wild_nocase(mask, amask))
- akill_view(i + 1, akills.list[i], u, &sent_header);
+ akill_view(i + 1, (Akill *)akills.list[i], u, &sent_header);
}
if (!sent_header)
@@ -351,7 +354,7 @@ int akill_list_callback(SList * slist, int number, void *item,
User *u = va_arg(args, User *);
int *sent_header = va_arg(args, int *);
- return akill_list(number, item, u, sent_header);
+ return akill_list(number, (Akill *)item, u, sent_header);
}
/* Callback for enumeration purposes */
@@ -362,7 +365,7 @@ int akill_view_callback(SList * slist, int number, void *item,
User *u = va_arg(args, User *);
int *sent_header = va_arg(args, int *);
- return akill_view(number, item, u, sent_header);
+ return akill_view(number, (Akill *)item, u, sent_header);
}
/* Lists an AKILL entry, prefixing it with the header if needed */
diff --git a/src/core/os_kick.c b/src/core/os_kick.c
index facab5fc5..15a143746 100644
--- a/src/core/os_kick.c
+++ b/src/core/os_kick.c
@@ -68,7 +68,7 @@ void myOperServHelp(User * u)
**/
int do_os_kick(User * u)
{
- char *argv[3];
+ const char *argv[3];
char *chan, *nick, *s;
Channel *c;
@@ -93,8 +93,8 @@ int do_os_kick(User * u)
argv[1] = sstrdup(nick);
argv[2] = sstrdup(s);
do_kick(s_OperServ, 3, argv);
- free(argv[2]);
- free(argv[1]);
- free(argv[0]);
+ free((void *)argv[2]);
+ free((void *)argv[1]);
+ free((void *)argv[0]);
return MOD_CONT;
}
diff --git a/src/core/os_oper.c b/src/core/os_oper.c
index a0ab70919..aac6e14b2 100644
--- a/src/core/os_oper.c
+++ b/src/core/os_oper.c
@@ -198,7 +198,7 @@ int do_oper(User * u)
|| match_wild_nocase(nick,
((NickCore *) servopers.list[i])->
display))
- oper_list(i + 1, servopers.list[i], u, &sent_header);
+ oper_list(i + 1, (NickCore *)servopers.list[i], u, &sent_header);
if (!sent_header)
notice_lang(s_OperServ, u, OPER_OPER_NO_MATCH);
@@ -248,5 +248,5 @@ int oper_list_callback(SList * slist, int number, void *item, va_list args)
User *u = va_arg(args, User *);
int *sent_header = va_arg(args, int *);
- return oper_list(number, item, u, sent_header);
+ return oper_list(number, (NickCore *)item, u, sent_header);
}
diff --git a/src/core/os_quit.c b/src/core/os_quit.c
index 65fd31123..82da33434 100644
--- a/src/core/os_quit.c
+++ b/src/core/os_quit.c
@@ -68,11 +68,11 @@ void myOperServHelp(User * u)
**/
int do_os_quit(User * u)
{
- quitmsg = calloc(28 + strlen(u->nick), 1);
+ quitmsg = (char *)calloc(28 + strlen(u->nick), 1);
if (!quitmsg)
quitmsg = "QUIT command received, but out of memory!";
else
- sprintf(quitmsg, "QUIT command received from %s", u->nick);
+ sprintf((char *)quitmsg, "QUIT command received from %s", u->nick); // XXX we know this is safe, but..
if (GlobalOnCycle) {
oper_global(NULL, "%s", GlobalOnCycleMessage);
diff --git a/src/core/os_reload.c b/src/core/os_reload.c
index 6f2a4a406..1961ed908 100644
--- a/src/core/os_reload.c
+++ b/src/core/os_reload.c
@@ -69,12 +69,12 @@ void myOperServHelp(User * u)
int do_reload(User * u)
{
if (!read_config(1)) {
- quitmsg = calloc(28 + strlen(u->nick), 1);
+ quitmsg = (char *)calloc(28 + strlen(u->nick), 1);
if (!quitmsg)
quitmsg =
"Error during the reload of the configuration file, but out of memory!";
else
- sprintf(quitmsg,
+ sprintf((char *)quitmsg, /* XXX */
"Error during the reload of the configuration file!");
quitting = 1;
}
diff --git a/src/core/os_restart.c b/src/core/os_restart.c
index d1beec8b1..ff5cf2a5b 100644
--- a/src/core/os_restart.c
+++ b/src/core/os_restart.c
@@ -73,11 +73,11 @@ void myOperServHelp(User * u)
int do_restart(User * u)
{
#ifdef SERVICES_BIN
- quitmsg = calloc(31 + strlen(u->nick), 1);
+ quitmsg = (char *)calloc(31 + strlen(u->nick), 1);
if (!quitmsg)
quitmsg = "RESTART command received, but out of memory!";
else
- sprintf(quitmsg, "RESTART command received from %s", u->nick);
+ sprintf((char *)quitmsg, /* XXX */ "RESTART command received from %s", u->nick);
if (GlobalOnCycle) {
oper_global(NULL, "%s", GlobalOnCycleMessage);
diff --git a/src/core/os_sgline.c b/src/core/os_sgline.c
index da28cf178..1c6ec3890 100644
--- a/src/core/os_sgline.c
+++ b/src/core/os_sgline.c
@@ -244,7 +244,7 @@ int do_sgline(User * u)
amask = ((SXLine *) sglines.list[i])->mask;
if (!stricmp(mask, amask)
|| match_wild_nocase(mask, amask))
- sgline_list(i + 1, sglines.list[i], u, &sent_header);
+ sgline_list(i + 1, (SXLine *)sglines.list[i], u, &sent_header);
}
if (!sent_header)
@@ -281,7 +281,7 @@ int do_sgline(User * u)
amask = ((SXLine *) sglines.list[i])->mask;
if (!stricmp(mask, amask)
|| match_wild_nocase(mask, amask))
- sgline_view(i + 1, sglines.list[i], u, &sent_header);
+ sgline_view(i + 1, (SXLine *)sglines.list[i], u, &sent_header);
}
if (!sent_header)
@@ -329,7 +329,7 @@ int sgline_view_callback(SList * slist, int number, void *item,
User *u = va_arg(args, User *);
int *sent_header = va_arg(args, int *);
- return sgline_view(number, item, u, sent_header);
+ return sgline_view(number, (SXLine *)item, u, sent_header);
}
/* Lists an SGLINE entry, prefixing it with the header if needed */
@@ -358,5 +358,5 @@ int sgline_list_callback(SList * slist, int number, void *item,
User *u = va_arg(args, User *);
int *sent_header = va_arg(args, int *);
- return sgline_list(number, item, u, sent_header);
+ return sgline_list(number, (SXLine *)item, u, sent_header);
}
diff --git a/src/core/os_shutdown.c b/src/core/os_shutdown.c
index 2031462b8..e9be72cff 100644
--- a/src/core/os_shutdown.c
+++ b/src/core/os_shutdown.c
@@ -68,11 +68,11 @@ void myOperServHelp(User * u)
**/
int do_shutdown(User * u)
{
- quitmsg = calloc(32 + strlen(u->nick), 1);
+ quitmsg = (char *)calloc(32 + strlen(u->nick), 1);
if (!quitmsg)
quitmsg = "SHUTDOWN command received, but out of memory!";
else
- sprintf(quitmsg, "SHUTDOWN command received from %s", u->nick);
+ sprintf((char *)quitmsg, /* XXX */ "SHUTDOWN command received from %s", u->nick);
if (GlobalOnCycle) {
oper_global(NULL, "%s", GlobalOnCycleMessage);
diff --git a/src/core/os_sqline.c b/src/core/os_sqline.c
index 57d91f679..0ed3d153e 100644
--- a/src/core/os_sqline.c
+++ b/src/core/os_sqline.c
@@ -239,7 +239,7 @@ int do_sqline(User * u)
amask = ((SXLine *) sqlines.list[i])->mask;
if (!stricmp(mask, amask)
|| match_wild_nocase(mask, amask))
- sqline_list(i + 1, sqlines.list[i], u, &sent_header);
+ sqline_list(i + 1, (SXLine *)sqlines.list[i], u, &sent_header);
}
if (!sent_header)
@@ -276,7 +276,7 @@ int do_sqline(User * u)
amask = ((SXLine *) sqlines.list[i])->mask;
if (!stricmp(mask, amask)
|| match_wild_nocase(mask, amask))
- sqline_view(i + 1, sqlines.list[i], u, &sent_header);
+ sqline_view(i + 1, (SXLine *)sqlines.list[i], u, &sent_header);
}
if (!sent_header)
@@ -322,7 +322,7 @@ int sqline_view_callback(SList * slist, int number, void *item,
User *u = va_arg(args, User *);
int *sent_header = va_arg(args, int *);
- return sqline_view(number, item, u, sent_header);
+ return sqline_view(number, (SXLine *)item, u, sent_header);
}
/* Lists an SQLINE entry, prefixing it with the header if needed */
@@ -351,5 +351,5 @@ int sqline_list_callback(SList * slist, int number, void *item,
User *u = va_arg(args, User *);
int *sent_header = va_arg(args, int *);
- return sqline_list(number, item, u, sent_header);
+ return sqline_list(number, (SXLine *)item, u, sent_header);
}
diff --git a/src/core/os_staff.c b/src/core/os_staff.c
index ae9e6d66c..3ce5cffc2 100644
--- a/src/core/os_staff.c
+++ b/src/core/os_staff.c
@@ -88,7 +88,7 @@ int do_staff(User * u)
ServicesRoots[idx]);
} else if ((nc = findcore(ServicesRoots[idx]))) {
for (i = 0; i < nc->aliases.count; i++) { /* check all aliases */
- na = nc->aliases.list[i];
+ na = (NickAlias *)nc->aliases.list[i];
if ((au = finduser(na->nick))) { /* see if user is online */
found = 1;
notice_lang(s_OperServ, u, OPER_STAFF_AFORMAT,
@@ -115,7 +115,7 @@ int opers_list_callback(SList * slist, int number, void *item,
User *u = va_arg(args, User *);
char *level = va_arg(args, char *);
- return opers_list(number, item, u, level);
+ return opers_list(number, (NickCore *)item, u, level);
}
@@ -139,7 +139,7 @@ int opers_list(int number, NickCore * nc, User * u, char *level)
nc->display);
} else {
for (i = 0; i < nc->aliases.count; i++) { /* check all aliases */
- na = nc->aliases.list[i];
+ na = (NickAlias *)nc->aliases.list[i];
if ((au = finduser(na->nick))) { /* see if user is online */
found = 1;
notice_lang(s_OperServ, u, OPER_STAFF_AFORMAT, '*', level,