From: Alexander Barton Date: Sun, 18 Nov 2007 15:05:35 +0000 (+0000) Subject: Fix code to compile using K&R C compiler and ansi2kr again. X-Git-Tag: rel-0-11-0-pre2~23 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git;a=commitdiff_plain;h=06bfb3adfb7ed6aef01c2fa892ea396405ee040a Fix code to compile using K&R C compiler and ansi2kr again. --- diff --git a/ChangeLog b/ChangeLog index 9598c041..c7eb65c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ ngIRCd HEAD + - Fix code to compile using K&R C compiler and ansi2kr again. - New config option NoDNS: Disables DNS lookups when clients connect. - Fixed propagation of channel mode 'P' on server links. - Numeric 317: implemented "signon time" (displayed in WHOIS result). @@ -709,4 +710,4 @@ ngIRCd 0.0.1, 31.12.2001 -- -$Id: ChangeLog,v 1.325 2007/10/25 11:03:02 fw Exp $ +$Id: ChangeLog,v 1.326 2007/11/18 15:05:35 alex Exp $ diff --git a/src/ngircd/array.c b/src/ngircd/array.c index d26d5e39..ff7f02ce 100644 --- a/src/ngircd/array.c +++ b/src/ngircd/array.c @@ -12,7 +12,7 @@ #include "array.h" -static char UNUSED id[] = "$Id: array.c,v 1.14 2006/12/28 12:53:41 alex Exp $"; +static char UNUSED id[] = "$Id: array.c,v 1.15 2007/11/18 15:05:35 alex Exp $"; #include @@ -28,9 +28,9 @@ static char UNUSED id[] = "$Id: array.c,v 1.14 2006/12/28 12:53:41 alex Exp $"; #define array_UNUSABLE(x) ( !(x)->mem || (0 == (x)->allocated) ) -#define ALIGN_32U(x) (((x)+31U ) & ~(31U)) -#define ALIGN_1024U(x) (((x)+1023U) & ~(1023U)) -#define ALIGN_4096U(x) (((x)+4095U) & ~(4095U)) +#define ALIGN_32U(x) (((x)+(unsigned)31 ) & ~((unsigned)31)) +#define ALIGN_1024U(x) (((x)+(unsigned)1023) & ~((unsigned)1023)) +#define ALIGN_4096U(x) (((x)+(unsigned)4095) & ~((unsigned)4095)) static bool diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index 8cd98ab0..95ed3088 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -17,7 +17,7 @@ #include "portab.h" #include "io.h" -static char UNUSED id[] = "$Id: conn.c,v 1.213 2007/10/25 11:01:19 fw Exp $"; +static char UNUSED id[] = "$Id: conn.c,v 1.214 2007/11/18 15:05:35 alex Exp $"; #include "imp.h" #include @@ -349,7 +349,7 @@ NewListener( const UINT16 Port ) /* Server-"Listen"-Socket initialisieren */ memset( &addr, 0, sizeof( addr )); memset( &inaddr, 0, sizeof( inaddr )); - addr.sin_family = (sa_family_t)AF_INET; + addr.sin_family = AF_INET; addr.sin_port = htons( Port ); if( Conf_ListenAddress[0] ) { @@ -1383,7 +1383,7 @@ New_Server( int Server ) } memset( &new_addr, 0, sizeof( new_addr )); - new_addr.sin_family = (sa_family_t)AF_INET; + new_addr.sin_family = AF_INET; new_addr.sin_addr = inaddr; new_addr.sin_port = htons( Conf_Server[Server].port ); diff --git a/src/ngircd/io.c b/src/ngircd/io.c index cb996e40..d759a595 100644 --- a/src/ngircd/io.c +++ b/src/ngircd/io.c @@ -12,7 +12,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: io.c,v 1.25 2007/01/19 13:52:54 fw Exp $"; +static char UNUSED id[] = "$Id: io.c,v 1.26 2007/11/18 15:05:35 alex Exp $"; #include #include @@ -30,7 +30,11 @@ static char UNUSED id[] = "$Id: io.c,v 1.25 2007/01/19 13:52:54 fw Exp $"; /* #define DEBUG_IO */ typedef struct { +#ifdef PROTOTYPES void (*callback)(int, short); +#else + void (*callback)(); +#endif short what; } io_event; @@ -88,7 +92,7 @@ static bool io_event_change_kqueue(int, short, const int action); static array pollfds; static int poll_maxfd; -static bool io_event_change_poll(int fd, short what); +static bool io_event_change_poll PARAMS((int fd, short what)); #endif #ifdef IO_USE_DEVPOLL @@ -524,7 +528,11 @@ io_close_devpoll(int fd) write(io_masterfd, &p, sizeof p); } #else -static inline void io_close_devpoll(int UNUSED x) { /* NOTHING */ } +static inline void +io_close_devpoll(int UNUSED x) +{ + /* NOTHING */ +} #endif @@ -576,7 +584,11 @@ io_close_select(int fd) } } #else -static inline void io_close_select(int UNUSED x) { /* NOTHING */ } +static inline void +io_close_select(int UNUSED x) +{ + /* NOTHING */ +} #endif diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index a63e3aa7..4ed05b33 100644 --- a/src/ngircd/irc-info.c +++ b/src/ngircd/irc-info.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-info.c,v 1.38 2007/10/04 15:03:56 alex Exp $"; +static char UNUSED id[] = "$Id: irc-info.c,v 1.39 2007/11/18 15:05:35 alex Exp $"; #include "imp.h" #include @@ -885,18 +885,21 @@ IRC_Send_LUSERS( CLIENT *Client ) } /* IRC_Send_LUSERS */ -static bool Show_MOTD_Start(CLIENT *Client) +static bool +Show_MOTD_Start(CLIENT *Client) { return IRC_WriteStrClient(Client, RPL_MOTDSTART_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( ))); } -static bool Show_MOTD_Sendline(CLIENT *Client, const char *msg) +static bool +Show_MOTD_Sendline(CLIENT *Client, const char *msg) { return IRC_WriteStrClient(Client, RPL_MOTD_MSG, Client_ID( Client ), msg); } -static bool Show_MOTD_End(CLIENT *Client) +static bool +Show_MOTD_End(CLIENT *Client) { return IRC_WriteStrClient( Client, RPL_ENDOFMOTD_MSG, Client_ID( Client )); } diff --git a/src/ngircd/irc-server.c b/src/ngircd/irc-server.c index da9ba978..41e89085 100644 --- a/src/ngircd/irc-server.c +++ b/src/ngircd/irc-server.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-server.c,v 1.43 2006/12/07 17:57:20 fw Exp $"; +static char UNUSED id[] = "$Id: irc-server.c,v 1.44 2007/11/18 15:05:35 alex Exp $"; #include "imp.h" #include @@ -261,7 +261,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) if( ! IRC_WriteStrClient( Client, "CHANINFO %s +%s %s %lu :%s", Channel_Name( chan ), modes, strchr( Channel_Modes( chan ), 'k' ) ? Channel_Key( chan ) : "*", - strchr( Channel_Modes( chan ), 'l' ) ? Channel_MaxUsers( chan ) : 0UL, topic )) + strchr( Channel_Modes( chan ), 'l' ) ? Channel_MaxUsers( chan ) : 0, topic )) { return DISCONNECTED; }