From: Remco Rijnders Date: Wed, 22 Aug 2012 16:56:40 +0000 (+0200) Subject: Cleaned up some compile time warnings (on casting) X-Git-Url: http://git.serene-ircd.net/?a=commitdiff_plain;h=ed880e5022a8f7d5dd10ee2c706e54ee5ecacbae;p=serene-ircd.git Cleaned up some compile time warnings (on casting) --- diff --git a/include/struct.h b/include/struct.h index 444555e..563519f 100644 --- a/include/struct.h +++ b/include/struct.h @@ -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 /* For offsetof macro */ #define elementsof(x) (sizeof(x)/sizeof(x[0])) /* diff --git a/src/channel.c b/src/channel.c index 525b481..e6bba4e 100644 --- a/src/channel.c +++ b/src/channel.c @@ -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 */ diff --git a/src/list.c b/src/list.c index 3dde68d..e29c5ab 100644 --- a/src/list.c +++ b/src/list.c @@ -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 diff --git a/src/s_user.c b/src/s_user.c index 7780c70..4c66e05 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -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))