diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:09 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:09 +0000 |
commit | d239984fb4f726d03f0392f84234e18f0344f8a3 (patch) | |
tree | b7ff6b59711cf442ab6d07e8e9dee482cc6ec1df /src | |
parent | 3e6f3f6b54a0f5810f19eae853893ff8d8a9eb9b (diff) |
Various g++ fixes. Compiles, doesn't link.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1180 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/process.c | 6 | ||||
-rw-r--r-- | src/send.c | 2 | ||||
-rw-r--r-- | src/servers.c | 2 | ||||
-rw-r--r-- | src/sessions.c | 12 | ||||
-rw-r--r-- | src/slist.c | 2 | ||||
-rw-r--r-- | src/timeout.c | 2 | ||||
-rw-r--r-- | src/users.c | 12 |
7 files changed, 19 insertions, 19 deletions
diff --git a/src/process.c b/src/process.c index 627c94f04..b6948e80f 100644 --- a/src/process.c +++ b/src/process.c @@ -74,7 +74,7 @@ void add_ignore(const char *nick, time_t delta) /* Create new entry.. */
} else { - ign = scalloc(sizeof(*ign), 1); + ign = (IgnoreData *)scalloc(sizeof(*ign), 1); ign->mask = mask; ign->time = now + delta; ign->prev = NULL; @@ -263,12 +263,12 @@ int split_buf(char *buf, char ***argv, int colon_special) int argc; char *s; - *argv = scalloc(sizeof(char *) * argvsize, 1); + *argv = (char **)scalloc(sizeof(char *) * argvsize, 1); argc = 0; while (*buf) { if (argc == argvsize) { argvsize += 8; - *argv = srealloc(*argv, sizeof(char *) * argvsize); + *argv = (char **)srealloc(*argv, sizeof(char *) * argvsize); } if (*buf == ':') { (*argv)[argc++] = buf + 1; diff --git a/src/send.c b/src/send.c index 6d57a9823..8a827a1db 100644 --- a/src/send.c +++ b/src/send.c @@ -167,7 +167,7 @@ void notice_list(char *source, char *dest, char **text) * @param ... any number of parameters * @return void */ -void notice_lang(char *source, User * dest, int message, ...) +void notice_lang(const char *source, User * dest, int message, ...) { va_list args; char buf[4096]; /* because messages can be really big */ diff --git a/src/servers.c b/src/servers.c index dc87826ce..b2a94247a 100644 --- a/src/servers.c +++ b/src/servers.c @@ -122,7 +122,7 @@ Server *new_server(Server * uplink, const char *name, const char *desc, { Server *serv; - serv = scalloc(sizeof(Server), 1); + serv = (Server *)scalloc(sizeof(Server), 1); if (!name) name = ""; serv->name = sstrdup(name); diff --git a/src/sessions.c b/src/sessions.c index 05e90a76d..96b8f2047 100644 --- a/src/sessions.c +++ b/src/sessions.c @@ -251,7 +251,7 @@ int add_session(char *nick, char *host, char *hostip) } nsessions++; - session = scalloc(sizeof(Session), 1); + session = (Session *)scalloc(sizeof(Session), 1); session->host = sstrdup(host); list = &sessionlist[HASH(session->host)]; session->next = *list; @@ -343,7 +343,7 @@ void expire_exceptions(void) nexceptions--; memmove(exceptions + i, exceptions + i + 1, sizeof(Exception) * (nexceptions - i)); - exceptions = srealloc(exceptions, sizeof(Exception) * nexceptions); + exceptions = (Exception *)srealloc(exceptions, sizeof(Exception) * nexceptions); i--; } } @@ -409,7 +409,7 @@ void load_exceptions() case 7: SAFE(read_int16(&n, f)); nexceptions = n; - exceptions = scalloc(sizeof(Exception) * nexceptions, 1); + exceptions = (Exception *)scalloc(sizeof(Exception) * nexceptions, 1); if (!nexceptions) { close_db(f); return; @@ -532,7 +532,7 @@ int exception_add(User * u, const char *mask, const int limit, } nexceptions++; - exceptions = srealloc(exceptions, sizeof(Exception) * nexceptions); + exceptions = (Exception *)srealloc(exceptions, sizeof(Exception) * nexceptions); exceptions[nexceptions - 1].mask = sstrdup(mask); exceptions[nexceptions - 1].limit = limit; @@ -557,7 +557,7 @@ static int exception_del(const int index) nexceptions--; memmove(exceptions + index, exceptions + index + 1, sizeof(Exception) * (nexceptions - index)); - exceptions = srealloc(exceptions, sizeof(Exception) * nexceptions); + exceptions = (Exception *)srealloc(exceptions, sizeof(Exception) * nexceptions); return 1; } @@ -802,7 +802,7 @@ int do_exception(User * u) if ((n1 >= 0 && n1 < nexceptions) && (n2 >= 0 && n2 < nexceptions) && (n1 != n2)) { - exception = scalloc(sizeof(Exception), 1); + exception = (Exception *)scalloc(sizeof(Exception), 1); memcpy(exception, &exceptions[n1], sizeof(Exception)); if (n1 < n2) { diff --git a/src/slist.c b/src/slist.c index 099a59328..30de938e4 100644 --- a/src/slist.c +++ b/src/slist.c @@ -384,7 +384,7 @@ int slist_setcapacity(SList * slist, int16 capacity) slist->capacity = capacity; if (slist->capacity) slist->list = - srealloc(slist->list, sizeof(void *) * slist->capacity); + (void **)srealloc(slist->list, sizeof(void *) * slist->capacity); else { free(slist->list); slist->list = NULL; diff --git a/src/timeout.c b/src/timeout.c index 1db734654..263d3e6e0 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -93,7 +93,7 @@ void check_timeouts(void) Timeout *add_timeout(int delay, void (*code) (Timeout *), int repeat) { - Timeout *t = scalloc(sizeof(Timeout), 1); + Timeout *t = (Timeout *)scalloc(sizeof(Timeout), 1); t->settime = time(NULL); t->timeout = t->settime + delay; t->code = code; diff --git a/src/users.c b/src/users.c index 44faaf9d5..cf794ceca 100644 --- a/src/users.c +++ b/src/users.c @@ -35,7 +35,7 @@ static User *new_user(const char *nick) { User *user, **list; - user = scalloc(sizeof(User), 1); + user = (User *)scalloc(sizeof(User), 1); if (!nick) nick = ""; strscpy(user->nick, nick, NICKMAX); @@ -111,7 +111,7 @@ void update_host(User * user) free(user->na->last_usermask); user->na->last_usermask = - smalloc(strlen(common_get_vident(user)) + + (char *)smalloc(strlen(common_get_vident(user)) + strlen(common_get_vhost(user)) + 2); sprintf(user->na->last_usermask, "%s@%s", common_get_vident(user), common_get_vhost(user)); @@ -180,7 +180,7 @@ void change_user_username(User * user, const char *username) free(user->na->last_usermask); user->na->last_usermask = - smalloc(strlen(common_get_vident(user)) + + (char *)smalloc(strlen(common_get_vident(user)) + strlen(common_get_vhost(user)) + 2); sprintf(user->na->last_usermask, "%s@%s", common_get_vident(user), common_get_vhost(user)); @@ -435,7 +435,7 @@ Uid *new_uid(const char *nick, char *uid) { Uid *u, **list; - u = scalloc(sizeof(Uid), 1); + u = (Uid *)scalloc(sizeof(Uid), 1); if (!nick || !uid) { return NULL; } @@ -750,7 +750,7 @@ User *do_nick(const char *source, char *nick, char *username, char *host, if (user->na->last_usermask) free(user->na->last_usermask); user->na->last_usermask = - smalloc(strlen(common_get_vident(user)) + + (char *)smalloc(strlen(common_get_vident(user)) + strlen(common_get_vhost(user)) + 2); sprintf(user->na->last_usermask, "%s@%s", common_get_vident(user), common_get_vhost(user)); @@ -1089,7 +1089,7 @@ char *create_mask(User * u) * will never be longer than this (and will often be shorter), thus we * can use strcpy() and sprintf() safely. */ - end = mask = smalloc(ulen + strlen(common_get_vhost(u)) + 3); + end = mask = (char *)smalloc(ulen + strlen(common_get_vhost(u)) + 3); end += sprintf(end, "%s%s@", (ulen < (*(common_get_vident(u)) == |