[ircd-ratbox] Minor Patch
Dustin Marquess
jailbird at alcatraz.fdf.net
Tue Jun 1 20:30:55 EDT 2004
Here's a minor patch that I threw together against the RATBOX_1 branch.
The first change removes an unneeded return at the end of a void
function.
The rest of them remove < 0 checks against unsigned variables.
These clean-up most of the warnings that the Compaq C Compiler spits-out
with full warnings enabled (-w0).
-Dustin
-------------- next part --------------
diff -ur ircd-ratbox/adns/event.c ircd-ratbox.new/adns/event.c
--- ircd-ratbox/adns/event.c 2003-06-26 09:00:46.000000000 -0500
+++ ircd-ratbox.new/adns/event.c 2004-06-01 19:22:37.000000000 -0500
@@ -269,7 +269,6 @@
abort();
}
}
- return;
}
void adns__timeouts(adns_state ads, int act,
diff -ur ircd-ratbox/src/balloc.c ircd-ratbox.new/src/balloc.c
--- ircd-ratbox/src/balloc.c 2004-03-15 12:19:54.000000000 -0600
+++ ircd-ratbox.new/src/balloc.c 2004-06-01 19:24:19.000000000 -0500
@@ -260,7 +260,7 @@
s_assert(elemsize > 0 && elemsperblock > 0);
/* Catch idiotic requests up front */
- if((elemsize <= 0) || (elemsperblock <= 0))
+ if((elemsize = 0) || (elemsperblock <= 0))
{
blockheap_fail("Attempting to BlockHeapCreate idiotic sizes");
}
diff -ur ircd-ratbox/src/channel.c ircd-ratbox.new/src/channel.c
--- ircd-ratbox/src/channel.c 2004-04-27 11:04:34.000000000 -0500
+++ ircd-ratbox.new/src/channel.c 2004-06-01 19:25:34.000000000 -0500
@@ -171,7 +171,7 @@
BlockHeapFree(member_heap, msptr);
- if(dlink_list_length(&chptr->members) <= 0)
+ if(dlink_list_length(&chptr->members) = 0)
{
destroy_channel(chptr);
return 1;
@@ -209,7 +209,7 @@
chptr->users_last = CurrentTime;
- if(dlink_list_length(&chptr->members) <= 0)
+ if(dlink_list_length(&chptr->members) = 0)
destroy_channel(chptr);
BlockHeapFree(member_heap, msptr);
@@ -246,7 +246,7 @@
chptr->users_last = CurrentTime;
- if(dlink_list_length(&chptr->members) <= 0)
+ if(dlink_list_length(&chptr->members) = 0)
{
destroy_channel(chptr);
}
diff -ur ircd-ratbox/src/patricia.c ircd-ratbox.new/src/patricia.c
--- ircd-ratbox/src/patricia.c 2003-06-26 09:03:17.000000000 -0500
+++ ircd-ratbox.new/src/patricia.c 2004-06-01 19:26:12.000000000 -0500
@@ -212,7 +212,7 @@
memcpy(save, string, cp - string);
save[cp - string] = '\0';
string = save;
- if(bitlen < 0 || bitlen > maxbitlen)
+ if(bitlen > maxbitlen)
bitlen = maxbitlen;
}
else
More information about the ircd-ratbox
mailing list