From 3f41f9d9261ceca571ecdf3f8f075c94b21281de Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Mon, 9 Jul 2001 16:33:37 +0000 Subject: [PATCH] Author: Kev Log message: Stomp some warnings discovered on NetBSD, on an alpha running NetBSD, and under -O1 instead of -O3. Remaining: "statement with no affect" in an assert on line 489 of fda.c; pointer type mismatch warning for calls to getsockopt() in the engines--due to NetBSD's use of socklen_t, which may not always be available. The former could be solved by removing the assert and testing the condition during the configure stage; the latter could be solved by defining socklen_t ourselves at configure time. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@528 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 24 +++++++++++++++++++ ircd/IPcheck.c | 2 +- ircd/channel.c | 64 ------------------------------------------------- ircd/client.c | 1 + ircd/ircd_log.c | 1 + ircd/m_away.c | 1 + ircd/m_map.c | 1 + ircd/os_bsd.c | 3 ++- 8 files changed, 31 insertions(+), 66 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb75115..ecce833 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2001-07-09 Kevin L. Mitchell + + * ircd/os_bsd.c (os_get_rusage): move buf into the two ifdef'd + sections so that if neither is used, the declaration of buf will + not elicit an "unused variable" warning under NetBSD + + * ircd/m_map.c: include string.h to declare strcpy (fix warnings + on alpha) + + * ircd/m_away.c: include string.h to declare strcpy/strlen (fix + warnings on alpha) + + * ircd/ircd_log.c: include string.h to declare strcpy/strlen (fix + warnings on alpha) + + * ircd/client.c: include string.h to declare memset (fix warnings + on alpha) + + * ircd/channel.c: remove unused functions next_overlapped_ban, + del_banid, and is_deopped (fix warnings under -O1) + + * ircd/IPcheck.c: include string.h to declare memset/memcpy (fix + warnings on alpha) + 2001-06-29 Kevin L. Mitchell * ircd/s_user.c (set_user_mode): clear the snomask if the user diff --git a/ircd/IPcheck.c b/ircd/IPcheck.c index e1f052d..cabeaef 100644 --- a/ircd/IPcheck.c +++ b/ircd/IPcheck.c @@ -36,7 +36,7 @@ #include "send.h" #include - +#include struct IPTargetEntry { int count; diff --git a/ircd/channel.c b/ircd/channel.c index ea46920..c209148 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -62,8 +62,6 @@ struct Channel* GlobalChannelList = 0; static unsigned int membershipAllocCount; static struct Membership* membershipFreeList; -static struct SLink *next_overlapped_ban(void); -static int del_banid(struct Channel *, char *, int); void del_invite(struct Client *, struct Channel *); const char* const PartFmt1 = ":%s " MSG_PART " %s"; @@ -376,20 +374,6 @@ int add_banid(struct Client *cptr, struct Channel *chptr, char *banid, return 0; } -static struct SLink *next_overlapped_ban(void) -{ - struct SLink *tmp = next_ban; - if (tmp) - { - struct SLink *ban; - for (ban = tmp->next; ban; ban = ban->next) - if ((ban->flags & CHFL_BAN_OVERLAPPED)) - break; - next_ban = ban; - } - return tmp; -} - struct SLink *next_removed_overlapped_ban(void) { struct SLink *tmp = removed_bans_list; @@ -407,43 +391,6 @@ struct SLink *next_removed_overlapped_ban(void) return tmp; } -/* - * del_banid - * - * If `change' is true, delete `banid' from channel `chptr'. - * Returns `false' if removal was (or would have been) successful. - */ -static int del_banid(struct Channel *chptr, char *banid, int change) -{ - struct SLink **ban; - struct SLink *tmp; - - if (!banid) - return -1; - for (ban = &(chptr->banlist); *ban; ban = &((*ban)->next)) { - if (0 == ircd_strcmp(banid, (*ban)->value.ban.banstr)) - { - tmp = *ban; - if (change) - { - struct Membership* member; - *ban = tmp->next; - MyFree(tmp->value.ban.banstr); - MyFree(tmp->value.ban.who); - free_link(tmp); - /* - * Erase ban-valid-bit, for channel members that are banned - */ - for (member = chptr->members; member; member = member->next_member) - if (CHFL_BANVALIDMASK == (member->status & CHFL_BANVALIDMASK)) - ClearBanValid(member); /* `tmp' == channel member */ - } - return 0; - } - } - return -1; -} - /* * find_channel_member - returns Membership * if a person is joined and not a zombie */ @@ -629,17 +576,6 @@ int is_chan_op(struct Client *cptr, struct Channel *chptr) return 0; } -static int is_deopped(struct Client *cptr, struct Channel *chptr) -{ - struct Membership* member; - - assert(0 != chptr); - if ((member = find_member_link(chptr, cptr))) - return IsDeopped(member); - - return (IsUser(cptr) ? 1 : 0); -} - int is_zombie(struct Client *cptr, struct Channel *chptr) { struct Membership* member; diff --git a/ircd/client.c b/ircd/client.c index dac2e39..4f416fb 100644 --- a/ircd/client.c +++ b/ircd/client.c @@ -34,6 +34,7 @@ #include "struct.h" #include +#include #define BAD_PING ((unsigned int)-2) diff --git a/ircd/ircd_log.c b/ircd/ircd_log.c index 52d459e..96f0fd3 100644 --- a/ircd/ircd_log.c +++ b/ircd/ircd_log.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff --git a/ircd/m_away.c b/ircd/m_away.c index cf4efe0..642ea94 100644 --- a/ircd/m_away.c +++ b/ircd/m_away.c @@ -93,6 +93,7 @@ #include "send.h" #include +#include /* * user_set_away - set user away state diff --git a/ircd/m_map.c b/ircd/m_map.c index bf0da2e..ee3dce2 100644 --- a/ircd/m_map.c +++ b/ircd/m_map.c @@ -98,6 +98,7 @@ #include #include +#include static void dump_map(struct Client *cptr, struct Client *server, char *mask, int prompt_length) { diff --git a/ircd/os_bsd.c b/ircd/os_bsd.c index 2f3bd66..9a052d2 100644 --- a/ircd/os_bsd.c +++ b/ircd/os_bsd.c @@ -59,8 +59,8 @@ */ int os_get_rusage(struct Client *cptr, int uptime, EnumFn enumerator) { - char buf[256]; #ifdef HAVE_GETRUSAGE + char buf[256]; struct rusage rus; time_t secs; @@ -113,6 +113,7 @@ int os_get_rusage(struct Client *cptr, int uptime, EnumFn enumerator) #else /* HAVE_GETRUSAGE */ #if HAVE_TIMES + char buf[256]; struct tms tmsbuf; time_t secs, mins; int hzz = 1, ticpermin; -- 2.20.1