1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 19:43:14 +02:00

Various strict fixes..

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1185 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Robin Burchell w00t@inspircd.org
2008-09-30 18:45:09 +00:00
parent 1e918b949c
commit 29aea837f5
27 changed files with 90 additions and 117 deletions
+9 -23
View File
@@ -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);
+9 -23
View File
@@ -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);
}
+3 -3
View File
@@ -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);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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;
+5 -7
View File
@@ -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);
+2 -2
View File
@@ -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);
+2 -2
View File
@@ -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);
+5 -5
View File
@@ -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;
+1 -1
View File
@@ -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));
+8 -8
View File
@@ -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);
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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)
+9 -6
View File
@@ -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 */
+4 -4
View File
@@ -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;
}
+2 -2
View File
@@ -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);
}
+2 -2
View File
@@ -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);
+2 -2
View File
@@ -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;
}
+2 -2
View File
@@ -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);
+4 -4
View File
@@ -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);
}
+2 -2
View File
@@ -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);
+4 -4
View File
@@ -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);
}
+3 -3
View File
@@ -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,