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
commit3e6f3f6b54a0f5810f19eae853893ff8d8a9eb9b (patch)
tree80d18d7e176a47df6fd5b9e8021b1461042e7895 /src
parent7566abd1b06e1b046ff2e814fd03584eb4cf33a6 (diff)
Fixes for g++
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1179 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/nickserv.c32
-rw-r--r--src/operserv.c88
2 files changed, 60 insertions, 60 deletions
diff --git a/src/nickserv.c b/src/nickserv.c
index 5e8afb423..6fda8b1f7 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -309,7 +309,7 @@ void load_old_ns_dbase(void)
if (c != 1)
fatal("Invalid format in %s", NickDBName);
- na = scalloc(sizeof(NickAlias), 1);
+ na = (NickAlias *)scalloc(sizeof(NickAlias), 1);
SAFE(read_buffer(bufn, f));
na->nick = sstrdup(bufn);
@@ -380,7 +380,7 @@ void load_old_ns_dbase(void)
/* This nick was a master nick, so it also has all the
* core info! =)
*/
- nc = scalloc(1, sizeof(NickCore));
+ nc = (NickCore *)scalloc(1, sizeof(NickCore));
slist_init(&nc->aliases);
/* The initial display is what used to be the master nick */
@@ -433,7 +433,7 @@ void load_old_ns_dbase(void)
SAFE(read_int16(&nc->accesscount, f));
if (nc->accesscount) {
char **access;
- access = scalloc(sizeof(char *) * nc->accesscount, 1);
+ access = (char **)scalloc(sizeof(char *) * nc->accesscount, 1);
nc->access = access;
for (j = 0; j < nc->accesscount; j++, access++)
SAFE(read_string(access, f));
@@ -445,7 +445,7 @@ void load_old_ns_dbase(void)
nc->memos.memomax = (int16) tmp16;
if (nc->memos.memocount) {
Memo *memos;
- memos = scalloc(sizeof(Memo) * nc->memos.memocount, 1);
+ memos = (Memo *)scalloc(sizeof(Memo) * nc->memos.memocount, 1);
nc->memos.memos = memos;
for (j = 0; j < nc->memos.memocount; j++, memos++) {
@@ -540,7 +540,7 @@ void load_ns_req_db(void)
while ((c = getc_db(f)) == 1) {
if (c != 1)
fatal("Invalid format in %s", PreNickDBName);
- nr = scalloc(1, sizeof(NickRequest));
+ nr = (NickRequest *)scalloc(1, sizeof(NickRequest));
SAFE(read_string(&nr->nick, f));
SAFE(read_string(&nr->passcode, f));
SAFE(read_string(&nr->password, f));
@@ -584,7 +584,7 @@ void load_ns_dbase(void)
if (c != 1)
fatal("Invalid format in %s", NickDBName);
- nc = scalloc(1, sizeof(NickCore));
+ nc = (NickCore *)scalloc(1, sizeof(NickCore));
*nclast = nc;
nclast = &nc->next;
nc->prev = ncprev;
@@ -614,7 +614,7 @@ void load_ns_dbase(void)
SAFE(read_int16(&nc->accesscount, f));
if (nc->accesscount) {
char **access;
- access = scalloc(sizeof(char *) * nc->accesscount, 1);
+ access = (char **)scalloc(sizeof(char *) * nc->accesscount, 1);
nc->access = access;
for (j = 0; j < nc->accesscount; j++, access++)
SAFE(read_string(access, f));
@@ -626,7 +626,7 @@ void load_ns_dbase(void)
nc->memos.memomax = (int16) tmp16;
if (nc->memos.memocount) {
Memo *memos;
- memos = scalloc(sizeof(Memo) * nc->memos.memocount, 1);
+ memos = (Memo *)scalloc(sizeof(Memo) * nc->memos.memocount, 1);
nc->memos.memos = memos;
for (j = 0; j < nc->memos.memocount; j++, memos++) {
SAFE(read_int32(&memos->number, f));
@@ -662,7 +662,7 @@ void load_ns_dbase(void)
if (c != 1)
fatal("Invalid format in %s", NickDBName);
- na = scalloc(1, sizeof(NickAlias));
+ na = (NickAlias *)scalloc(1, sizeof(NickAlias));
SAFE(read_string(&na->nick, f));
@@ -1001,7 +1001,7 @@ int validate_user(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));
@@ -1270,11 +1270,11 @@ int is_on_access(User * u, NickCore * nc)
if (nc->accesscount == 0)
return 0;
- buf = scalloc(strlen(u->username) + strlen(u->host) + 2, 1);
+ buf = (char *)scalloc(strlen(u->username) + strlen(u->host) + 2, 1);
sprintf(buf, "%s@%s", u->username, u->host);
if (ircd->vhost) {
if (u->vhost) {
- buf2 = scalloc(strlen(u->username) + strlen(u->vhost) + 2, 1);
+ buf2 = (char *)scalloc(strlen(u->username) + strlen(u->vhost) + 2, 1);
sprintf(buf2, "%s@%s", u->username, u->vhost);
}
}
@@ -1387,7 +1387,7 @@ void change_core_display(NickCore * nc, char *newdisplay)
if (nc->aliases.count <= 0)
return;
- na = nc->aliases.list[0];
+ na = (NickAlias *)nc->aliases.list[0];
newdisplay = na->nick;
}
@@ -1718,7 +1718,7 @@ static void rem_ns_timeout(NickAlias * na, int type)
static void timeout_collide(Timeout * t)
{
- NickAlias *na = t->data;
+ NickAlias *na = (NickAlias *)t->data;
rem_ns_timeout(na, TO_COLLIDE);
/* If they identified or don't exist anymore, don't kill them. */
@@ -1737,7 +1737,7 @@ static void timeout_collide(Timeout * t)
static void timeout_release(Timeout * t)
{
- NickAlias *na = t->data;
+ NickAlias *na = (NickAlias *)t->data;
rem_ns_timeout(na, TO_RELEASE);
release(na, 1);
@@ -1766,7 +1766,7 @@ static void add_ns_timeout(NickAlias * na, int type, time_t delay)
to = add_timeout(delay, timeout_routine, 0);
to->data = na;
- t = scalloc(sizeof(struct my_timeout), 1);
+ t = (struct my_timeout *)scalloc(sizeof(struct my_timeout), 1);
t->na = na;
t->to = to;
t->type = type;
diff --git a/src/operserv.c b/src/operserv.c
index ded9069eb..d41d2cbd2 100644
--- a/src/operserv.c
+++ b/src/operserv.c
@@ -182,7 +182,7 @@ static void load_old_akill(void)
slist_setcapacity(&akills, tmp16);
for (j = 0; j < akills.capacity; j++) {
- ak = scalloc(sizeof(Akill), 1);
+ ak = (Akill *)scalloc(sizeof(Akill), 1);
SAFE(read_string(&mask, f));
s = strchr(mask, '@');
@@ -230,7 +230,7 @@ static void load_old_akill(void)
char amask[BUFSIZE];
- entry = akills.list[i];
+ entry = (Akill *)akills.list[i];
if (!entry)
continue;
@@ -336,7 +336,7 @@ void load_os_dbase(void)
slist_setcapacity(&akills, tmp16);
for (i = 0; i < akills.capacity; i++) {
- ak = scalloc(sizeof(Akill), 1);
+ ak = (Akill *)scalloc(sizeof(Akill), 1);
SAFE(read_string(&ak->user, f));
SAFE(read_string(&ak->host, f));
@@ -358,7 +358,7 @@ void load_os_dbase(void)
slist_setcapacity(&sglines, tmp16);
for (i = 0; i < sglines.capacity; i++) {
- sx = scalloc(sizeof(SXLine), 1);
+ sx = (SXLine *)scalloc(sizeof(SXLine), 1);
SAFE(read_string(&sx->mask, f));
SAFE(read_string(&sx->by, f));
@@ -376,7 +376,7 @@ void load_os_dbase(void)
slist_setcapacity(&sqlines, tmp16);
for (i = 0; i < sqlines.capacity; i++) {
- sx = scalloc(sizeof(SXLine), 1);
+ sx = (SXLine *)scalloc(sizeof(SXLine), 1);
SAFE(read_string(&sx->mask, f));
SAFE(read_string(&sx->by, f));
@@ -394,7 +394,7 @@ void load_os_dbase(void)
slist_setcapacity(&szlines, tmp16);
for (i = 0; i < szlines.capacity; i++) {
- sx = scalloc(sizeof(SXLine), 1);
+ sx = (SXLine *)scalloc(sizeof(SXLine), 1);
SAFE(read_string(&sx->mask, f));
SAFE(read_string(&sx->by, f));
@@ -446,7 +446,7 @@ void save_os_dbase(void)
SAFE(write_int16(akills.count, f));
for (i = 0; i < akills.count; i++) {
- ak = akills.list[i];
+ ak = (Akill *)akills.list[i];
SAFE(write_string(ak->user, f));
SAFE(write_string(ak->host, f));
@@ -458,7 +458,7 @@ void save_os_dbase(void)
SAFE(write_int16(sglines.count, f));
for (i = 0; i < sglines.count; i++) {
- sx = sglines.list[i];
+ sx = (SXLine *)sglines.list[i];
SAFE(write_string(sx->mask, f));
SAFE(write_string(sx->by, f));
@@ -469,7 +469,7 @@ void save_os_dbase(void)
SAFE(write_int16(sqlines.count, f));
for (i = 0; i < sqlines.count; i++) {
- sx = sqlines.list[i];
+ sx = (SXLine *)sqlines.list[i];
SAFE(write_string(sx->mask, f));
SAFE(write_string(sx->by, f));
@@ -480,7 +480,7 @@ void save_os_dbase(void)
SAFE(write_int16(szlines.count, f));
for (i = 0; i < szlines.count; i++) {
- sx = szlines.list[i];
+ sx = (SXLine *)szlines.list[i];
SAFE(write_string(sx->mask, f));
SAFE(write_string(sx->by, f));
@@ -745,7 +745,7 @@ int add_akill(User * u, char *mask, const char *by, const time_t expires,
for (i = akills.count - 1; i >= 0; i--) {
char amask[BUFSIZE];
- entry = akills.list[i];
+ entry = (Akill *)akills.list[i];
if (!entry)
continue;
@@ -810,7 +810,7 @@ int add_akill(User * u, char *mask, const char *by, const time_t expires,
*host = 0;
host++;
- entry = scalloc(sizeof(Akill), 1);
+ entry = (Akill *)scalloc(sizeof(Akill), 1);
if (!entry) {
free(mask2);
@@ -855,7 +855,7 @@ int check_akill(char *nick, const char *username, const char *host,
return 0;
for (i = 0; i < akills.count; i++) {
- ak = akills.list[i];
+ ak = (Akill *)akills.list[i];
if (!ak)
continue;
if (match_wild_nocase(ak->user, username)
@@ -899,7 +899,7 @@ void expire_akills(void)
Akill *ak;
for (i = akills.count - 1; i >= 0; i--) {
- ak = akills.list[i];
+ ak = (Akill *)akills.list[i];
if (!ak->expires || ak->expires > now)
continue;
@@ -913,7 +913,7 @@ void expire_akills(void)
static void free_akill_entry(SList * slist, void *item)
{
- Akill *ak = item;
+ Akill *ak = (Akill *)item;
/* Remove the AKILLs from all the servers */
anope_cmd_remove_akill(ak->user, ak->host);
@@ -931,8 +931,8 @@ static void free_akill_entry(SList * slist, void *item)
static int is_akill_entry_equal(SList * slist, void *item1, void *item2)
{
- char *ak1 = item1, buf[BUFSIZE];
- Akill *ak2 = item2;
+ char *ak1 = (char *)item1, buf[BUFSIZE];
+ Akill *ak2 = (Akill *)item2;
if (!ak1 || !ak2)
return 0;
@@ -976,7 +976,7 @@ int add_sgline(User * u, char *mask, const char *by, const time_t expires,
if (sglines.count > 0) {
for (i = sglines.count - 1; i >= 0; i--) {
- entry = sglines.list[i];
+ entry = (SXLine *)sglines.list[i];
if (!entry)
continue;
@@ -1022,7 +1022,7 @@ int add_sgline(User * u, char *mask, const char *by, const time_t expires,
}
/* We can now (really) add the SGLINE. */
- entry = scalloc(sizeof(SXLine), 1);
+ entry = (SXLine *)scalloc(sizeof(SXLine), 1);
if (!entry)
return -1;
@@ -1063,7 +1063,7 @@ int check_sgline(char *nick, const char *realname)
return 0;
for (i = 0; i < sglines.count; i++) {
- sx = sglines.list[i];
+ sx = (SXLine *)sglines.list[i];
if (!sx)
continue;
@@ -1087,7 +1087,7 @@ void expire_sglines(void)
SXLine *sx;
for (i = sglines.count - 1; i >= 0; i--) {
- sx = sglines.list[i];
+ sx = (SXLine *)sglines.list[i];
if (!sx->expires || sx->expires > now)
continue;
@@ -1101,7 +1101,7 @@ void expire_sglines(void)
static void free_sgline_entry(SList * slist, void *item)
{
- SXLine *sx = item;
+ SXLine *sx = (SXLine *)item;
/* Remove the SGLINE from all the servers */
anope_cmd_unsgline(sx->mask);
@@ -1117,8 +1117,8 @@ static void free_sgline_entry(SList * slist, void *item)
static int is_sgline_entry_equal(SList * slist, void *item1, void *item2)
{
- char *sx1 = item1;
- SXLine *sx2 = item2;
+ char *sx1 = (char *)item1;
+ SXLine *sx2 = (SXLine *)item2;
if (!sx1 || !sx2)
return 0;
@@ -1159,7 +1159,7 @@ int add_sqline(User * u, char *mask, const char *by, const time_t expires,
if (sqlines.count > 0) {
for (i = sqlines.count - 1; i >= 0; i--) {
- entry = sqlines.list[i];
+ entry = (SXLine *)sqlines.list[i];
if (!entry)
continue;
@@ -1209,7 +1209,7 @@ int add_sqline(User * u, char *mask, const char *by, const time_t expires,
}
/* We can now (really) add the SQLINE. */
- entry = scalloc(sizeof(SXLine), 1);
+ entry = (SXLine *)scalloc(sizeof(SXLine), 1);
if (!entry)
return -1;
@@ -1252,7 +1252,7 @@ int check_sqline(char *nick, int nick_change)
return 0;
for (i = 0; i < sqlines.count; i++) {
- sx = sqlines.list[i];
+ sx = (SXLine *)sqlines.list[i];
if (!sx)
continue;
@@ -1282,7 +1282,7 @@ int check_chan_sqline(const char *chan)
return 0;
for (i = 0; i < sqlines.count; i++) {
- sx = sqlines.list[i];
+ sx = (SXLine *)sqlines.list[i];
if (!sx)
continue;
@@ -1307,7 +1307,7 @@ void expire_sqlines(void)
SXLine *sx;
for (i = sqlines.count - 1; i >= 0; i--) {
- sx = sqlines.list[i];
+ sx = (SXLine *)sqlines.list[i];
if (!sx->expires || sx->expires > now)
continue;
@@ -1322,7 +1322,7 @@ void expire_sqlines(void)
static void free_sqline_entry(SList * slist, void *item)
{
- SXLine *sx = item;
+ SXLine *sx = (SXLine *)item;
/* Remove the SQLINE from all the servers */
anope_cmd_unsqline(sx->mask);
@@ -1338,8 +1338,8 @@ static void free_sqline_entry(SList * slist, void *item)
static int is_sqline_entry_equal(SList * slist, void *item1, void *item2)
{
- char *sx1 = item1;
- SXLine *sx2 = item2;
+ char *sx1 = (char *)item1;
+ SXLine *sx2 = (SXLine *)item2;
if (!sx1 || !sx2)
return 0;
@@ -1377,7 +1377,7 @@ int add_szline(User * u, char *mask, const char *by, const time_t expires,
if (szlines.count > 0) {
for (i = szlines.count - 1; i >= 0; i--) {
- entry = szlines.list[i];
+ entry = (SXLine *)szlines.list[i];
if (!entry)
continue;
@@ -1421,7 +1421,7 @@ int add_szline(User * u, char *mask, const char *by, const time_t expires,
}
/* We can now (really) add the SZLINE. */
- entry = scalloc(sizeof(SXLine), 1);
+ entry = (SXLine *)scalloc(sizeof(SXLine), 1);
if (!entry)
return -1;
@@ -1452,7 +1452,7 @@ int check_szline(char *nick, char *ip)
}
for (i = 0; i < szlines.count; i++) {
- sx = szlines.list[i];
+ sx = (SXLine *)szlines.list[i];
if (!sx) {
continue;
}
@@ -1476,7 +1476,7 @@ void expire_szlines(void)
SXLine *sx;
for (i = szlines.count - 1; i >= 0; i--) {
- sx = szlines.list[i];
+ sx = (SXLine *)szlines.list[i];
if (!sx->expires || sx->expires > now)
continue;
@@ -1490,7 +1490,7 @@ void expire_szlines(void)
static void free_szline_entry(SList * slist, void *item)
{
- SXLine *sx = item;
+ SXLine *sx = (SXLine *)item;
/* Remove the SZLINE from all the servers */
anope_cmd_unszline(sx->mask);
@@ -1507,8 +1507,8 @@ static void free_szline_entry(SList * slist, void *item)
static int is_szline_entry_equal(SList * slist, void *item1, void *item2)
{
- char *sx1 = item1;
- SXLine *sx2 = item2;
+ char *sx1 = (char *)item1;
+ SXLine *sx2 = (SXLine *)item2;
if (!sx1 || !sx2)
return 0;
@@ -1526,7 +1526,7 @@ static int is_szline_entry_equal(SList * slist, void *item1, void *item2)
static int compare_adminlist_entries(SList * slist, void *item1,
void *item2)
{
- NickCore *nc1 = item1, *nc2 = item2;
+ NickCore *nc1 = (NickCore *)item1, *nc2 = (NickCore *)item2;
if (!nc1 || !nc2)
return -1; /* To tell to continue */
return stricmp(nc1->display, nc2->display);
@@ -1536,7 +1536,7 @@ static int compare_adminlist_entries(SList * slist, void *item1,
static void free_adminlist_entry(SList * slist, void *item)
{
- NickCore *nc = item;
+ NickCore *nc = (NickCore *)item;
nc->flags &= ~NI_SERVICES_ADMIN;
}
@@ -1547,7 +1547,7 @@ static void free_adminlist_entry(SList * slist, void *item)
static int compare_operlist_entries(SList * slist, void *item1,
void *item2)
{
- NickCore *nc1 = item1, *nc2 = item2;
+ NickCore *nc1 = (NickCore *)item1, *nc2 = (NickCore *)item2;
if (!nc1 || !nc2)
return -1; /* To tell to continue */
return stricmp(nc1->display, nc2->display);
@@ -1557,7 +1557,7 @@ static int compare_operlist_entries(SList * slist, void *item1,
static void free_operlist_entry(SList * slist, void *item)
{
- NickCore *nc = item;
+ NickCore *nc = (NickCore *)item;
nc->flags &= ~NI_SERVICES_OPER;
}
@@ -1657,7 +1657,7 @@ char *defconReverseModes(const char *modes)
if (!modes) {
return NULL;
}
- if (!(newmodes = malloc(sizeof(char) * strlen(modes) + 1))) {
+ if (!(newmodes = (char *)malloc(sizeof(char) * strlen(modes) + 1))) {
return NULL;
}
for (i = 0; i < strlen(modes); i++) {