1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 01:43:13 +02:00

Make a bunch of stuff build under g++.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1171 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Robin Burchell w00t@inspircd.org
2008-09-30 18:45:08 +00:00
parent 640b5fb2e1
commit e3adfa4191
6 changed files with 38 additions and 50 deletions
+6 -6
View File
@@ -53,7 +53,7 @@ E IRCDProto ircdproto;
/**** actions.c ****/
E void kill_user(char *source, char *user, char *reason);
E void kill_user(const char *source, const char *user, const char *reason);
E void bad_password(User * u);
E void sqline(char *mask, char *reason);
E void common_unban(ChannelInfo * ci, char *nick);
@@ -594,7 +594,7 @@ E char *getvHost(char *nick);
E int is_host_remover(User * u);
E int is_host_setter(User *u);
E HostCore *hostCoreListHead();
E HostCore *findHostCore(HostCore * head, char *nick, boolean * found);
E HostCore *findHostCore(HostCore * head, char *nick, bool *found);
E HostCore *createHostCorelist(HostCore * next, char *nick, char *vIdent, char *vHost, char *creator, int32 tmp_time);
E HostCore *insertHostCore(HostCore * head, HostCore * prev, char *nick, char *vIdent, char *vHost, char *creator, int32 tmp_time);
E HostCore *deleteHostCore(HostCore * head, HostCore * prev);
@@ -833,7 +833,7 @@ E size_t strlcpy(char *, const char *, size_t);
E size_t strlcat(char *, const char *, size_t);
#endif
E char *stristr(char *s1, char *s2);
E char *strnrepl(char *s, int32 size, const char *old, const char *new);
E char *strnrepl(char *s, int32 size, const char *old, const char *nstr);
E char *merge_args(int argc, char **argv);
E int match_wild(const char *pattern, const char *str);
E int match_wild_nocase(const char *pattern, const char *str);
@@ -887,7 +887,7 @@ E int str_is_cidr(char *str, uint32 * ip, uint32 * mask, char **host);
/**** modules.c ****/
E void modules_core_init(int number, char **list);
E void modules_unload_all(boolean fini, boolean unload_proto); /* Read warnings near function source */
E void modules_unload_all(bool fini, bool unload_proto); /* Read warnings near function source */
E void moduleCallBackRun(void);
E void moduleCleanStruct(ModuleData **moduleData);
E void ModuleDatabaseBackup(char *dbname);
@@ -1157,7 +1157,7 @@ E User *do_nick(const char *source, char *nick, char *username, char *host,
E void do_umode(const char *source, int ac, char **av);
E void do_umode2(const char *source, int ac, char **av);
E void do_quit(const char *source, int ac, char **av);
E void do_kill(char *source, char *reason);
E void do_kill(const char *source, const char *reason);
E int is_oper(User * user);
E int is_protected(User * user);
@@ -1276,7 +1276,7 @@ E void anope_cmd_svshold(char *nick); /* SVSHOLD */
E void anope_cmd_release_svshold(char *nick); /* SVSHOLD */
E void anope_cmd_svsinfo(); /* SVSINFO */
E void anope_cmd_svsjoin(char *source, char *nick,char *chan, char *param); /* SVSJOIN */
E void anope_cmd_svskill(char *source,char *user, const char *fmt, ...); /* SVSKILL */
E void anope_cmd_svskill(const char *source, const char *user, const char *fmt, ...); /* SVSKILL */
E void anope_cmd_svsmode(User * u, int ac, char **av); /* SVSMODE */
E void anope_cmd_svsmode_chan(char *name, char *mode, char *nick); /* SVSMODE */
E void anope_cmd_svsnick(char *nick,char *newnick, time_t when); /* SVSNICK */
+1 -1
View File
@@ -363,7 +363,7 @@ MDE void moduleDelData(ModuleData **md, char *key); /* Delete this key/value
MDE void moduleDelAllData(ModuleData **md); /* Delete all key/value pairs for this module for this struct */
void moduleDelAllDataMod(Module *m); /* remove all module data from all structs for this module */
int moduleDataDebug(ModuleData **md); /* Allow for debug output of a moduleData struct */
MDE boolean moduleMinVersion(int major,int minor,int patch,int build); /* Checks if the current version of anope is before or after a given verison */
MDE bool moduleMinVersion(int major,int minor,int patch,int build); /* Checks if the current version of anope is before or after a given verison */
/*************************************************************************/
/* Module Queue Operations */
+20 -32
View File
@@ -246,23 +246,6 @@ typedef struct uid_ Uid;
/*************************************************************************/
/* Windows defines a boolean type as an
* unsigned char. It does however need
* true/false. -- codemastr
*/
#ifndef _WIN32
typedef enum { false, true } boolean;
#else
#ifndef true
#define true 1
#endif
#ifndef false
#define false 0
#endif
#endif /* _WIN32 */
/*************************************************************************/
/* Protocol tweaks */
typedef struct ircdvars_ IRCDVar;
@@ -850,6 +833,16 @@ struct server_ {
#define SERVER_JUPED 0x0002
/*************************************************************************/
struct u_chanlist {
struct u_chanlist *next, *prev;
Channel *chan;
int16 status; /* Associated flags; see CSTATUS_* below. */
};
struct u_chaninfolist {
struct u_chaninfolist *next, *prev;
ChannelInfo *chan;
};
/* Online user and channel data. */
struct user_ {
@@ -877,16 +870,8 @@ struct user_ {
int isSuperAdmin; /* is SuperAdmin on or off? */
struct u_chanlist {
struct u_chanlist *next, *prev;
Channel *chan;
int16 status; /* Associated flags; see CSTATUS_* below. */
} *chans; /* Channels user has joined */
struct u_chaninfolist {
struct u_chaninfolist *next, *prev;
ChannelInfo *chan;
} *founder_chans; /* Channels user has identified for */
struct u_chanlist *chans; /* Channels user has joined */
struct u_chaninfolist *founder_chans; /* Channels user has identified for */
short invalid_pw_count; /* # of invalid password attempts */
time_t invalid_pw_time; /* Time of last invalid password */
@@ -977,6 +962,12 @@ struct userdata_ {
#define ENTRYTYPE_HOST_WILD 0x00000040
#define ENTRYTYPE_HOST 0x00000080
struct c_userlist {
struct c_userlist *next, *prev;
User *user;
UserData *ud;
};
struct channel_ {
Channel *next, *prev;
char name[CHANMAX];
@@ -993,11 +984,8 @@ struct channel_ {
EList *bans;
EList *excepts;
EList *invites;
struct c_userlist {
struct c_userlist *next, *prev;
User *user;
UserData *ud;
} *users;
struct c_userlist *users;
int16 usercount;
BanData *bd;
+4 -4
View File
@@ -76,11 +76,11 @@ int read_index_file()
}
while (fgets(buf, sizeof(buf), f))
numstrings++;
if (!(stringnames = calloc(sizeof(char *), numstrings))) {
if (!(stringnames = (char **)calloc(sizeof(char *), numstrings))) {
perror("calloc(stringnames)");
return -1;
}
if (!(strings = calloc(sizeof(char *), numstrings))) {
if (!(strings = (char **)calloc(sizeof(char *), numstrings))) {
perror("calloc(strings)");
return -1;
}
@@ -215,7 +215,7 @@ int main(int ac, char **av)
line++;
i = strings[curstring] ? strlen(strings[curstring]) : 0;
if (!(strings[curstring] =
realloc(strings[curstring], i+strlen(line)+2))) {
(char *)realloc(strings[curstring], i+strlen(line)+2))) {
fprintf(stderr, "%s:%d: Out of memory!\n",filename,linenum);
return 2;
}
@@ -234,7 +234,7 @@ int main(int ac, char **av)
retval = 1;
maxerr--;
} else {
if (!(strings[curstring] = malloc(1))) {
if (!(strings[curstring] = (char *)malloc(1))) {
fprintf(stderr, "%s:%d: Out of memory!\n",filename,linenum);
return 2;
}
+1 -1
View File
@@ -49,7 +49,7 @@ void bad_password(User * u)
* @param reason for the kill
* @return void
*/
void kill_user(char *source, char *user, char *reason)
void kill_user(const char *source, const char *user, const char *reason)
{
char buf[BUFSIZE];
+6 -6
View File
@@ -269,7 +269,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
nbuf + strlen(nbuf) - len)))) {
mustkick = 1;
} else {
char *wordbuf = scalloc(len + 3, 1);
char *wordbuf = (char *)scalloc(len + 3, 1);
wordbuf[0] = ' ';
wordbuf[len + 1] = ' ';
@@ -296,7 +296,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
&& (!strnicmp(nbuf, bw->word, len)))) {
mustkick = 1;
} else {
char *wordbuf = scalloc(len + 2, 1);
char *wordbuf = (char *)scalloc(len + 2, 1);
memcpy(wordbuf + 1, bw->word, len);
wordbuf[0] = ' ';
@@ -323,7 +323,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
len)))) {
mustkick = 1;
} else {
char *wordbuf = scalloc(len + 2, 1);
char *wordbuf = (char *)scalloc(len + 2, 1);
memcpy(wordbuf, bw->word, len);
wordbuf[len] = ' ';
@@ -599,7 +599,7 @@ BotInfo *makebot(char *nick)
return NULL;
}
bi = scalloc(sizeof(BotInfo), 1);
bi = (BotInfo *)scalloc(sizeof(BotInfo), 1);
bi->nick = sstrdup(nick);
bi->lastmsg = time(NULL);
insert_bot(bi);
@@ -698,7 +698,7 @@ static BanData *get_ban_data(Channel * c, User * u)
}
/* If we fall here it is that we haven't found the record */
bd = scalloc(sizeof(BanData), 1);
bd = (BanData *)scalloc(sizeof(BanData), 1);
bd->mask = sstrdup(mask);
bd->last_use = now;
@@ -741,7 +741,7 @@ static UserData *get_user_data(Channel * c, User * u)
return user->ud;
} else {
user->ud = scalloc(sizeof(UserData), 1);
user->ud = (UserData *)scalloc(sizeof(UserData), 1);
user->ud->last_use = time(NULL);
return user->ud;
}