1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 02:16:37 +02:00

BUILD : 1.7.5 (391) BUGS : N/A NOTES : Code tidy, added make strict to the makefile, allowing ansi Wall pedantic to be used for compiling

git-svn-id: svn://svn.anope.org/anope/trunk@391 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@256 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b
2004-10-12 21:48:40 +00:00
parent 61ad72831e
commit ee5de492f7
14 changed files with 87 additions and 44 deletions
+1
View File
@@ -4,6 +4,7 @@ Provided by Anope Dev. <dev@anope.org> - 2004
09/20 A Added RestrictOperNicks as new feature in services.conf. [ #00]
09/08 A Removed rand() and ported bsd's arc4random() to fit our needs. [ #00]
08/24 A New -l option for am script to list possible selectors. [ #00]
10/12 F Code Tidy, fixed some error checking. [ #00]
10/09 F Bug in LogChannel possibly causing segfaults. [#176]
10/03 F Changed UserKeys from uint to long uint. [ #00]
09/21 F An option to explicitly not use mysql is added to Config [ #00]
+6
View File
@@ -30,6 +30,12 @@ build:
( cd $$i; ${MAKE} ${MAKEARGS} all; ) \
done
strict: language headers
@for i in $(SUBDIRS); do \
echo "*** Strict Building $$i";\
( cd $$i; ${MAKE} ${MAKEARGS} 'CFLAGS=${CFLAGS} -ansi -Wall -pedantic' all; ) \
done
modules: build
(cd src/modules ; ./configure ; ${MAKE} ${MAKEARGS} all; )
@echo "*** All done, now (g)make install to install Anope/Modules";
+4 -2
View File
@@ -15,6 +15,8 @@
#ifndef DATAFILES_H
#define DATAFILES_H
#include <sys/param.h>
/*************************************************************************/
typedef struct dbFILE_ dbFILE;
@@ -23,8 +25,8 @@ struct dbFILE_ {
FILE *fp; /* The normal file descriptor */
FILE *backupfp; /* Open file pointer to a backup copy of
* the database file (if non-NULL) */
char filename[PATH_MAX]; /* Name of the database file */
char backupname[PATH_MAX]; /* Name of the backup file */
char filename[MAXPATHLEN]; /* Name of the database file */
char backupname[MAXPATHLEN]; /* Name of the backup file */
};
/*************************************************************************/
+16
View File
@@ -202,6 +202,22 @@
#include <sys/types.h>
#endif
#ifdef __STRICT_ANSI__
#include <stdarg.h>
#include <stdio.h>
/* We KNOW these are not ansi, we are defining them here to suppress the warning
s messages on a "make strict" compile */
int snprintf(char *str, size_t size, const char *format, ...);
int vprintf(const char *format, va_list ap);
int vfprintf(FILE *stream, const char *format, va_list ap);
int vsprintf(char *str, const char *format, va_list ap);
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
typedef unsigned char u_char;
#endif
typedef int16_t int16;
typedef u_int16_t uint16;
typedef int32_t int32;
+16 -2
View File
@@ -44,12 +44,16 @@
#include <stdlib.h>
#include <string.h>
#undef getline
int numstrings = 0; /* Number of strings we should have */
char **stringnames; /* Names of the strings (from index file) */
char **strings; /* Strings we have loaded */
int linenum = 0; /* Current line number in input file */
char *anopeStrDup(const char *src);
/*************************************************************************/
/* Read the index file and load numstrings and stringnames. Return -1 on
@@ -80,7 +84,7 @@ int read_index_file()
while (fgets(buf, sizeof(buf), f)) {
if (buf[strlen(buf)-1] == '\n')
buf[strlen(buf)-1] = '\0';
if (!(stringnames[i++] = strdup(buf))) {
if (!(stringnames[i++] = anopeStrDup(buf))) {
perror("strdup()");
return -1;
}
@@ -143,10 +147,20 @@ int fput32(int val, FILE *f)
}
/*************************************************************************/
char *anopeStrDup(const char *src) {
char *ret=NULL;
if(src) {
if( (ret = (char *)malloc(strlen(src)+1)) ) {;
strcpy(ret,src);
}
}
return ret;
}
/*************************************************************************/
int main(int ac, char **av)
{
unsigned char *filename = NULL, *s;
char *filename = NULL, *s;
char langname[254], outfile[256];
FILE *in, *out;
int warn = 0;
+21 -18
View File
@@ -608,8 +608,8 @@ void load_bs_dbase(void)
{
dbFILE *f;
int c, ver;
int16 tmp16;
int32 tmp32;
uint16 tmp16;
uint32 tmp32;
BotInfo *bi;
int failed = 0;
@@ -1891,8 +1891,9 @@ static int do_kickcmd(User * u)
if (!stricmp(option, "BADWORDS")) {
if (!stricmp(value, "ON")) {
if (ttb) {
ci->ttb[TTB_BADWORDS] = atol(ttb);
if (ci->ttb[TTB_BADWORDS] < 0) {
ci->ttb[TTB_BADWORDS] =
strtol(ttb, (char **) NULL, 10);
if (errno) {
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -1911,8 +1912,8 @@ static int do_kickcmd(User * u)
} else if (!stricmp(option, "BOLDS")) {
if (!stricmp(value, "ON")) {
if (ttb) {
ci->ttb[TTB_BOLDS] = atol(ttb);
if (ci->ttb[TTB_BOLDS] < 0) {
ci->ttb[TTB_BOLDS] = strtol(ttb, (char **) NULL, 10);
if (errno) {
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -1934,8 +1935,8 @@ static int do_kickcmd(User * u)
char *percent = strtok(NULL, " ");
if (ttb) {
ci->ttb[TTB_CAPS] = atol(ttb);
if (ci->ttb[TTB_CAPS] < 0) {
ci->ttb[TTB_CAPS] = strtol(ttb, (char **) NULL, 10);
if (errno) {
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -1971,8 +1972,8 @@ static int do_kickcmd(User * u)
} else if (!stricmp(option, "COLORS")) {
if (!stricmp(value, "ON")) {
if (ttb) {
ci->ttb[TTB_COLORS] = atol(ttb);
if (ci->ttb[TTB_COLORS] < 0) {
ci->ttb[TTB_COLORS] = strtol(ttb, (char **) NULL, 10);
if (errno) {
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -1994,8 +1995,8 @@ static int do_kickcmd(User * u)
char *secs = strtok(NULL, " ");
if (ttb) {
ci->ttb[TTB_FLOOD] = atol(ttb);
if (ci->ttb[TTB_FLOOD] < 0) {
ci->ttb[TTB_FLOOD] = strtol(ttb, (char **) NULL, 10);
if (errno) {
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -2033,8 +2034,8 @@ static int do_kickcmd(User * u)
char *times = strtok(NULL, " ");
if (ttb) {
ci->ttb[TTB_REPEAT] = atol(ttb);
if (ci->ttb[TTB_REPEAT] < 0) {
ci->ttb[TTB_REPEAT] = strtol(ttb, (char **) NULL, 10);
if (errno) {
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -2062,8 +2063,9 @@ static int do_kickcmd(User * u)
} else if (!stricmp(option, "REVERSES")) {
if (!stricmp(value, "ON")) {
if (ttb) {
ci->ttb[TTB_REVERSES] = atol(ttb);
if (ci->ttb[TTB_REVERSES] < 0) {
ci->ttb[TTB_REVERSES] =
strtol(ttb, (char **) NULL, 10);
if (errno) {
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
@@ -2082,8 +2084,9 @@ static int do_kickcmd(User * u)
} else if (!stricmp(option, "UNDERLINES")) {
if (!stricmp(value, "ON")) {
if (ttb) {
ci->ttb[TTB_UNDERLINES] = atol(ttb);
if (ci->ttb[TTB_UNDERLINES] < 0) {
ci->ttb[TTB_UNDERLINES] =
strtol(ttb, (char **) NULL, 10);
if (errno) {
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
return MOD_CONT;
}
+3 -3
View File
@@ -624,7 +624,7 @@ void chanserv(User * u, char *buf)
void load_cs_dbase(void)
{
dbFILE *f;
int ver, i, j, c, m;
int ver, i, j, c;
ChannelInfo *ci, **last, *prev;
int failed = 0;
@@ -634,8 +634,8 @@ void load_cs_dbase(void)
ver = get_file_version(f);
for (i = 0; i < 256 && !failed; i++) {
int16 tmp16;
int32 tmp32;
uint16 tmp16;
uint32 tmp32;
int n_levels;
char *s;
NickAlias *na;
+2 -3
View File
@@ -291,7 +291,6 @@ void memo_send(User * u, char *name, char *text, int z)
time_t now = time(NULL);
char *source = u->na->nc->display;
int is_servoper = is_services_oper(u);
int j;
if (readonly) {
notice_lang(s_MemoServ, u, MEMO_SEND_DISABLED);
@@ -310,7 +309,7 @@ void memo_send(User * u, char *name, char *text, int z)
notice_lang(s_MemoServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
} else if (!(mi = getmemoinfo(name, &ischan, &isforbid))) {
if (z == 0 || z == 3)
if (z == 0 || z == 3) {
if (isforbid) {
notice_lang(s_MemoServ, u,
ischan ? CHAN_X_FORBIDDEN :
@@ -320,7 +319,7 @@ void memo_send(User * u, char *name, char *text, int z)
ischan ? CHAN_X_NOT_REGISTERED :
NICK_X_NOT_REGISTERED, name);
}
}
} else if (z != 2 && MSSendDelay > 0 &&
u && u->lastmemosend + MSSendDelay > now && !is_servoper) {
u->lastmemosend = now;
+1 -2
View File
@@ -751,7 +751,7 @@ static void arc4_init(void)
rs.j = 0;
}
static inline void arc4_addrandom(void *dat, int datlen)
static void arc4_addrandom(void *dat, int datlen)
{
int n;
u_int8_t si;
@@ -907,4 +907,3 @@ char *host_resolve(char *host)
}
}
+7 -7
View File
@@ -2003,18 +2003,18 @@ void moduleCleanStruct(ModuleData **moduleData) {
**/
boolean moduleMinVersion(int major,int minor,int patch,int build) {
boolean ret=false;
if(VERSION_MAJOR>major) { // Def. new
if(VERSION_MAJOR>major) { /* Def. new */
ret = true;
} else if(VERSION_MAJOR == major) { // Might be newer
if(minor == -1) { return true; } // They dont care about minor
if(VERSION_MINOR > minor) { // Def. newer
} else if(VERSION_MAJOR == major) { /* Might be newer */
if(minor == -1) { return true; } /* They dont care about minor */
if(VERSION_MINOR > minor) { /* Def. newer*/
ret = true;
} else if(VERSION_MINOR == minor) { // Might be newer
if(patch == -1) { return true; } // They dont care about patch
} else if(VERSION_MINOR == minor) { /* Might be newer */
if(patch == -1) { return true; } /* They dont care about patch */
if(VERSION_PATCH > patch) {
ret = true;
} else if(VERSION_PATCH == patch) {
if(build == -1) { return true; } // They dont care about build
if(build == -1) { return true; } /* They dont care about build */
if(VERSION_BUILD >= build) {
ret = true;
}
+2 -2
View File
@@ -1167,7 +1167,7 @@ void db_mysql_load_cs_dbase(void)
{
char sqlcmd[MAX_SQL_BUF], *tempstr;
ChannelInfo *ci;
int n_levels, j, m;
int n_levels, j;
MYSQL_RES *res;
MYSQL_ROW row;
@@ -1436,7 +1436,7 @@ void db_mysql_load_ns_dbase(void)
NickAlias *na;
MYSQL_RES *res;
MYSQL_ROW row;
int i, j, m;
int i, j;
if (!do_mysql)
return;
+2 -3
View File
@@ -367,7 +367,7 @@ void nickserv(User * u, char *buf)
void load_old_ns_dbase(void)
{
dbFILE *f;
int ver, i, j, c, m;
int ver, i, j, c;
NickAlias *na, *na2, *next;
NickCore *nc;
int failed = 0;
@@ -657,7 +657,7 @@ void load_ns_req_db(void)
void load_ns_dbase(void)
{
dbFILE *f;
int ver, i, j, c, m;
int ver, i, j, c;
NickAlias *na, **nalast, *naprev;
NickCore *nc, **nclast, *ncprev;
int failed = 0;
@@ -3328,7 +3328,6 @@ static int do_info(User * u)
NickAlias *na;
NickRequest *nr = NULL;
int is_servadmin = is_services_admin(u);
char *vHost;
if (!nick) {
syntax_error(s_NickServ, u, "INFO", NICK_INFO_SYNTAX);
+1 -1
View File
@@ -1935,7 +1935,7 @@ void anope_cmd_svid_umode2(User * u, char *ts)
void anope_cmd_svid_umode3(User * u, char *ts)
{
// not used
/* not used */
}
int anope_event_error(char *source, int ac, char **av)
+5 -1
View File
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="5"
VERSION_BUILD="390"
VERSION_BUILD="391"
# $Log$
#
# BUILD : 1.7.5 (391)
# BUGS : N/A
# NOTES : Code tidy, added make strict to the makefile, allowing ansi Wall pedantic to be used for compiling
#
# BUILD : 1.7.5 (390)
# BUGS : 149
# NOTES : Bug in MySQL debug, possibly causing segfaults.