Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Mon, 9 Jul 2001 16:33:37 +0000 (16:33 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Mon, 9 Jul 2001 16:33:37 +0000 (16:33 +0000)
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
ircd/IPcheck.c
ircd/channel.c
ircd/client.c
ircd/ircd_log.c
ircd/m_away.c
ircd/m_map.c
ircd/os_bsd.c

index bb75115db78c4ab41e864c282903b2e4d7c74d11..ecce833ea533a29289ad0cdf1e1b5ef47afc9813 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2001-07-09  Kevin L. Mitchell  <klmitch@mit.edu>
+
+       * 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  <klmitch@mit.edu>
 
        * ircd/s_user.c (set_user_mode): clear the snomask if the user
index e1f052d79c7cd6b4330e5e8a931da8f0fcf917fd..cabeaef9716e3503a664f57f246bd9f74562517e 100644 (file)
@@ -36,7 +36,7 @@
 #include "send.h"
 
 #include <assert.h>
-
+#include <string.h>
 
 struct IPTargetEntry {
   int           count;
index ea46920a1910d3bb3e41f4c616e39970fb846537..c209148050d301a1dd5d3373bb18ff3360edb95a 100644 (file)
@@ -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;
index dac2e39ba211b28b8ca271399190f16766c402f9..4f416fb184f975db9aab1c689f242ae25ddaa8ab 100644 (file)
@@ -34,6 +34,7 @@
 #include "struct.h"
 
 #include <assert.h>
+#include <string.h>
 
 #define BAD_PING                ((unsigned int)-2)
 
index 52d459e96a4621e946cdcff5a29d67a3a904029e..96f0fd3ea5356c0d1a15ef40730cf9304942bbd2 100644 (file)
@@ -41,6 +41,7 @@
 #include <fcntl.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/uio.h>
index cf4efe0babb42dce7ed65746eab5daa90e425255..642ea94eca844c0e778cf83295fe46404fe99878 100644 (file)
@@ -93,6 +93,7 @@
 #include "send.h"
 
 #include <assert.h>
+#include <string.h>
 
 /*
  * user_set_away - set user away state
index bf0da2e02e4df448fd91166f45ab4d92a06edf7d..ee3dce2457f5066115eae3d01ca6573d4fe3a587 100644 (file)
@@ -98,6 +98,7 @@
 
 #include <assert.h>
 #include <stdio.h>
+#include <string.h>
 
 static void dump_map(struct Client *cptr, struct Client *server, char *mask, int prompt_length)
 {
index 2f3bd666a19aa64872572fe6e0f257d459cd3099..9a052d2f5ea6092b22fabb75afa0d33c68dc643a 100644 (file)
@@ -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;