diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/class.h ircd-hybrid-6.0/include/class.h
--- ircd-hybrid-6.0.orig/include/class.h	Wed Jul 21 06:45:00 1999
+++ ircd-hybrid-6.0/include/class.h	Thu Jun 21 11:49:28 2001
@@ -21,6 +21,8 @@
 #ifndef INCLUDED_class_h
 #define INCLUDED_class_h
 
+#include <stddef.h>
+
 struct ConfItem;
 struct Client;
 
@@ -30,7 +32,7 @@
   int           conFreq;
   int           pingFreq;
   int           maxLinks;
-  long          maxSendq;
+  size_t        maxSendq;
   int           links;
 };
 
@@ -53,7 +55,7 @@
 
 extern struct Class* ClassList;  /* GLOBAL - class list */
 
-extern  long    get_sendq(struct Client *);
+extern  size_t  get_sendq(struct Client *);
 extern  int     get_con_freq(struct Class* );
 extern  aClass  *find_class(int);
 extern  int     get_conf_class (struct ConfItem *);
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/client.h ircd-hybrid-6.0/include/client.h
--- ircd-hybrid-6.0.orig/include/client.h	Thu Jun 21 11:51:17 2001
+++ ircd-hybrid-6.0/include/client.h	Thu Jun 21 11:49:28 2001
@@ -112,7 +112,7 @@
 #define BITFIELD_SIZE 64
 
 struct bitfield_lookup_t {
-  int field;
+  unsigned int field;
   u_int32_t bit;
 };
 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/packet.h ircd-hybrid-6.0/include/packet.h
--- ircd-hybrid-6.0.orig/include/packet.h	Sat Sep  4 21:21:08 1999
+++ ircd-hybrid-6.0/include/packet.h	Thu Jun 21 11:49:28 2001
@@ -31,7 +31,7 @@
 
 struct Client;
 
-extern int dopacket(struct Client* client, char* buf, size_t len);
+extern int dopacket(struct Client* client, char* buf, int len);
 extern int client_dopacket(struct Client* client, char* buf, size_t len);
 
 #endif /* INCLUDED_packet_h */
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/res.h ircd-hybrid-6.0/include/res.h
--- ircd-hybrid-6.0.orig/include/res.h	Fri Oct  6 04:00:56 2000
+++ ircd-hybrid-6.0/include/res.h	Thu Jun 21 11:49:28 2001
@@ -45,7 +45,7 @@
  * name is modified only if there is enough space in the buffer to hold
  * the suffix
  */
-extern void add_local_domain(char* name, int len);
+extern void add_local_domain(char* name, size_t len);
 
 #endif /* INCLUDED_res_h */
 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/s_conf.h ircd-hybrid-6.0/include/s_conf.h
--- ircd-hybrid-6.0.orig/include/s_conf.h	Thu Jun 21 11:51:17 2001
+++ ircd-hybrid-6.0/include/s_conf.h	Thu Jun 21 11:49:28 2001
@@ -386,9 +386,9 @@
                                        int statmask);
 extern struct ConfItem* find_conf_ip(struct SLink* lp, char* ip, char* name, 
                                      int);
-extern struct ConfItem* find_conf_by_name(const char* name, int status);
-extern struct ConfItem* find_conf_by_host(const char* host, int status);
-extern struct ConfItem* find_conf_by_abbrevname(const char* name, int status);
+extern struct ConfItem* find_conf_by_name(const char* name, unsigned int status);
+extern struct ConfItem* find_conf_by_host(const char* host, unsigned int status);
+extern struct ConfItem* find_conf_by_abbrevname(const char* name, unsigned int status);
 extern struct ConfItem* find_kill (struct Client *);
 extern int conf_connect_allowed(struct in_addr addr);
 extern char *oper_flags_as_string(umode_t);
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/blalloc.c ircd-hybrid-6.0/src/blalloc.c
--- ircd-hybrid-6.0.orig/src/blalloc.c	Thu Jun 21 11:51:16 2001
+++ ircd-hybrid-6.0/src/blalloc.c	Thu Jun 21 11:49:28 2001
@@ -188,7 +188,7 @@
            mask = 0x1L; ctr = 0; unit = 0;
            while (unit < bh->numlongs)
              {
-               if ((mask == 0x1L) && (walker->allocMap[unit] == ~0))
+               if ((mask == 0x1UL) && (walker->allocMap[unit] == ~0UL))
                  {
                    /* Entire subunit is used, skip to next one. */
                    unit++; 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/channel.c ircd-hybrid-6.0/src/channel.c
--- ircd-hybrid-6.0.orig/src/channel.c	Thu Jun 21 11:51:16 2001
+++ ircd-hybrid-6.0/src/channel.c	Thu Jun 21 11:49:28 2001
@@ -4537,7 +4537,8 @@
 {
   Link  *lp;
   struct Channel *chptr;
-  int   cnt = 0, len = 0, clen;
+  int   cnt = 0;
+  size_t len, clen;
   char   *mask;
 
   *buf = ':';
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/class.c ircd-hybrid-6.0/src/class.c
--- ircd-hybrid-6.0.orig/src/class.c	Tue Feb  1 00:44:11 2000
+++ ircd-hybrid-6.0/src/class.c	Thu Jun 21 11:49:28 2001
@@ -212,9 +212,10 @@
                MaxLinks(cltmp), MaxSendq(cltmp));
 }
 
-long    get_sendq(aClient *cptr)
+size_t    get_sendq(aClient *cptr)
 {
-  int   sendq = MAXSENDQLENGTH, retc = BAD_CLIENT_CLASS;
+  size_t   sendq = MAXSENDQLENGTH;
+  int retc = BAD_CLIENT_CLASS;
   Link  *tmp;
   struct Class        *cl;
 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/dbuf.c ircd-hybrid-6.0/src/dbuf.c
--- ircd-hybrid-6.0.orig/src/dbuf.c	Thu Dec 23 07:10:54 1999
+++ ircd-hybrid-6.0/src/dbuf.c	Thu Jun 21 11:49:28 2001
@@ -171,7 +171,7 @@
 {
   struct DBufBuffer** h;
   struct DBufBuffer*  d;
-  int                 chunk;
+  size_t              chunk;
 
   assert(0 != dyn);
   assert(0 != buf);
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/dline_conf.c ircd-hybrid-6.0/src/dline_conf.c
--- ircd-hybrid-6.0.orig/src/dline_conf.c	Sat Dec 11 04:11:34 1999
+++ ircd-hybrid-6.0/src/dline_conf.c	Thu Jun 21 11:49:28 2001
@@ -214,7 +214,7 @@
  * only K/I lines that are more specific than mask will be toasted.
  * -good
  */
-aConfItem *trim_ip_Klines(aConfItem *cl, int mask)
+aConfItem *trim_ip_Klines(aConfItem *cl, unsigned int mask)
 {
   aConfItem *temp;
   if (!cl) return NULL;
@@ -243,7 +243,7 @@
  * only K/I/E lines that are more specific than mask will be toasted.
  * -good
  */
-aConfItem *trim_ip_Elines(aConfItem *cl, int mask)
+aConfItem *trim_ip_Elines(aConfItem *cl, unsigned int mask)
 {
   aConfItem *temp;
   if (!cl) return NULL;
@@ -480,9 +480,9 @@
 
   host_ip = conf_ptr->ip;
 
-  if( conf_ptr->ip_mask == 0L )
+  if( conf_ptr->ip_mask == 0UL )
     {
-      conf_ptr->ip_mask = 0xFFFFFFFFL;
+      conf_ptr->ip_mask = 0xFFFFFFFFUL;
     }
   
   host_mask = conf_ptr->ip_mask;
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/listener.c ircd-hybrid-6.0/src/listener.c
--- ircd-hybrid-6.0.orig/src/listener.c	Thu Jun 21 11:51:16 2001
+++ ircd-hybrid-6.0/src/listener.c	Thu Jun 21 11:49:28 2001
@@ -334,7 +334,7 @@
 {
   static time_t      last_oper_notice = 0;
   struct sockaddr_in addr;
-  int                addrlen = sizeof(struct sockaddr_in);
+  size_t             addrlen = sizeof(struct sockaddr_in);
   int                fd;
 
   assert(0 != listener);
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_links.c ircd-hybrid-6.0/src/m_links.c
--- ircd-hybrid-6.0.orig/src/m_links.c	Thu Jun 21 11:51:16 2001
+++ ircd-hybrid-6.0/src/m_links.c	Thu Jun 21 11:49:28 2001
@@ -105,7 +105,6 @@
   struct Client* acptr;
   char           clean_mask[2 * HOSTLEN + 4];
   char*          p;
-  char*          s;
   int            bogus_server = 0;
   static time_t  last_used = 0L;
 
@@ -145,15 +144,17 @@
    * -Dianora
    */
 
-  s = (char *) mask;
-  while (*s)
-    {
-      if (!IsServChar(*s)) {
-        bogus_server = 1;
-        break;
+  {
+    const char* s = mask;
+    while (*s)
+      {
+	if (!IsServChar(*s)) {
+	  bogus_server = 1;
+	  break;
+	}
+	s++;
       }
-      s++;
-    }
+  }
 
   if (bogus_server)
     {
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_message.c ircd-hybrid-6.0/src/m_message.c
--- ircd-hybrid-6.0.orig/src/m_message.c	Thu Jun 21 11:51:15 2001
+++ ircd-hybrid-6.0/src/m_message.c	Thu Jun 21 11:49:28 2001
@@ -371,7 +371,7 @@
                    * DOS the client.
                    * -Dianora
                    */
-                  if(DBufLength(&acptr->sendQ) > (get_sendq(acptr)/2L))
+                  if(DBufLength(&acptr->sendQ) > (get_sendq(acptr)/2UL))
                     {
                       if(acptr->drone_noticed == 1) /* tiny FSM */
                         {
@@ -386,7 +386,7 @@
                         }
                     }
 
-                  if(DBufLength(&acptr->sendQ) <= (get_sendq(acptr)/4L))
+                  if(DBufLength(&acptr->sendQ) <= (get_sendq(acptr)/4UL))
                     {
                       if(acptr->drone_noticed == 2)
                         {
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_whois.c ircd-hybrid-6.0/src/m_whois.c
--- ircd-hybrid-6.0.orig/src/m_whois.c	Thu Jun 21 11:51:16 2001
+++ ircd-hybrid-6.0/src/m_whois.c	Thu Jun 21 11:49:28 2001
@@ -117,6 +117,7 @@
     0,          /* last */
     1,          /* refcount */
     0,          /* joined */
+    "<Unused>", /* id (marked as "for future use") */
     "<Unknown>"         /* server */
   };
   Link  *lp;
@@ -299,7 +300,7 @@
 
           if (IsAnOper(acptr)
 #ifdef OPERHIDE
-               && SeesOpers(sptr)
+	      && (SeesOpers(sptr) || acptr == sptr)
 #endif
               )
 	    {
@@ -311,10 +312,15 @@
 	      else
 		sendto_one(sptr, form_str(RPL_WHOISOPER_NOTGOD),
 			   me.name, parv[0], name);
-	      if (SeesOperPrivs(sptr) || acptr == sptr)
-		sendto_one(sptr, form_str(RPL_WHOISOPER_PRIVS),
-			   me.name, parv[0], name, oper_flags_as_string(acptr->allowed_umodes));
 	    }
+	  {
+	    umode_t umodes;
+	    AndNotUmodes(umodes, acptr->allowed_umodes, user_umodes);
+	    ClearBit(umodes, UMODE_OPER);
+	    if (AnyBits(umodes) && (SeesOperPrivs(sptr) || acptr == sptr))
+	      sendto_one(sptr, form_str(RPL_WHOISOPER_PRIVS),
+			 me.name, parv[0], name, oper_flags_as_string(acptr->umodes));
+	  }
 
           if (IsIdentifiedNick(acptr))
             sendto_one(sptr, form_str(RPL_WHOISIDENTIFIED),
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/packet.c ircd-hybrid-6.0/src/packet.c
--- ircd-hybrid-6.0.orig/src/packet.c	Fri Sep 10 05:54:19 1999
+++ ircd-hybrid-6.0/src/packet.c	Thu Jun 21 11:49:28 2001
@@ -50,7 +50,7 @@
 **      with cptr of "local" variation, which contains all the
 **      necessary fields (buffer etc..)
 */
-int dopacket(aClient *cptr, char *buffer, size_t length)
+int dopacket(aClient *cptr, char *buffer, int length)
 {
   char  *ch1;
   char  *ch2;
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/parse.c ircd-hybrid-6.0/src/parse.c
--- ircd-hybrid-6.0.orig/src/parse.c	Thu Jun 21 11:51:16 2001
+++ ircd-hybrid-6.0/src/parse.c	Thu Jun 21 11:49:28 2001
@@ -74,9 +74,9 @@
   aClient *from = cptr;
   char  *ch;
   char  *s;
-  int   i;
+  size_t i;
   char* numeric = 0;
-  int   paramcount;
+  unsigned int paramcount;
   struct Message *mptr;
 
   Debug((DEBUG_DEBUG, "Parsing %s: %s",
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/res.c ircd-hybrid-6.0/src/res.c
--- ircd-hybrid-6.0.orig/src/res.c	Thu Jun 21 11:51:15 2001
+++ ircd-hybrid-6.0/src/res.c	Thu Jun 21 11:49:28 2001
@@ -368,7 +368,7 @@
  * add_local_domain - Add the domain to hostname, if it is missing
  * (as suggested by eps@TOASTER.SFSU.EDU)
  */
-void add_local_domain(char* hname, int size)
+void add_local_domain(char* hname, size_t size)
 {
   assert(0 != hname);
   /* 
@@ -598,8 +598,10 @@
       ++sent;
     }
     else
-      Debug((DEBUG_ERROR,"s_r_m:sendto: %d on %d", 
-             errno, ResolverFileDescriptor));
+      {
+	Debug((DEBUG_ERROR,"s_r_m:sendto: %d on %d", 
+	       errno, ResolverFileDescriptor));
+      }
   }
   return sent;
 }
@@ -997,9 +999,9 @@
   HEADER*            header;
   ResRQ*             request = NULL;
   aCache*            cp = NULL;
-  int                rc;
+  size_t             rc;
   int                answer_count;
-  int                len = sizeof(struct sockaddr_in);
+  size_t             len = sizeof(struct sockaddr_in);
   struct sockaddr_in sin;
 
   rc = recvfrom(ResolverFileDescriptor, buf, sizeof(buf), 0, 
@@ -1513,7 +1515,7 @@
 #endif
 
   assert(0 != addr);
-  hashv = hash_number((unsigned char*) addr);
+  hashv = hash_number((unsigned const char*) addr);
   cp = hashtable[hashv].num_list;
 #ifdef DEBUG
   Debug((DEBUG_DNS,"find_cache_number:find %s[%08x]: hashv = %d",
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/s_auth.c ircd-hybrid-6.0/src/s_auth.c
--- ircd-hybrid-6.0.orig/src/s_auth.c	Thu Jun 21 11:51:16 2001
+++ ircd-hybrid-6.0/src/s_auth.c	Thu Jun 21 11:49:28 2001
@@ -246,7 +246,7 @@
 {
   struct sockaddr_in sock;
   struct sockaddr_in localaddr;
-  int                locallen = sizeof(struct sockaddr_in);
+  size_t             locallen = sizeof(struct sockaddr_in);
   int                fd;
 
   if ((fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
@@ -466,8 +466,8 @@
   struct sockaddr_in us;
   struct sockaddr_in them;
   char            authbuf[32];
-  int             ulen = sizeof(struct sockaddr_in);
-  int             tlen = sizeof(struct sockaddr_in);
+  size_t          ulen = sizeof(struct sockaddr_in);
+  size_t          tlen = sizeof(struct sockaddr_in);
 
   if (getsockname(auth->client->fd, (struct sockaddr *)&us,   &ulen) ||
       getpeername(auth->client->fd, (struct sockaddr *)&them, &tlen)) {
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/s_bsd.c ircd-hybrid-6.0/src/s_bsd.c
--- ircd-hybrid-6.0.orig/src/s_bsd.c	Thu Jun 21 11:51:16 2001
+++ ircd-hybrid-6.0/src/s_bsd.c	Thu Jun 21 11:49:28 2001
@@ -137,7 +137,7 @@
   int errtmp = errno;
 #ifdef SO_ERROR
   int err = 0;
-  int len = sizeof(err);
+  size_t len = sizeof(err);
 
   if (-1 < fd && !getsockopt(fd, SOL_SOCKET, SO_ERROR, (char*) &err, &len)) {
     if (err)
@@ -739,7 +739,7 @@
 {
   struct Client*           new_client;
   struct sockaddr_in addr;
-  int                len = sizeof(struct sockaddr_in);
+  size_t             len = sizeof(struct sockaddr_in);
 
   assert(0 != listener);
 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/s_conf.c ircd-hybrid-6.0/src/s_conf.c
--- ircd-hybrid-6.0.orig/src/s_conf.c	Thu Jun 21 11:51:17 2001
+++ ircd-hybrid-6.0/src/s_conf.c	Thu Jun 21 11:49:28 2001
@@ -252,7 +252,7 @@
  * rewrote to use a struct -Dianora
  */
 static struct LinkReport {
-  int conf_type;
+  unsigned int conf_type;
   int rpl_stats;
   int conf_char;
 } report_array[] = {
@@ -1273,7 +1273,7 @@
 /*
  * find_conf_by_name - return a conf item that matches name and type
  */
-struct ConfItem* find_conf_by_name(const char* name, int status)
+struct ConfItem* find_conf_by_name(const char* name, unsigned int status)
 {
   struct ConfItem* conf;
   assert(0 != name);
@@ -1293,7 +1293,7 @@
 /*
  * find_conf_by_name - return a conf item that matches host and type
  */
-struct ConfItem* find_conf_by_host(const char* host, int status)
+struct ConfItem* find_conf_by_host(const char* host, unsigned int status)
 {
   struct ConfItem* conf;
   assert(0 != host);
@@ -1315,7 +1315,7 @@
  *
  * - looks for a match on all given fields.
  */
-struct ConfItem *find_conf_entry(struct ConfItem *aconf, int mask)
+struct ConfItem *find_conf_entry(struct ConfItem *aconf, unsigned int mask)
 {
   struct ConfItem *bconf;
 
@@ -3664,7 +3664,7 @@
 /*
  * find_conf_by_name - return a conf item that vaguely matches name and type
  */
-struct ConfItem* find_conf_by_abbrevname(const char* name, int status)
+struct ConfItem* find_conf_by_abbrevname(const char* name, unsigned int status)
 {
   struct ConfItem* conf;
   assert(0 != name);
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/s_user.c ircd-hybrid-6.0/src/s_user.c
--- ircd-hybrid-6.0.orig/src/s_user.c	Thu Jun 21 11:51:17 2001
+++ ircd-hybrid-6.0/src/s_user.c	Thu Jun 21 11:49:28 2001
@@ -2480,7 +2480,7 @@
 
 void init_umodes()
 {
-  int i, field, bit;
+  unsigned int i, field, bit;
   /* Fill out the reverse umode map */
   for (i = 0; user_modes[i].letter; i++)
     user_modes_from_c_to_bitmask[(unsigned char)user_modes[i].letter] = user_modes[i].mode;
