Fix code to compile using K&R C compiler and ansi2kr again.

This commit is contained in:
Alexander Barton 2007-11-18 15:05:35 +00:00
parent 2f305331a1
commit 06bfb3adfb
6 changed files with 34 additions and 18 deletions

View File

@ -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 $

View File

@ -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 <assert.h>
@ -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

View File

@ -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 <assert.h>
@ -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 );

View File

@ -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 <assert.h>
#include <stdlib.h>
@ -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

View File

@ -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 <assert.h>
@ -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 ));
}

View File

@ -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 <assert.h>
@ -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;
}