1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 19:23:12 +02:00

BUILD : 1.7.6 (499) BUGS : NOTES : Fixed several compiler warnings with make strict, removed 2 deprecated config vars.

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


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@353 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b
2004-12-25 13:16:18 +00:00
parent 44e6352387
commit 250a9f71cf
14 changed files with 85 additions and 71 deletions
+3 -1
View File
@@ -285,6 +285,7 @@ char *encode_ip(u_char * ip)
static char buf[25];
u_char *cp;
struct in_addr ia; /* For IPv4 */
char *s_ip; /* Signed ip string */
if (!ip)
return "*";
@@ -292,7 +293,8 @@ char *encode_ip(u_char * ip)
if (strchr((char *) ip, ':')) {
return NULL;
} else {
ia.s_addr = inet_addr(ip);
s_ip = str_signed(ip);
ia.s_addr = inet_addr(s_ip);
cp = (u_char *) ia.s_addr;
b64_encode((char *) &cp, sizeof(struct in_addr), buf, 25);
}
+10 -9
View File
@@ -741,10 +741,9 @@ void load_cs_dbase(void)
ci->levels = scalloc(2 * CA_SIZE, 1);
reset_levels(ci);
for (j = 0; j < n_levels; j++) {
SAFE(read_int16(&tmp16));
if (j < CA_SIZE)
SAFE(read_int16(&ci->levels[j], f));
else
SAFE(read_int16(&tmp16, f));
ci->levels[j] = (int16) tmp16;
}
/* To avoid levels list silly hacks */
if (ver < 10)
@@ -775,7 +774,8 @@ void load_cs_dbase(void)
for (j = 0; j < ci->accesscount; j++) {
SAFE(read_int16(&ci->access[j].in_use, f));
if (ci->access[j].in_use) {
SAFE(read_int16(&ci->access[j].level, f));
SAFE(read_int16(&tmp16, f));
ci->access[j].level = (int16) tmp16;
SAFE(read_string(&s, f));
if (s) {
if (ver >= 13)
@@ -900,8 +900,10 @@ void load_cs_dbase(void)
}
}
SAFE(read_int16(&ci->memos.memocount, f));
SAFE(read_int16(&ci->memos.memomax, f));
SAFE(read_int16(&tmp16, f));
ci->memos.memocount = (int16) tmp16;
SAFE(read_int16(&tmp16, f));
ci->memos.memomax = (int16) tmp16;
if (ci->memos.memocount) {
Memo *memos;
memos = scalloc(sizeof(Memo) * ci->memos.memocount, 1);
@@ -949,10 +951,9 @@ void load_cs_dbase(void)
n_ttb = tmp16;
ci->ttb = scalloc(2 * TTB_SIZE, 1);
for (j = 0; j < n_ttb; j++) {
SAFE(read_int16(&tmp16, f));
if (j < TTB_SIZE)
SAFE(read_int16(&ci->ttb[j], f));
else
SAFE(read_int16(&tmp16, f));
ci->ttb[j] = (int16) tmp16;
}
for (j = n_ttb; j < TTB_SIZE; j++)
ci->ttb[j] = 0;
+1 -25
View File
@@ -41,9 +41,6 @@ static char *temp_userhost;
char *HelpChannel;
char *LogChannel;
char *NetworkDomain;
char **NetworkDomains;
int DomainNumber;
char *NetworkName;
char *s_NickServ;
@@ -337,11 +334,7 @@ int NumUlines;
/* Deprecated directive (dep_) and value checking (chk_) functions: */
static void dep_ListOpersOnly(void)
{
NSListOpersOnly = 1;
CSListOpersOnly = 1;
}
/* Hey, there are no left! -GD */
/*************************************************************************/
@@ -486,8 +479,6 @@ Directive directives[] = {
{"KillClonesAkillExpire",
{{PARAM_TIME, PARAM_RELOAD, &KillClonesAkillExpire}}},
{"LimitSessions", {{PARAM_SET, PARAM_FULLONLY, &LimitSessions}}},
{"ListOpersOnly",
{{PARAM_DEPRECATED, PARAM_RELOAD, dep_ListOpersOnly}}},
{"LocalAddress", {{PARAM_STRING, 0, &LocalHost},
{PARAM_PORT, PARAM_OPTIONAL, &LocalPort}}},
{"LogUsers", {{PARAM_SET, PARAM_RELOAD, &LogUsers}}},
@@ -518,7 +509,6 @@ Directive directives[] = {
{"MSNotifyAll", {{PARAM_SET, PARAM_RELOAD, &MSNotifyAll}}},
{"MSSendDelay", {{PARAM_TIME, PARAM_RELOAD, &MSSendDelay}}},
{"MSMemoReceipt", {{PARAM_POSINT, PARAM_RELOAD, &MSMemoReceipt}}},
{"NetworkDomain", {{PARAM_STRING, PARAM_RELOAD, &NetworkDomain}}},
{"NetworkName", {{PARAM_STRING, PARAM_RELOAD, &NetworkName}}},
{"NewsCount", {{PARAM_POSINT, PARAM_RELOAD, &NewsCount}}},
{"NewsDB", {{PARAM_STRING, PARAM_RELOAD, &NewsDBName}}},
@@ -1385,20 +1375,6 @@ int read_config(int reload)
NSRExpire = 0;
}
/* Network Domain building */
DomainNumber = 0;
if (NetworkDomain) {
s = strtok(NetworkDomain, " ");
if (s) {
do {
DomainNumber++;
NetworkDomains =
realloc(NetworkDomains, sizeof(char *) * DomainNumber);
NetworkDomains[DomainNumber - 1] = sstrdup(s);
} while ((s = strtok(NULL, " ")));
}
}
if (!retval) {
printf
("\n*** Support resources: Read through the services.conf self-contained \n*** documentation. Read the documentation files found in the 'docs' \n*** folder. Visit our portal located at http://www.anope.org/. Join \n*** our support channel on /server irc.anope.org channel #anope.\n\n");
+22
View File
@@ -1103,4 +1103,26 @@ char *host_resolve(char *host)
}
}
/*************************************************************************/
/**
* Change an unsigned string to a signed string, overwriting the original
* string.
* @param input string
* @return output string, same as input string.
*/
char *str_signed(u_char *str)
{
char *nstr;
nstr = (char *)str;
while (*str) {
*nstr = (char)*str;
str++; nstr++;
}
return nstr;
}
/* EOF */
+3 -2
View File
@@ -337,10 +337,11 @@ int loadModule(Module * m, User * u)
strncpy(buf, MODULE_PATH, 4095); /* Get full path with .so extension */
len = strlen(buf);
strncat(buf, "runtime/", 4095 - len);
len += strlen(buf);
len = strlen(buf);
strncat(buf, m->name, 4095 - len);
len += strlen(buf);
len = strlen(buf);
strncat(buf, ".so", 4095 - len);
buf[4095] = '\0';
m->filename = sstrdup(buf);
#ifdef HAS_RTLD_LOCAL
+8 -4
View File
@@ -543,8 +543,10 @@ void load_old_ns_dbase(void)
SAFE(read_string(access, f));
}
SAFE(read_int16(&nc->memos.memocount, f));
SAFE(read_int16(&nc->memos.memomax, f));
SAFE(read_int16(&tmp16, f));
nc->memos.memocount = (int16) tmp16;
SAFE(read_int16(&tmp16, f));
nc->memos.memomax = (int16) tmp16;
if (nc->memos.memocount) {
Memo *memos;
memos = scalloc(sizeof(Memo) * nc->memos.memocount, 1);
@@ -741,8 +743,10 @@ void load_ns_dbase(void)
SAFE(read_string(access, f));
}
SAFE(read_int16(&nc->memos.memocount, f));
SAFE(read_int16(&nc->memos.memomax, f));
SAFE(read_int16(&tmp16, f));
nc->memos.memocount = (int16) tmp16;
SAFE(read_int16(&tmp16, f));
nc->memos.memomax = (int16) tmp16;
if (nc->memos.memocount) {
Memo *memos;
memos = scalloc(sizeof(Memo) * nc->memos.memocount, 1);
+2 -1
View File
@@ -1353,10 +1353,11 @@ void anope_cmd_squit(char *servname, char *message)
int anope_event_mode(char *source, int ac, char **av)
{
Server *s;
if (ac < 2)
return MOD_CONT;
Server *s;
s = findserver(servlist, source);
if (*av[0] == '#' || *av[0] == '&') {
+1 -1
View File
@@ -1506,7 +1506,7 @@ int anope_event_netinfo(char *source, int ac, char **av)
void anope_cmd_netinfo(int ac, char **av)
{
send_cmd(NULL, "%s %ld %ld %d %s 0 0 0 :%s",
send_token("NETINFO", "AO"), maxusercnt,
send_token("NETINFO", "AO"), (long int) maxusercnt,
(long int) time(NULL), atoi(av[2]), av[3], av[7]);
}