Cleaned up some compile time warnings (on casting)
authorRemco Rijnders <remco@webconquest.com>
Wed, 22 Aug 2012 16:56:40 +0000 (18:56 +0200)
committerRemco Rijnders <remco@webconquest.com>
Wed, 22 Aug 2012 16:56:40 +0000 (18:56 +0200)
include/struct.h
src/channel.c
src/list.c
src/s_user.c

index 444555eb5720deefc38b4b0aadebbda9b163d01c..563519f8740eb4ed01037377f9d071f487c69137 100644 (file)
@@ -119,16 +119,7 @@ typedef unsigned int  u_int32_t; /* XXX Hope this works! */
 #include "whowas.h"
 
 
-/*
-** 'offsetof' is defined in ANSI-C. The following definition
-** is not absolutely portable (I have been told), but so far
-** it has worked on all machines I have needed it. The type
-** should be size_t but...  --msa
-*/
-#ifndef offsetof
-#define        offsetof(t,m) (int)((&((t *)0L)->m))
-#endif
-
+#include <stddef.h> /* For offsetof macro */
 #define        elementsof(x) (sizeof(x)/sizeof(x[0]))
 
 /*
index 525b4811a2459644163de8c52aaa58159d672f5f..e6bba4e65fd5daef19c17f7684181301a128da0f 100644 (file)
@@ -575,8 +575,6 @@ int can_send (cptr, chptr, msgtext)
     Link *lp;
     int member;
 
-    /* Moved check here, kinda faster.
-     * Note IsULine only uses the other parameter. -Donwulff */
     if (IsULine (cptr, cptr) || IsServer (cptr) || IsSRoot (cptr))
        return 0;
 
@@ -592,8 +590,8 @@ int can_send (cptr, chptr, msgtext)
        return (CANNOT_SEND_NOPRIVMSGS);
 
     if (chptr->mode.mode & MODE_NOCOLORS)
-       if (strchr (msgtext, 3) != (char) NULL ||
-           strchr (msgtext, 27) != (char) NULL)
+       if (strchr (msgtext, 3) != (char *) NULL ||
+           strchr (msgtext, 27) != (char *) NULL)
            return (CANNOT_SEND_NOCOLORS);
 
     if ((!lp || !(lp->flags & (CHFL_CHANOP | CHFL_VOICE)) ||
@@ -3345,8 +3343,8 @@ int m_part (cptr, sptr, parc, parv)
        /* If the channel is mode +c, we'll need to block colored part
           reasons */
        if ((chptr->mode.mode & MODE_NOCOLORS) && comment)
-           if (strchr (comment, 3) != (char) NULL ||
-               strchr (comment, 27) != (char) NULL)
+           if (strchr (comment, 3) != (char *) NULL ||
+               strchr (comment, 27) != (char *) NULL)
                 ColorStrip = 1;
 
        /* Do not use IsMember here: zombies must be able to part too */
index 3dde68d3a0c11bd5fd88421832bcae7e33815018..e29c5ab3ab5e27455bed85b88a3cc28e13d06b2d 100644 (file)
@@ -79,7 +79,7 @@ aClient *make_client (from, servr)
      aClient *from, *servr;
 {
     aClient *cptr = NULL;
-    unsigned size = CLIENT_REMOTE_SIZE;
+    size_t size = CLIENT_REMOTE_SIZE;
 
     /*
      * Check freelists first to see if we can grab a client without
index 7780c7054fe5cda6d7138b1c724ef363ac581004..4c66e05cd3c81a0c21b2e334a0d119190a799f72 100644 (file)
@@ -224,11 +224,7 @@ int hunt_server (cptr, sptr, command, server, parc, parv)
 int check_for_target_limit (aClient * sptr, void *target, const char *name)
 {
     u_char *p;
-#ifdef __alpha
-    u_long tmp = ((u_long) target & 0xffff00) >> 8;
-#else
     u_int tmp = ((u_int) target & 0xffff00) >> 8;
-#endif
     u_char hash = (tmp * tmp) >> 12;
 
     if (IsAnOper (sptr))