From: Harlan Stenn Date: Wed, 3 Jan 2007 21:41:43 +0000 (-0500) Subject: [Bug 756] Require ANSI C (function prototypes) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74c19be0fcf9f06cc52c07304795f21dffc90e9f;p=thirdparty%2Fntp.git [Bug 756] Require ANSI C (function prototypes) bk: 459c2317tEHTDQyDbWXZTBGgIi0nHA --- diff --git a/Makefile.am b/Makefile.am index a8afc7a6f2..1969959d67 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ #AUTOMAKE_OPTIONS = util/ansi2knr foreign dist-tarZ no-dependencies -AUTOMAKE_OPTIONS = util/ansi2knr foreign 1.8 +AUTOMAKE_OPTIONS = foreign 1.8 ACLOCAL_AMFLAGS= -I m4 -I libopts/m4 NULL= diff --git a/NEWS b/NEWS index db1744b23f..7b3d392123 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +* [Bug 756] Require ANSI C (function prototypes). * codec (audio) and ICOM changes from Dave Mills. (4.2.4) Released by Harlan Stenn diff --git a/adjtimed/Makefile.am b/adjtimed/Makefile.am index 9605d1f446..b2bf581e50 100644 --- a/adjtimed/Makefile.am +++ b/adjtimed/Makefile.am @@ -1,4 +1,4 @@ -AUTOMAKE_OPTIONS= ../util/ansi2knr +AUTOMAKE_OPTIONS= bindir= ${exec_prefix}/${BINSUBDIR} bin_PROGRAMS= @MAKE_ADJTIMED@ diff --git a/arlib/Makefile.am b/arlib/Makefile.am index c0b40942a2..47286de962 100644 --- a/arlib/Makefile.am +++ b/arlib/Makefile.am @@ -1,4 +1,4 @@ -AUTOMAKE_OPTIONS = foreign # ansi2knr +AUTOMAKE_OPTIONS = foreign #lib_LIBRARIES = libares.a noinst_LIBRARIES = libares.a diff --git a/clockstuff/Makefile.am b/clockstuff/Makefile.am index e8eb85a96c..dd7c91715e 100644 --- a/clockstuff/Makefile.am +++ b/clockstuff/Makefile.am @@ -1,5 +1,5 @@ #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies -AUTOMAKE_OPTIONS = ../util/ansi2knr +AUTOMAKE_OPTIONS = noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@ @CLKTEST@ EXTRA_PROGRAMS = propdelay chutest clktest diff --git a/configure.ac b/configure.ac index afe4744436..aee796581c 100644 --- a/configure.ac +++ b/configure.ac @@ -26,9 +26,11 @@ AC_MINIX dnl we need to check for cross compile tools for vxWorks here AC_PROG_CC +dnl AC_PROG_CC_C89 +dnl AC_PROG_CC_STDC +# We should make sure CC is *some* version of ANSI. # Ralf Wildenhues: With per-target flags we need CC_C_O AC_PROG_CC_C_O -AC_PROG_CC_STDC AC_PROG_CPP # HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS @@ -60,7 +62,7 @@ case "$host" in LIBS="$LIBS -lcurses" ;; *-*-solaris*) - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" + CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" libxnet=-lxnet ;; esac diff --git a/include/Makefile.am b/include/Makefile.am index d80ec5ced1..c41c7dee60 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,5 @@ #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies -AUTOMAKE_OPTIONS = ../util/ansi2knr +AUTOMAKE_OPTIONS = ETAGS_ARGS = $(srcdir)/Makefile.am EXTRA_DIST = copyright.def debug-opt.def autogen-version.def version.def diff --git a/include/audio.h b/include/audio.h index 6d16347ec8..1b969bd49e 100644 --- a/include/audio.h +++ b/include/audio.h @@ -9,6 +9,6 @@ /* * Function prototypes */ -int audio_init P((char *, int, int)); -int audio_gain P((int, int, int)); -void audio_show P((void)); +int audio_init (char *, int, int); +int audio_gain (int, int, int); +void audio_show (void); diff --git a/include/binio.h b/include/binio.h index 56e671fdb2..d1ee944291 100644 --- a/include/binio.h +++ b/include/binio.h @@ -37,15 +37,15 @@ #include "ntp_stdlib.h" -long get_lsb_short P((unsigned char **)); -void put_lsb_short P((unsigned char **, long)); -long get_lsb_long P((unsigned char **)); -void put_lsb_long P((unsigned char **, long)); +long get_lsb_short (unsigned char **); +void put_lsb_short (unsigned char **, long); +long get_lsb_long (unsigned char **); +void put_lsb_long (unsigned char **, long); -long get_msb_short P((unsigned char **)); -void put_msb_short P((unsigned char **, long)); -long get_msb_long P((unsigned char **)); -void put_msb_long P((unsigned char **, long)); +long get_msb_short (unsigned char **); +void put_msb_short (unsigned char **, long); +long get_msb_long (unsigned char **); +void put_msb_long (unsigned char **, long); #endif /* diff --git a/include/global.h b/include/global.h index 742f84cd94..2848b8bf4c 100644 --- a/include/global.h +++ b/include/global.h @@ -12,15 +12,6 @@ #ifndef _GLOBAL_H_ #define _GLOBAL_H_ 1 -/* PROTOTYPES should be set to one if and only if the compiler supports - function argument prototyping. - The following makes PROTOTYPES default to 1 if it has not already been - defined as 0 with C compiler flags. - */ -#ifdef HAVE_PROTOTYPES -#define PROTOTYPES 1 -#endif - /* POINTER defines a generic pointer type */ typedef unsigned char *POINTER; @@ -41,14 +32,4 @@ typedef unsigned char BYTE; /* local modification for RSAEuro */ #define UNUSED_ARG(x) x = *(&x); #endif -/* PROTO_LIST is defined depending on how PROTOTYPES is defined above. - If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it - returns an empty list. - */ -#if PROTOTYPES -#define PROTO_LIST(list) list -#else -#define PROTO_LIST(list) () -#endif - #endif /* end _GLOBAL_H_ */ diff --git a/include/icom.h b/include/icom.h index aac62c8d3d..66d12e51f1 100644 --- a/include/icom.h +++ b/include/icom.h @@ -83,5 +83,5 @@ /* * Function prototypes */ -int icom_init P((char *, int, int)); -int icom_freq P((int, int, double)); +int icom_init (char *, int, int); +int icom_freq (int, int, double); diff --git a/include/ieee754io.h b/include/ieee754io.h index 6906731cbf..73e7f79830 100644 --- a/include/ieee754io.h +++ b/include/ieee754io.h @@ -52,8 +52,8 @@ #define IEEE_OFFSETS 8 /* number of byte positions */ typedef unsigned char offsets_t[IEEE_OFFSETS]; -int fetch_ieee754 P((unsigned char **bufp, int size, l_fp *lfpp, offsets_t offsets)); -int put_ieee754 P((unsigned char **bufpp, int size, l_fp *lfpp, offsets_t offsets)); +int fetch_ieee754 (unsigned char **bufp, int size, l_fp *lfpp, offsets_t offsets); +int put_ieee754 (unsigned char **bufpp, int size, l_fp *lfpp, offsets_t offsets); #endif /* diff --git a/include/iosignal.h b/include/iosignal.h index bd74e096d0..6540fa82aa 100644 --- a/include/iosignal.h +++ b/include/iosignal.h @@ -4,12 +4,12 @@ #include "ntp_refclock.h" #if defined(HAVE_SIGNALED_IO) -extern void block_sigio P((void)); -extern void unblock_sigio P((void)); -extern int init_clock_sig P((struct refclockio *)); -extern void init_socket_sig P((int)); -extern void set_signal P((void)); -RETSIGTYPE sigio_handler P((int)); +extern void block_sigio (void); +extern void unblock_sigio (void); +extern int init_clock_sig (struct refclockio *); +extern void init_socket_sig (int); +extern void set_signal (void); +RETSIGTYPE sigio_handler (int); # define BLOCKIO() ((void) block_sigio()) # define UNBLOCKIO() ((void) unblock_sigio()) diff --git a/include/isc/Makefile.am b/include/isc/Makefile.am index 3d8c2a47f9..2bb5b46712 100644 --- a/include/isc/Makefile.am +++ b/include/isc/Makefile.am @@ -1,5 +1,5 @@ #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies -AUTOMAKE_OPTIONS = ../util/ansi2knr +AUTOMAKE_OPTIONS = ETAGS_ARGS = $(srcdir)/Makefile.am #EXTRA_DIST = TAGS diff --git a/include/l_stdlib.h b/include/l_stdlib.h index 58bbeedc21..e82040d699 100644 --- a/include/l_stdlib.h +++ b/include/l_stdlib.h @@ -14,11 +14,7 @@ # include #endif -#if defined(__STDC__) || defined(HAVE_STDARG_H) -# include -#else -# include -#endif +#include #ifdef HAVE_SYS_TYPES_H # include @@ -40,195 +36,195 @@ #ifdef DECL_ADJTIME_0 struct timeval; -extern int adjtime P((struct timeval *, struct timeval *)); +extern int adjtime (struct timeval *, struct timeval *); #endif #ifdef DECL_BCOPY_0 #ifndef bcopy -extern void bcopy P((const char *, char *, int)); +extern void bcopy (const char *, char *, int); #endif #endif #ifdef DECL_BZERO_0 #ifndef bzero -extern void bzero P((char *, int)); +extern void bzero (char *, int); #endif #endif #ifdef DECL_CFSETISPEED_0 struct termios; -extern int cfsetispeed P((struct termios *, speed_t)); -extern int cfsetospeed P((struct termios *, speed_t)); +extern int cfsetispeed (struct termios *, speed_t); +extern int cfsetospeed (struct termios *, speed_t); #endif -extern char * getpass P((const char *)); +extern char * getpass (const char *); #ifdef DECL_HSTRERROR_0 -extern const char * hstrerror P((int)); +extern const char * hstrerror (int); #endif #ifdef DECL_INET_NTOA_0 struct in_addr; -extern char * inet_ntoa P((struct in_addr)); +extern char * inet_ntoa (struct in_addr); #endif #ifdef DECL_IOCTL_0 -extern int ioctl P((int, u_long, char *)); +extern int ioctl (int, u_long, char *); #endif #ifdef DECL_IPC_0 struct sockaddr; -extern int bind P((int, struct sockaddr *, int)); -extern int connect P((int, struct sockaddr *, int)); -extern int recv P((int, char *, int, int)); -extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *)); -extern int send P((int, char *, int, int)); -extern int sendto P((int, char *, int, int, struct sockaddr *, int)); -extern int setsockopt P((int, int, int, char *, int)); -extern int socket P((int, int, int)); +extern int bind (int, struct sockaddr *, int); +extern int connect (int, struct sockaddr *, int); +extern int recv (int, char *, int, int); +extern int recvfrom (int, char *, int, int, struct sockaddr *, int *); +extern int send (int, char *, int, int); +extern int sendto (int, char *, int, int, struct sockaddr *, int); +extern int setsockopt (int, int, int, char *, int); +extern int socket (int, int, int); #endif #ifdef DECL_MEMMOVE_0 -extern void * memmove P((void *, const void *, size_t)); +extern void * memmove (void *, const void *, size_t); #endif #ifdef DECL_MEMSET_0 -extern char * memset P((char *, int, int)); +extern char * memset (char *, int, int); #endif #ifdef DECL_MKSTEMP_0 -extern int mkstemp P((char *)); +extern int mkstemp (char *); #endif #ifdef DECL_MKTEMP_0 -extern char *mktemp P((char *)); +extern char *mktemp (char *); #endif #ifdef DECL_NLIST_0 struct nlist; -extern int nlist P((const char *, struct nlist *)); +extern int nlist (const char *, struct nlist *); #endif #ifdef DECL_PLOCK_0 -extern int plock P((int)); +extern int plock (int); #endif #ifdef DECL_RENAME_0 -extern int rename P((const char *, const char *)); +extern int rename (const char *, const char *); #endif #ifdef DECL_SELECT_0 #ifdef _ntp_select_h -extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); +extern int select (int, fd_set *, fd_set *, fd_set *, struct timeval *); #endif #endif #ifdef DECL_SETITIMER_0 struct itimerval; -extern int setitimer P((int , struct itimerval *, struct itimerval *)); +extern int setitimer (int , struct itimerval *, struct itimerval *); #endif #ifdef PRIO_PROCESS #ifdef DECL_SETPRIORITY_0 -extern int setpriority P((int, int, int)); +extern int setpriority (int, int, int); #endif #ifdef DECL_SETPRIORITY_1 -extern int setpriority P((int, id_t, int)); +extern int setpriority (int, id_t, int); #endif #endif #ifdef DECL_SIGVEC_0 struct sigvec; -extern int sigvec P((int, struct sigvec *, struct sigvec *)); +extern int sigvec (int, struct sigvec *, struct sigvec *); #endif #ifndef HAVE_SNPRINTF /* PRINTFLIKE3 */ -extern int snprintf P((char *, size_t, const char *, ...)); +extern int snprintf (char *, size_t, const char *, ...); #endif /* HMS: does this need further protection? */ #ifndef HAVE_VSNPRINTF -extern int vsnprintf P((char *, size_t, const char *, va_list)); +extern int vsnprintf (char *, size_t, const char *, va_list); #endif #ifdef DECL_STDIO_0 #if defined(FILE) || defined(BUFSIZ) -extern int _flsbuf P((int, FILE *)); -extern int _filbuf P((FILE *)); -extern int fclose P((FILE *)); -extern int fflush P((FILE *)); -extern int fprintf P((FILE *, const char *, ...)); -extern int fscanf P((FILE *, const char *, ...)); -extern int fputs P((const char *, FILE *)); -extern int fputc P((int, FILE *)); -extern int fread P((char *, int, int, FILE *)); -extern void perror P((const char *)); -extern int printf P((const char *, ...)); -extern int setbuf P((FILE *, char *)); +extern int _flsbuf (int, FILE *); +extern int _filbuf (FILE *); +extern int fclose (FILE *); +extern int fflush (FILE *); +extern int fprintf (FILE *, const char *, ...); +extern int fscanf (FILE *, const char *, ...); +extern int fputs (const char *, FILE *); +extern int fputc (int, FILE *); +extern int fread (char *, int, int, FILE *); +extern void perror (const char *); +extern int printf (const char *, ...); +extern int setbuf (FILE *, char *); # ifdef HAVE_SETLINEBUF -extern int setlinebuf P((FILE *)); +extern int setlinebuf (FILE *); # endif -extern int setvbuf P((FILE *, char *, int, int)); -extern int scanf P((const char *, ...)); -extern int sscanf P((const char *, const char *, ...)); -extern int vfprintf P((FILE *, const char *, ...)); -extern int vsprintf P((char *, const char *, ...)); +extern int setvbuf (FILE *, char *, int, int); +extern int scanf (const char *, ...); +extern int sscanf (const char *, const char *, ...); +extern int vfprintf (FILE *, const char *, ...); +extern int vsprintf (char *, const char *, ...); #endif #endif #ifdef DECL_STIME_0 -extern int stime P((const time_t *)); +extern int stime (const time_t *); #endif #ifdef DECL_STIME_1 -extern int stime P((long *)); +extern int stime (long *); #endif #ifdef DECL_STRERROR_0 -extern char * strerror P((int errnum)); +extern char * strerror (int errnum); #endif #ifdef DECL_STRTOL_0 -extern long strtol P((const char *, char **, int)); +extern long strtol (const char *, char **, int); #endif #ifdef DECL_SYSCALL -extern int syscall P((int, ...)); +extern int syscall (int, ...); #endif #ifdef DECL_SYSLOG_0 -extern void closelog P((void)); +extern void closelog (void); #ifndef LOG_DAEMON -extern void openlog P((const char *, int)); +extern void openlog (const char *, int); #else -extern void openlog P((const char *, int, int)); +extern void openlog (const char *, int, int); #endif -extern int setlogmask P((int)); -extern void syslog P((int, const char *, ...)); +extern int setlogmask (int); +extern void syslog (int, const char *, ...); #endif #ifdef DECL_TIME_0 -extern time_t time P((time_t *)); +extern time_t time (time_t *); #endif #ifdef DECL_TIMEOFDAY_0 #ifdef SYSV_TIMEOFDAY -extern int gettimeofday P((struct timeval *)); -extern int settimeofday P((struct timeval *)); +extern int gettimeofday (struct timeval *); +extern int settimeofday (struct timeval *); #else /* not SYSV_TIMEOFDAY */ struct timezone; -extern int gettimeofday P((struct timeval *, struct timezone *)); -extern int settimeofday P((struct timeval *, void *)); +extern int gettimeofday (struct timeval *, struct timezone *); +extern int settimeofday (struct timeval *, void *); #endif /* not SYSV_TIMEOFDAY */ #endif #ifdef DECL_TOLOWER_0 -extern int tolower P((int)); +extern int tolower (int); #endif #ifdef DECL_TOUPPER_0 -extern int toupper P((int)); +extern int toupper (int); #endif /* @@ -242,265 +238,4 @@ extern int errno; extern int h_errno; #endif -/*******************************************************/ - -#if 0 -/* - * Unprotoyped library functions for SunOS 4.x.x - */ -#ifdef SYS_SUNOS4 -extern void closelog P((void)); -extern void openlog P((char *, int, int)); -extern void syslog P((int, char *, ...)); -extern int setlogmask P((int)); - -extern char * getpass P((char *)); - -extern int setpriority P((int ,int ,int)); - -extern long strtol P((char *, char **, int)); - -#if !defined(NTP_POSIX_SOURCE) -extern int atoi P((char *)); -extern int dup2 P((int, int)); -extern int execve P((char *, char **,char **)); -extern int fork P((void)); -extern int getdtablesize P((void)); -extern int qsort (void *, int , int, - int P((*compar)(void *, void *))); -extern int setpgrp P((int, int)); -extern void bcopy P((const char *, char *, int)); -#endif - -#ifndef bzero /* XXX macro prototyping clash */ -extern void bzero P((char *, int)); -extern int bcmp P((char *, char *, int)); -extern void bcopy P((const char *, char *, int)); -#endif -extern char *mktemp P((char *)); - -extern int tolower P((int)); - -extern int isatty P((int)); - -extern unsigned sleep P((unsigned )); -extern unsigned int alarm P((unsigned int)); -extern int pause P((void)); - -extern int getpid P((void)); -extern int getppid P((void)); - -extern int close P((int)); -extern int ioctl P((int, int, char *)); -extern int rename P((char *, char *)); -#if 0 -extern int read P((int, void *, size_t)); -extern int write P((int, const void *, size_t)); -#endif -extern int unlink P((const char *)); -extern int link P((const char *, const char *)); - -#ifdef FILE -extern int fclose P((FILE *)); -extern int fflush P((FILE *)); -extern int fprintf P((FILE *, char *, ...)); -extern int fscanf P((FILE *, char *, ...)); -extern int fputs P((char *, FILE *)); -extern int fputc P((char, FILE *)); -extern int fread P((char *, int, int, FILE *)); -extern int printf P((char *, ...)); -extern int setbuf P((FILE *, char *)); -extern int setvbuf P((FILE *, char *, int, int)); -extern int scanf P((char *, ...)); -extern int sscanf P((char *, char *, ...)); -extern int vsprintf P((char *, char *, ...)); -extern int _flsbuf P((int, FILE *)); -extern int _filbuf P((FILE *)); -extern void perror P((char *)); -#ifdef HAVE_SETLINEBUF -extern int setlinebuf P((FILE *)); -#endif -#endif - -#ifdef _ntp_string_h -#ifdef NTP_POSIX_SOURCE /* these are builtins */ -#ifndef NTP_NEED_BOPS /* but may be emulated by bops */ -extern char *memcpy P(()); -extern char *memset P(()); -extern int memcmp P(()); -#endif -#endif -#endif - -#ifdef _sys_socket_h -extern int bind P((int, struct sockaddr *, int)); -extern int connect P((int, struct sockaddr *, int)); -extern int sendto P((int, char *, int, int, struct sockaddr *, int)); -extern int setsockopt P((int, int, int, char *, int)); -extern int socket P((int, int, int)); -extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *)); -#endif /* _sys_socket_h */ - -#ifdef _ntp_select_h -extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); -#endif - -#ifdef _sys_time_h -extern int adjtime P((struct timeval *, struct timeval *)); -extern int setitimer P((int , struct itimerval *, struct itimerval *)); -#ifdef SYSV_TIMEOFDAY -extern int gettimeofday P((struct timeval *)); -extern int settimeofday P((struct timeval *)); -#else /* ! SYSV_TIMEOFDAY */ -extern int gettimeofday P((struct timeval *, struct timezone *)); -extern int settimeofday P((struct timeval *, struct timezone *)); -#endif /* SYSV_TIMEOFDAY */ -#endif /* _sys_time_h */ - -#ifdef __time_h -extern time_t time P((time_t *)); -#endif - -#ifdef __setjmp_h -extern int setjmp P((jmp_buf)); -extern void longjmp P((jmp_buf, int)); -#endif - -#ifdef _sys_resource_h -extern int getrusage P((int, struct rusage *)); -#endif - -#ifdef _nlist_h -extern int nlist P((char *, struct nlist *)); -#endif - -#endif /* SYS_SUNOS4 */ - -/* - * Unprototyped library functions for DEC OSF/1 - */ -#ifdef SYS_DECOSF1 -#ifndef _MACHINE_ENDIAN_H_ -#define _MACHINE_ENDIAN_H_ -extern u_short htons P((u_short)); -extern u_short ntohs P((u_short)); -extern u_int32 htonl P((u_int32)); -extern u_int32 ntohl P((u_int32)); -#endif /* _MACHINE_ENDIAN_H_ */ - -/* -extern char * getpass P((char *)); -*/ -extern char * mktemp P((char *)); -#ifndef SYS_IX86OSF1 -extern int ioctl P((int, u_long, char *)); -extern void bzero P((char *, int)); -#endif - -#ifdef SOCK_DGRAM -extern int bind P((int, const struct sockaddr *, int)); -extern int connect P((int, const struct sockaddr *, int)); -extern int socket P((int, int, int)); -extern int sendto P((int, const void *, int, int, const struct sockaddr *, int)); -extern int setsockopt P((int, int, int, const void *, int)); -extern int recvfrom P((int, void *, int, int, struct sockaddr *, int *)); -#endif /* SOCK_STREAM */ - -#ifdef _ntp_select_h -extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); -#endif - -#endif /* DECOSF1 */ - -/* - * Unprototyped library functions for Ultrix - */ -#ifdef SYS_ULTRIX -extern int close P((int)); -extern char * getpass P((char *)); -extern int getpid P((void)); -extern int ioctl P((int, int, char *)); -extern char *mktemp P((char *)); -extern int unlink P((const char *)); -extern int link P((const char *, const char *)); - -extern void closelog P((void)); -extern void syslog P((int, char *, ...)); -#ifndef LOG_DAEMON -extern void openlog P((char *, int)); -#else -extern void openlog P((char *, int, int)); -#endif - -extern int setpriority P((int ,int ,int )); - -#ifdef SOCK_DGRAM -extern int bind P((int, struct sockaddr *, int)); -extern int connect P((int, struct sockaddr *, int)); -extern int socket P((int, int, int)); -extern int sendto P((int, char *, int, int, struct sockaddr *, int)); -extern int setsockopt P((int, int, int, char *, int)); -extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *)); -#endif /* SOCK_STREAM */ - -#ifdef _TIME_H_ -extern int gettimeofday P((struct timeval *, struct timezone *)); -extern int settimeofday P((struct timeval *, struct timezone *)); -extern int adjtime P((struct timeval *, struct timeval *)); -extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); -extern int setitimer P((int , struct itimerval *, struct itimerval *)); -#endif /* _TIME_H_ */ - -#ifdef N_UNDF -extern int nlist P((char *, struct nlist *)); -#endif - -#ifndef bzero /* XXX macro prototyping clash */ -extern void bzero P((char *, int)); -extern int bcmp P((char *, char *, int)); -extern void bcopy P((const char *, char *, int)); -#endif - -#ifndef NTP_POSIX_SOURCE -extern int atoi P((char *)); -extern void bzero P((char *, int)); -extern int bcmp P((char *, char *, int)); -extern void bcopy P((const char *, char *, int)); -extern int execve P((char *, char **,char **)); -extern int fork P((void)); -extern int getdtablesize P((void)); -extern int ran P((void)); -#ifdef _TIME_H_ -extern int gettimeofday P((struct timeval *, struct timezone *)); -extern int settimeofday P((struct timeval *, struct timezone *)); -#endif -#endif - -#ifdef _RESOURCE_H_ -extern int getrusage P((int, struct rusage *)); -#endif - -#endif /* SYS_ULTRIX */ - -#if defined(__convex__) -extern char * getpass P((char *)); -#endif - -#ifdef SYS_IRIX4 -extern char * getpass P((char *)); -#endif /* IRIX4 */ - -#ifdef SYS_VAX -extern char * getpass P((char *)); -#endif /* VAX */ - -#ifdef SYS_DOMAINOS -extern char * getpass P((char *)); -#endif /* SYS_DOMAINOS */ - -#ifdef SYS_BSD -#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000) -#endif - -#endif /* 0 */ #endif /* l_stdlib_h */ diff --git a/include/mbg_gps166.h b/include/mbg_gps166.h index edaae9df20..2ec2bdd307 100644 --- a/include/mbg_gps166.h +++ b/include/mbg_gps166.h @@ -524,31 +524,31 @@ typedef struct { } IONO; -void mbg_tm_str P((char **, TM *, int)); -void mbg_tgps_str P((char **, T_GPS *, int)); -void get_mbg_header P((unsigned char **, GPS_MSG_HDR *)); -void put_mbg_header P((unsigned char **, GPS_MSG_HDR *)); -void get_mbg_sw_rev P((unsigned char **, SW_REV *)); -void get_mbg_ascii_msg P((unsigned char **, ASCII_MSG *)); -void get_mbg_svno P((unsigned char **, SVNO *)); -void get_mbg_health P((unsigned char **, HEALTH *)); -void get_mbg_cfg P((unsigned char **, CFG *)); -void get_mbg_tgps P((unsigned char **, T_GPS *)); -void get_mbg_tm P((unsigned char **, TM *)); -void get_mbg_ttm P((unsigned char **, TTM *)); -void get_mbg_synth P((unsigned char **, SYNTH *)); -void get_mbg_tzdl P((unsigned char **, TZDL *)); -void get_mbg_antinfo P((unsigned char **, ANT_INFO *)); -void get_mbg_cfgh P((unsigned char **, CFGH *)); -void get_mbg_utc P((unsigned char **, UTC *)); -void get_mbg_lla P((unsigned char **, LLA)); -void get_mbg_xyz P((unsigned char **, XYZ)); -void get_mbg_portparam P((unsigned char **, PORT_PARM *)); -void get_mbg_eph P((unsigned char **, EPH *)); -void get_mbg_alm P((unsigned char **, ALM *)); -void get_mbg_iono P((unsigned char **, IONO *)); - -unsigned long mbg_csum P((unsigned char *, unsigned int)); +void mbg_tm_str (char **, TM *, int); +void mbg_tgps_str (char **, T_GPS *, int); +void get_mbg_header (unsigned char **, GPS_MSG_HDR *); +void put_mbg_header (unsigned char **, GPS_MSG_HDR *); +void get_mbg_sw_rev (unsigned char **, SW_REV *); +void get_mbg_ascii_msg (unsigned char **, ASCII_MSG *); +void get_mbg_svno (unsigned char **, SVNO *); +void get_mbg_health (unsigned char **, HEALTH *); +void get_mbg_cfg (unsigned char **, CFG *); +void get_mbg_tgps (unsigned char **, T_GPS *); +void get_mbg_tm (unsigned char **, TM *); +void get_mbg_ttm (unsigned char **, TTM *); +void get_mbg_synth (unsigned char **, SYNTH *); +void get_mbg_tzdl (unsigned char **, TZDL *); +void get_mbg_antinfo (unsigned char **, ANT_INFO *); +void get_mbg_cfgh (unsigned char **, CFGH *); +void get_mbg_utc (unsigned char **, UTC *); +void get_mbg_lla (unsigned char **, LLA); +void get_mbg_xyz (unsigned char **, XYZ); +void get_mbg_portparam (unsigned char **, PORT_PARM *); +void get_mbg_eph (unsigned char **, EPH *); +void get_mbg_alm (unsigned char **, ALM *); +void get_mbg_iono (unsigned char **, IONO *); + +unsigned long mbg_csum (unsigned char *, unsigned int); #endif /* diff --git a/include/ntp.h b/include/ntp.h index 56e7804a63..ce40df6ecc 100644 --- a/include/ntp.h +++ b/include/ntp.h @@ -357,7 +357,7 @@ struct peer { u_long outdate; /* send time last packet */ u_long nextdate; /* send time next packet */ u_long nextaction; /* peer local activity timeout (refclocks) */ - void (*action) P((struct peer *)); /* action timeout function */ + void (*action) (struct peer *); /* action timeout function */ /* * Statistic counters diff --git a/include/ntp_calendar.h b/include/ntp_calendar.h index 95e2c12974..5fc977f815 100644 --- a/include/ntp_calendar.h +++ b/include/ntp_calendar.h @@ -78,8 +78,8 @@ struct calendar { #define JANFEBLEAP ((JAN+FEBLEAP) * SECSPERDAY) -extern void caljulian P((u_long, struct calendar *)); -extern u_long caltontp P((const struct calendar *)); +extern void caljulian (u_long, struct calendar *); +extern u_long caltontp (const struct calendar *); /* * Additional support stuff for Ed Rheingold's calendrical calculations @@ -87,7 +87,7 @@ extern u_long caltontp P((const struct calendar *)); /* * Start day of NTP time as days past the imaginary date 12/1/1 BC. - * P((This is the beginning of the Christian Era, or BCE.)) + * (This is the beginning of the Christian Era, or BCE.) */ #define DAY_NTP_STARTS 693596 /* diff --git a/include/ntp_cmdargs.h b/include/ntp_cmdargs.h index e9ab9b1c29..ee41b4a56c 100644 --- a/include/ntp_cmdargs.h +++ b/include/ntp_cmdargs.h @@ -1,4 +1,4 @@ #include "ntp_types.h" -extern void getstartup P((int, char **)); -extern void getCmdOpts P((int, char **)); +extern void getstartup (int, char **); +extern void getCmdOpts (int, char **); diff --git a/include/ntp_filegen.h b/include/ntp_filegen.h index 836ec04ec0..a1514b3e50 100644 --- a/include/ntp_filegen.h +++ b/include/ntp_filegen.h @@ -45,7 +45,7 @@ typedef struct FILEGEN u_char flag; /* flags modifying processing of file generation */ } FILEGEN; -extern void filegen_setup P((FILEGEN *, u_long)); -extern void filegen_config P((FILEGEN *, char *, u_int, u_int)); -extern FILEGEN *filegen_get P((char *)); -extern void filegen_register P((char *, const char *, FILEGEN *)); +extern void filegen_setup (FILEGEN *, u_long); +extern void filegen_config (FILEGEN *, char *, u_int, u_int); +extern FILEGEN *filegen_get (char *); +extern void filegen_register (char *, const char *, FILEGEN *); diff --git a/include/ntp_fp.h b/include/ntp_fp.h index 307ab102dd..8eb7567073 100644 --- a/include/ntp_fp.h +++ b/include/ntp_fp.h @@ -340,26 +340,26 @@ typedef u_int32 u_fp; /* * Prototypes */ -extern char * dofptoa P((u_fp, int, short, int)); -extern char * dolfptoa P((u_long, u_long, int, short, int)); - -extern int atolfp P((const char *, l_fp *)); -extern int buftvtots P((const char *, l_fp *)); -extern char * fptoa P((s_fp, short)); -extern char * fptoms P((s_fp, short)); -extern int hextolfp P((const char *, l_fp *)); -extern void gpstolfp P((int, int, unsigned long, l_fp *)); -extern int mstolfp P((const char *, l_fp *)); -extern char * prettydate P((l_fp *)); -extern char * gmprettydate P((l_fp *)); -extern char * uglydate P((l_fp *)); -extern void mfp_mul P((int32 *, u_int32 *, int32, u_int32, int32, u_int32)); - -extern void get_systime P((l_fp *)); -extern int step_systime P((double)); -extern int adj_systime P((double)); - -extern struct tm * ntp2unix_tm P((u_long ntp, int local)); +extern char * dofptoa (u_fp, int, short, int); +extern char * dolfptoa (u_long, u_long, int, short, int); + +extern int atolfp (const char *, l_fp *); +extern int buftvtots (const char *, l_fp *); +extern char * fptoa (s_fp, short); +extern char * fptoms (s_fp, short); +extern int hextolfp (const char *, l_fp *); +extern void gpstolfp (int, int, unsigned long, l_fp *); +extern int mstolfp (const char *, l_fp *); +extern char * prettydate (l_fp *); +extern char * gmprettydate (l_fp *); +extern char * uglydate (l_fp *); +extern void mfp_mul (int32 *, u_int32 *, int32, u_int32, int32, u_int32); + +extern void get_systime (l_fp *); +extern int step_systime (double); +extern int adj_systime (double); + +extern struct tm * ntp2unix_tm (u_long ntp, int local); #define lfptoa(_fpv, _ndec) mfptoa((_fpv)->l_ui, (_fpv)->l_uf, (_ndec)) #define lfptoms(_fpv, _ndec) mfptoms((_fpv)->l_ui, (_fpv)->l_uf, (_ndec)) diff --git a/include/ntp_machine.h b/include/ntp_machine.h index 2a3b6e6a6c..1a28cd7d17 100644 --- a/include/ntp_machine.h +++ b/include/ntp_machine.h @@ -74,24 +74,12 @@ WILL IOCTL(SIOCGIFCONF) WORK ON A SOCKET MISC - HAVE_PROTOTYPES - Prototype functions DOSYNCTODR - Resync TODR clock every hour. RETSIGTYPE - Define signal function type. NO_SIGNED_CHAR_DECL - No "signed char" see include/ntp.h LOCK_PROCESS - Have plock. */ -/* - * Set up for prototyping (duplicated from ntp_types.h) - */ -#ifndef P -#if defined(__STDC__) || defined(HAVE_PROTOTYPES) -#define P(x) x -#else /* not __STDC__ and not HAVE_PROTOTYPES */ -#define P(x) () -#endif /* not __STDC__ and not HAVE_PROTOTYPES */ -#endif /* P */ - #if !defined(HAVE_NTP_ADJTIME) && defined(HAVE___ADJTIMEX) # define ntp_adjtime __adjtimex #endif @@ -287,7 +275,7 @@ typedef unsigned long u_long; # define vsnprintf _vsnprintf #endif /* SYS_WINNT */ -int ntp_set_tod P((struct timeval *tvp, void *tzp)); +int ntp_set_tod (struct timeval *tvp, void *tzp); #if defined (SYS_CYGWIN32) #include @@ -326,7 +314,7 @@ int ntp_set_tod P((struct timeval *tvp, void *tzp)); #include "taskLib.h" #include "time.h" -extern int sysClkRateGet P(()); +extern int sysClkRateGet (); /* usrtime.h * Bob Herlien's excellent time code find it at: @@ -335,14 +323,14 @@ extern int sysClkRateGet P(()); * adjtime() too ... casey */ /* -extern int gettimeofday P(( struct timeval *tp, struct timezone *tzp )); -extern int settimeofday P((struct timeval *, struct timezone *)); -extern int adjtime P(( struct timeval *delta, struct timeval *olddelta )); +extern int gettimeofday ( struct timeval *tp, struct timezone *tzp ); +extern int settimeofday (struct timeval *, struct timezone *); +extern int adjtime ( struct timeval *delta, struct timeval *olddelta ); */ /* in machines.c */ -extern void sleep P((int seconds)); -extern void alarm P((int seconds)); +extern void sleep (int seconds); +extern void alarm (int seconds); /* machines.c */ @@ -382,10 +370,10 @@ extern int h_errno; #define TRY_AGAIN 2 -struct hostent *gethostbyname P((char * netnum)); -struct hostent *gethostbyaddr P((char * netnum, int size, int addr_type)); +struct hostent *gethostbyname (char * netnum); +struct hostent *gethostbyaddr (char * netnum, int size, int addr_type); /* type is the protocol */ -struct servent *getservbyname P((char *name, char *type)); +struct servent *getservbyname (char *name, char *type); #endif /* NO_NETDB */ #ifdef NO_MAIN_ALLOWED @@ -544,7 +532,7 @@ extern char *strdup(const char *); #endif #ifndef HAVE_TIMEGM -extern time_t timegm P((struct tm *)); +extern time_t timegm (struct tm *); #endif #ifdef HAVE_SYSV_TTYS diff --git a/include/ntp_random.h b/include/ntp_random.h index 766dcc3760..3f898312d7 100644 --- a/include/ntp_random.h +++ b/include/ntp_random.h @@ -1,14 +1,14 @@ #include -long ntp_random P((void)); -void ntp_srandom P((unsigned long)); -void ntp_srandomdev P((void)); -char * ntp_initstate P((unsigned long, /* seed for R.N.G. */ +long ntp_random (void); +void ntp_srandom (unsigned long); +void ntp_srandomdev (void); +char * ntp_initstate (unsigned long, /* seed for R.N.G. */ char *, /* pointer to state array */ long /* # bytes of state info */ - )); -char * ntp_setstate P((char *)); /* pointer to state array */ + ); +char * ntp_setstate (char *); /* pointer to state array */ diff --git a/include/ntp_refclock.h b/include/ntp_refclock.h index d63f3af38e..e2a8738f18 100644 --- a/include/ntp_refclock.h +++ b/include/ntp_refclock.h @@ -123,8 +123,8 @@ struct refclockstat { */ struct refclockio { struct refclockio *next; /* link to next structure */ - void (*clock_recv) P((struct recvbuf *)); /* completion routine */ - int (*io_input) P((struct recvbuf *)); /* input routine - + void (*clock_recv) (struct recvbuf *); /* completion routine */ + int (*io_input) (struct recvbuf *); /* input routine - to avoid excessive buffer use due to small bursts of refclock input data */ @@ -231,14 +231,14 @@ struct refclockproc { #define NOFLAGS 0 /* flag for null flags */ struct refclock { - int (*clock_start) P((int, struct peer *)); - void (*clock_shutdown) P((int, struct peer *)); - void (*clock_poll) P((int, struct peer *)); - void (*clock_control) P((int, struct refclockstat *, - struct refclockstat *, struct peer *)); - void (*clock_init) P((void)); - void (*clock_buginfo) P((int, struct refclockbug *, struct peer *)); - void (*clock_timer) P((int, struct peer *)); + int (*clock_start) (int, struct peer *); + void (*clock_shutdown) (int, struct peer *); + void (*clock_poll) (int, struct peer *); + void (*clock_control) (int, struct refclockstat *, + struct refclockstat *, struct peer *); + void (*clock_init) (void); + void (*clock_buginfo) (int, struct refclockbug *, struct peer *); + void (*clock_timer) (int, struct peer *); }; /* @@ -247,27 +247,27 @@ struct refclock { /* * auxiliary PPS interface (implemented by refclock_atom()) */ -extern int pps_sample P((l_fp *)); -extern int io_addclock_simple P((struct refclockio *)); -extern int io_addclock P((struct refclockio *)); -extern void io_closeclock P((struct refclockio *)); +extern int pps_sample (l_fp *); +extern int io_addclock_simple (struct refclockio *); +extern int io_addclock (struct refclockio *); +extern void io_closeclock (struct refclockio *); #ifdef REFCLOCK -extern void refclock_buginfo P((struct sockaddr_storage *, - struct refclockbug *)); -extern void refclock_control P((struct sockaddr_storage *, +extern void refclock_buginfo (struct sockaddr_storage *, + struct refclockbug *); +extern void refclock_control (struct sockaddr_storage *, struct refclockstat *, - struct refclockstat *)); -extern int refclock_open P((char *, u_int, u_int)); -extern int refclock_setup P((int, u_int, u_int)); -extern void refclock_timer P((struct peer *)); -extern void refclock_transmit P((struct peer *)); -extern int refclock_ioctl P((int, u_int)); -extern int refclock_process P((struct refclockproc *)); -extern void refclock_process_offset P((struct refclockproc *, l_fp, l_fp, double)); -extern void refclock_report P((struct peer *, int)); -extern int refclock_gtlin P((struct recvbuf *, char *, int, l_fp *)); -extern int refclock_gtraw P((struct recvbuf *, char *, int, l_fp *)); + struct refclockstat *); +extern int refclock_open (char *, u_int, u_int); +extern int refclock_setup (int, u_int, u_int); +extern void refclock_timer (struct peer *); +extern void refclock_transmit (struct peer *); +extern int refclock_ioctl (int, u_int); +extern int refclock_process (struct refclockproc *); +extern void refclock_process_offset (struct refclockproc *, l_fp, l_fp, double); +extern void refclock_report (struct peer *, int); +extern int refclock_gtlin (struct recvbuf *, char *, int, l_fp *); +extern int refclock_gtraw (struct recvbuf *, char *, int, l_fp *); #endif /* REFCLOCK */ #endif /* NTP_REFCLOCK_H */ diff --git a/include/ntp_stdlib.h b/include/ntp_stdlib.h index c389d1ecc9..0c8834427e 100644 --- a/include/ntp_stdlib.h +++ b/include/ntp_stdlib.h @@ -25,84 +25,78 @@ # endif #endif -#if defined(__STDC__) || defined(HAVE_STDARG_H) # include -extern void msyslog P((int, const char *, ...)) +extern void msyslog (int, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -extern void netsyslog P((int, const char *, ...)) +extern void netsyslog (int, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -#else -# include -extern void msyslog P(()); -extern void netsyslog P(()); -#endif -extern void auth_delkeys P((void)); -extern int auth_havekey P((keyid_t)); -extern int authdecrypt P((keyid_t, u_int32 *, int, int)); -extern int authencrypt P((keyid_t, u_int32 *, int)); -extern int authhavekey P((keyid_t)); -extern int authistrusted P((keyid_t)); -extern int authreadkeys P((const char *)); -extern void authtrust P((keyid_t, u_long)); -extern int authusekey P((keyid_t, int, const u_char *)); - -extern u_long calyearstart P((u_long)); -extern const char *clockname P((int)); -extern int clocktime P((int, int, int, int, int, u_long, u_long *, u_int32 *)); +extern void auth_delkeys (void); +extern int auth_havekey (keyid_t); +extern int authdecrypt (keyid_t, u_int32 *, int, int); +extern int authencrypt (keyid_t, u_int32 *, int); +extern int authhavekey (keyid_t); +extern int authistrusted (keyid_t); +extern int authreadkeys (const char *); +extern void authtrust (keyid_t, u_long); +extern int authusekey (keyid_t, int, const u_char *); + +extern u_long calyearstart (u_long); +extern const char *clockname (int); +extern int clocktime (int, int, int, int, int, u_long, u_long *, u_int32 *); #if defined SYS_WINNT && defined DEBUG # define emalloc(_c) debug_emalloc(_c, __FILE__, __LINE__) -extern void * debug_emalloc P((u_int, char *, int)); +extern void * debug_emalloc (u_int, char *, int); #else -extern void * emalloc P((u_int)); +extern void * emalloc (u_int); #endif -extern int ntp_getopt P((int, char **, const char *)); -extern void init_auth P((void)); -extern void init_lib P((void)); -extern struct savekey *auth_findkey P((keyid_t)); -extern int auth_moremem P((void)); -extern int ymd2yd P((int, int, int)); - -extern int MD5authdecrypt P((u_char *, u_int32 *, int, int)); -extern int MD5authencrypt P((u_char *, u_int32 *, int)); -extern void MD5auth_setkey P((keyid_t, const u_char *, const int)); -extern u_int32 addr2refid P((struct sockaddr_storage *)); - -extern int atoint P((const char *, long *)); -extern int atouint P((const char *, u_long *)); -extern int hextoint P((const char *, u_long *)); -extern char * humandate P((u_long)); -extern char * humanlogtime P((void)); -extern char * inttoa P((long)); -extern char * mfptoa P((u_long, u_long, short)); -extern char * mfptoms P((u_long, u_long, short)); -extern const char * modetoa P((int)); -extern const char * eventstr P((int)); -extern const char * ceventstr P((int)); -extern char * statustoa P((int, int)); -extern const char * sysstatstr P((int)); -extern const char * peerstatstr P((int)); -extern const char * clockstatstr P((int)); -extern struct sockaddr_storage* netof P((struct sockaddr_storage*)); -extern char * numtoa P((u_int32)); -extern char * numtohost P((u_int32)); -extern char * socktoa P((struct sockaddr_storage *)); -extern char * socktohost P((struct sockaddr_storage *)); -extern int octtoint P((const char *, u_long *)); -extern u_long ranp2 P((int)); -extern char * refnumtoa P((struct sockaddr_storage *)); -extern int tsftomsu P((u_long, int)); -extern char * uinttoa P((u_long)); - -extern int decodenetnum P((const char *, struct sockaddr_storage *)); - -extern const char * FindConfig P((const char *)); - -extern void signal_no_reset P((int, RETSIGTYPE (*func)(int))); - -extern void getauthkeys P((const char *)); -extern void auth_agekeys P((void)); -extern void rereadkeys P((void)); +extern int ntp_getopt (int, char **, const char *); +extern void init_auth (void); +extern void init_lib (void); +extern struct savekey *auth_findkey (keyid_t); +extern int auth_moremem (void); +extern int ymd2yd (int, int, int); + +extern int MD5authdecrypt (u_char *, u_int32 *, int, int); +extern int MD5authencrypt (u_char *, u_int32 *, int); +extern void MD5auth_setkey (keyid_t, const u_char *, const int); +extern u_int32 addr2refid (struct sockaddr_storage *); + +extern int atoint (const char *, long *); +extern int atouint (const char *, u_long *); +extern int hextoint (const char *, u_long *); +extern char * humandate (u_long); +extern char * humanlogtime (void); +extern char * inttoa (long); +extern char * mfptoa (u_long, u_long, short); +extern char * mfptoms (u_long, u_long, short); +extern const char * modetoa (int); +extern const char * eventstr (int); +extern const char * ceventstr (int); +extern char * statustoa (int, int); +extern const char * sysstatstr (int); +extern const char * peerstatstr (int); +extern const char * clockstatstr (int); +extern struct sockaddr_storage* netof (struct sockaddr_storage*); +extern char * numtoa (u_int32); +extern char * numtohost (u_int32); +extern char * socktoa (struct sockaddr_storage *); +extern char * socktohost (struct sockaddr_storage *); +extern int octtoint (const char *, u_long *); +extern u_long ranp2 (int); +extern char * refnumtoa (struct sockaddr_storage *); +extern int tsftomsu (u_long, int); +extern char * uinttoa (u_long); + +extern int decodenetnum (const char *, struct sockaddr_storage *); + +extern const char * FindConfig (const char *); + +extern void signal_no_reset (int, RETSIGTYPE (*func)(int)); + +extern void getauthkeys (const char *); +extern void auth_agekeys (void); +extern void rereadkeys (void); /* * Variable declarations for libntp. diff --git a/include/ntp_string.h b/include/ntp_string.h index f7f0092ae4..17163b0533 100644 --- a/include/ntp_string.h +++ b/include/ntp_string.h @@ -41,7 +41,7 @@ char *strchr(), *strrchr(); # define memcpy(t,f,c) bcopy(f,t,(int)c) # define memset(a,x,c) if (x == 0x00) bzero(a,(int)c); else ntp_memset((char*)a,x,c) -void ntp_memset P((char *, int, int)); +void ntp_memset (char *, int, int); #endif /* NTP_NEED_BOPS */ diff --git a/include/ntp_types.h b/include/ntp_types.h index 0b575c8c6a..e665e713b9 100644 --- a/include/ntp_types.h +++ b/include/ntp_types.h @@ -22,17 +22,6 @@ #undef mac #endif -/* - * Set up for prototyping - */ -#ifndef P -#if defined(__STDC__) || defined(HAVE_PROTOTYPES) -#define P(x) x -#else /* not __STDC__ and not HAVE_PROTOTYPES */ -#define P(x) () -#endif /* not __STDC__ and HAVE_PROTOTYPES */ -#endif /* P */ - /* * VMS DECC (v4.1), {u_char,u_short,u_long} are only in SOCKET.H, * and u_int isn't defined anywhere diff --git a/include/ntp_unixtime.h b/include/ntp_unixtime.h index ce96980209..f5fe546d10 100644 --- a/include/ntp_unixtime.h +++ b/include/ntp_unixtime.h @@ -137,5 +137,5 @@ extern u_long msutotsfhi[]; #define MSUTOTSF(msu, tsf) \ (tsf) = msutotsfhi[((msu) >> 5) & 0x1f] + msutotsflo[(msu) & 0x1f] -extern char * tvtoa P((const struct timeval *)); -extern char * utvtoa P((const struct timeval *)); +extern char * tvtoa (const struct timeval *); +extern char * utvtoa (const struct timeval *); diff --git a/include/ntpd.h b/include/ntpd.h index 73148f5d8d..d887bb6305 100644 --- a/include/ntpd.h +++ b/include/ntpd.h @@ -13,20 +13,20 @@ /* ntp_config.c */ -extern void getconfig P((int, char **)); +extern void getconfig (int, char **); /* ntp_config.c */ -extern void ctl_clr_stats P((void)); -extern int ctlclrtrap P((struct sockaddr_storage *, struct interface *, int)); -extern u_short ctlpeerstatus P((struct peer *)); -extern int ctlsettrap P((struct sockaddr_storage *, struct interface *, int, int)); -extern u_short ctlsysstatus P((void)); -extern void init_control P((void)); -extern void process_control P((struct recvbuf *, int)); -extern void report_event P((int, struct peer *)); - -extern double fabs P((double)); -extern double sqrt P((double)); +extern void ctl_clr_stats (void); +extern int ctlclrtrap (struct sockaddr_storage *, struct interface *, int); +extern u_short ctlpeerstatus (struct peer *); +extern int ctlsettrap (struct sockaddr_storage *, struct interface *, int, int); +extern u_short ctlsysstatus (void); +extern void init_control (void); +extern void process_control (struct recvbuf *, int); +extern void report_event (int, struct peer *); + +extern double fabs (double); +extern double sqrt (double); /* ntp_control.c */ /* @@ -52,15 +52,15 @@ struct ctl_var { #define WO (CAN_WRITE) #define RW (CAN_READ|CAN_WRITE) -extern char * add_var P((struct ctl_var **, u_long, u_short)); -extern void free_varlist P((struct ctl_var *)); -extern void set_var P((struct ctl_var **, const char *, u_long, u_short)); -extern void set_sys_var P((const char *, u_long, u_short)); +extern char * add_var (struct ctl_var **, u_long, u_short); +extern void free_varlist (struct ctl_var *); +extern void set_var (struct ctl_var **, const char *, u_long, u_short); +extern void set_sys_var (const char *, u_long, u_short); /* ntp_intres.c */ -extern void ntp_res_name P((struct sockaddr_storage, u_short)); -extern void ntp_res_recv P((void)); -extern void ntp_intres P((void)); +extern void ntp_res_name (struct sockaddr_storage, u_short); +extern void ntp_res_recv (void); +extern void ntp_intres (void); /* ntp_io.c */ typedef struct interface_info { @@ -72,30 +72,30 @@ typedef void (*interface_receiver_t)(void *, interface_info_t *); extern volatile int disable_dynamic_updates; -extern void interface_enumerate P((interface_receiver_t, void *)); -extern struct interface *findinterface P((struct sockaddr_storage *)); -extern struct interface *findbcastinter P((struct sockaddr_storage *)); -extern void enable_broadcast P((struct interface *, struct sockaddr_storage *)); -extern void enable_multicast_if P((struct interface *, struct sockaddr_storage *)); -extern void interface_dump P((struct interface *)); - -extern void interface_update P((interface_receiver_t, void *)); -extern void init_io P((void)); -extern void input_handler P((l_fp *)); -extern void io_clr_stats P((void)); -extern void io_setbclient P((void)); -extern void io_unsetbclient P((void)); -extern void io_multicast_add P((struct sockaddr_storage)); -extern void io_multicast_del P((struct sockaddr_storage)); -extern void kill_asyncio P((int)); -extern void sendpkt P((struct sockaddr_storage *, struct interface *, int, struct pkt *, int)); +extern void interface_enumerate (interface_receiver_t, void *); +extern struct interface *findinterface (struct sockaddr_storage *); +extern struct interface *findbcastinter (struct sockaddr_storage *); +extern void enable_broadcast (struct interface *, struct sockaddr_storage *); +extern void enable_multicast_if (struct interface *, struct sockaddr_storage *); +extern void interface_dump (struct interface *); + +extern void interface_update (interface_receiver_t, void *); +extern void init_io (void); +extern void input_handler (l_fp *); +extern void io_clr_stats (void); +extern void io_setbclient (void); +extern void io_unsetbclient (void); +extern void io_multicast_add (struct sockaddr_storage); +extern void io_multicast_del (struct sockaddr_storage); +extern void kill_asyncio (int); +extern void sendpkt (struct sockaddr_storage *, struct interface *, int, struct pkt *, int); #ifdef DEBUG -extern void collect_timing P((struct recvbuf *, const char *, int, l_fp *)); +extern void collect_timing (struct recvbuf *, const char *, int, l_fp *); #endif #ifdef HAVE_SIGNALED_IO -extern void wait_for_signal P((void)); -extern void unblock_io_and_alarm P((void)); -extern void block_io_and_alarm P((void)); +extern void wait_for_signal (void); +extern void unblock_io_and_alarm (void); +extern void block_io_and_alarm (void); #define UNBLOCK_IO_AND_ALARM() unblock_io_and_alarm() #define BLOCK_IO_AND_ALARM() block_io_and_alarm() #else @@ -104,68 +104,68 @@ extern void block_io_and_alarm P((void)); #endif /* ntp_leap.c */ -extern void init_leap P((void)); -extern void leap_process P((void)); -extern int leap_setleap P((int, int)); +extern void init_leap (void); +extern void leap_process (void); +extern int leap_setleap (int, int); /* * there seems to be a bug in the IRIX 4 compiler which prevents * u_char from beeing used in prototyped functions. * This is also true AIX compiler. * So give up and define it to be int. WLJ */ -extern int leap_actual P((int)); +extern int leap_actual (int); /* ntp_loopfilter.c */ -extern void init_loopfilter P((void)); -extern int local_clock P((struct peer *, double)); -extern void adj_host_clock P((void)); -extern void loop_config P((int, double)); -extern void huffpuff P((void)); +extern void init_loopfilter (void); +extern int local_clock (struct peer *, double); +extern void adj_host_clock (void); +extern void loop_config (int, double); +extern void huffpuff (void); extern u_long sys_clocktime; extern u_long sys_tai; /* ntp_monitor.c */ -extern void init_mon P((void)); -extern void mon_start P((int)); -extern void mon_stop P((int)); -extern int ntp_monitor P((struct recvbuf *)); -extern void ntp_monclearinterface P((struct interface *interface)); +extern void init_mon (void); +extern void mon_start (int); +extern void mon_stop (int); +extern int ntp_monitor (struct recvbuf *); +extern void ntp_monclearinterface (struct interface *interface); /* ntp_peer.c */ -extern void init_peer P((void)); -extern struct peer *findexistingpeer P((struct sockaddr_storage *, struct peer *, int)); -extern struct peer *findpeer P((struct sockaddr_storage *, struct interface *, int, int *)); -extern struct peer *findpeerbyassoc P((u_int)); -extern void set_peerdstadr P((struct peer *peer, struct interface *interface)); -extern struct peer *newpeer P((struct sockaddr_storage *, struct interface *, int, int, int, int, u_int, u_char, int, keyid_t)); -extern void peer_all_reset P((void)); -extern void peer_clr_stats P((void)); -extern struct peer *peer_config P((struct sockaddr_storage *, struct interface *, int, int, int, int, u_int, int, keyid_t, u_char *)); -extern void peer_reset P((struct peer *)); -extern int peer_unconfig P((struct sockaddr_storage *, struct interface *, int)); -extern void refresh_all_peerinterfaces P((void)); -extern void unpeer P((struct peer *)); -extern void clear_all P((void)); +extern void init_peer (void); +extern struct peer *findexistingpeer (struct sockaddr_storage *, struct peer *, int); +extern struct peer *findpeer (struct sockaddr_storage *, struct interface *, int, int *); +extern struct peer *findpeerbyassoc (u_int); +extern void set_peerdstadr (struct peer *peer, struct interface *interface); +extern struct peer *newpeer (struct sockaddr_storage *, struct interface *, int, int, int, int, u_int, u_char, int, keyid_t); +extern void peer_all_reset (void); +extern void peer_clr_stats (void); +extern struct peer *peer_config (struct sockaddr_storage *, struct interface *, int, int, int, int, u_int, int, keyid_t, u_char *); +extern void peer_reset (struct peer *); +extern int peer_unconfig (struct sockaddr_storage *, struct interface *, int); +extern void refresh_all_peerinterfaces (void); +extern void unpeer (struct peer *); +extern void clear_all (void); #ifdef OPENSSL -extern void expire_all P((void)); +extern void expire_all (void); #endif /* OPENSSL */ -extern struct peer *findmanycastpeer P((struct recvbuf *)); +extern struct peer *findmanycastpeer (struct recvbuf *); /* ntp_crypto.c */ #ifdef OPENSSL -extern int crypto_recv P((struct peer *, struct recvbuf *)); -extern int crypto_xmit P((struct pkt *, struct sockaddr_storage *, int, struct exten *, keyid_t)); -extern keyid_t session_key P((struct sockaddr_storage *, struct sockaddr_storage *, keyid_t, keyid_t, u_long)); -extern int make_keylist P((struct peer *, struct interface *)); -extern void key_expire P((struct peer *)); -extern void crypto_update P((void)); -extern void crypto_config P((int, char *)); -extern void crypto_setup P((void)); -extern u_int crypto_ident P((struct peer *)); -extern struct exten *crypto_args P((struct peer *, u_int, char *)); -extern int crypto_public P((struct peer *, u_char *, u_int)); -extern void value_free P((struct value *)); +extern int crypto_recv (struct peer *, struct recvbuf *); +extern int crypto_xmit (struct pkt *, struct sockaddr_storage *, int, struct exten *, keyid_t); +extern keyid_t session_key (struct sockaddr_storage *, struct sockaddr_storage *, keyid_t, keyid_t, u_long); +extern int make_keylist (struct peer *, struct interface *); +extern void key_expire (struct peer *); +extern void crypto_update (void); +extern void crypto_config (int, char *); +extern void crypto_setup (void); +extern u_int crypto_ident (struct peer *); +extern struct exten *crypto_args (struct peer *, u_int, char *); +extern int crypto_public (struct peer *, u_char *, u_int); +extern void value_free (struct value *); extern char *iffpar_file; extern EVP_PKEY *iffpar_pkey; extern char *gqpar_file; @@ -176,13 +176,13 @@ extern struct value tai_leap; #endif /* OPENSSL */ /* ntp_proto.c */ -extern void transmit P((struct peer *)); -extern void receive P((struct recvbuf *)); -extern void peer_crypto_clear P((struct peer *peer)); -extern void peer_clear P((struct peer *, char *)); -extern void process_packet P((struct peer *, struct pkt *)); -extern void clock_select P((void)); -extern void kod_proto P((void)); +extern void transmit (struct peer *); +extern void receive (struct recvbuf *); +extern void peer_crypto_clear (struct peer *peer); +extern void peer_clear (struct peer *, char *); +extern void process_packet (struct peer *, struct pkt *); +extern void clock_select (void); +extern void kod_proto (void); /* * there seems to be a bug in the IRIX 4 compiler which prevents @@ -190,38 +190,38 @@ extern void kod_proto P((void)); * This is also true AIX compiler. * So give up and define it to be int. WLJ */ -extern void poll_update P((struct peer *, int)); +extern void poll_update (struct peer *, int); -extern void clear P((struct peer *)); -extern void clock_filter P((struct peer *, double, double, double)); -extern void init_proto P((void)); -extern void proto_config P((int, u_long, double, struct sockaddr_storage*)); -extern void proto_clr_stats P((void)); +extern void clear (struct peer *); +extern void clock_filter (struct peer *, double, double, double); +extern void init_proto (void); +extern void proto_config (int, u_long, double, struct sockaddr_storage*); +extern void proto_clr_stats (void); #ifdef REFCLOCK /* ntp_refclock.c */ -extern int refclock_newpeer P((struct peer *)); -extern void refclock_unpeer P((struct peer *)); -extern void refclock_receive P((struct peer *)); -extern void refclock_transmit P((struct peer *)); -extern void init_refclock P((void)); +extern int refclock_newpeer (struct peer *); +extern void refclock_unpeer (struct peer *); +extern void refclock_receive (struct peer *); +extern void refclock_transmit (struct peer *); +extern void init_refclock (void); #endif /* REFCLOCK */ /* ntp_request.c */ -extern void init_request P((void)); -extern void process_private P((struct recvbuf *, int)); +extern void init_request (void); +extern void process_private (struct recvbuf *, int); /* ntp_restrict.c */ -extern void init_restrict P((void)); -extern int restrictions P((struct sockaddr_storage *, int)); -extern void hack_restrict P((int, struct sockaddr_storage *, struct sockaddr_storage *, int, int)); +extern void init_restrict (void); +extern int restrictions (struct sockaddr_storage *, int); +extern void hack_restrict (int, struct sockaddr_storage *, struct sockaddr_storage *, int, int); /* ntp_timer.c */ -extern void init_timer P((void)); -extern void reinit_timer P((void)); -extern void timer P((void)); -extern void timer_clr_stats P((void)); -extern void timer_interfacetimeout P((u_long)); +extern void init_timer (void); +extern void reinit_timer (void); +extern void timer (void); +extern void timer_clr_stats (void); +extern void timer_interfacetimeout (u_long); extern volatile int interface_interval; #ifdef OPENSSL @@ -230,19 +230,19 @@ extern l_fp sys_revoketime; #endif /* OPENSSL */ /* ntp_util.c */ -extern void init_util P((void)); -extern void write_stats P((void)); -extern void stats_config P((int, const char *)); -extern void record_peer_stats P((struct sockaddr_storage *, int, double, double, double, double)); -extern void record_loop_stats P((double, double, double, double, int)); -extern void record_clock_stats P((struct sockaddr_storage *, const char *)); -extern void record_raw_stats P((struct sockaddr_storage *, struct sockaddr_storage *, l_fp *, l_fp *, l_fp *, l_fp *)); -extern void record_sys_stats P((void)); -extern void record_crypto_stats P((struct sockaddr_storage *, const char *)); +extern void init_util (void); +extern void write_stats (void); +extern void stats_config (int, const char *); +extern void record_peer_stats (struct sockaddr_storage *, int, double, double, double, double); +extern void record_loop_stats (double, double, double, double, int); +extern void record_clock_stats (struct sockaddr_storage *, const char *); +extern void record_raw_stats (struct sockaddr_storage *, struct sockaddr_storage *, l_fp *, l_fp *, l_fp *, l_fp *); +extern void record_sys_stats (void); +extern void record_crypto_stats (struct sockaddr_storage *, const char *); #ifdef DEBUG -extern void record_timing_stats P((const char *)); +extern void record_timing_stats (const char *); #endif -extern int sock_hash P((struct sockaddr_storage *)); +extern int sock_hash (struct sockaddr_storage *); extern double old_drift; /* diff --git a/include/ntpsim.h b/include/ntpsim.h index c48dc59542..cf78e32b68 100644 --- a/include/ntpsim.h +++ b/include/ntpsim.h @@ -67,22 +67,22 @@ typedef struct nde { /* * Function prototypes */ -int ntpsim P((int argc, char *argv[])); -Event event P((double, funcTkn)); -Queue queue P((Event, Queue )); -Node node P((void)); -void push P((Event, Queue *)); -Event pop P((Queue *)); -void ndbeep P((Node *, Event)); -void ndeclk P((Node *, Event)); -void ntptmr P((Node *, Event)); -void netpkt P((Node *, Event)); -int srvr_rply P((Node *, struct sockaddr_storage *, - struct interface *, struct pkt *)); -double gauss P((double, double)); -double poisson P((double, double)); -int node_clock P((Node *, double)); -void abortsim P((char *)); +int ntpsim (int argc, char *argv[]); +Event event (double, funcTkn); +Queue queue (Event, Queue ); +Node node (void); +void push (Event, Queue *); +Event pop (Queue *); +void ndbeep (Node *, Event); +void ndeclk (Node *, Event); +void ntptmr (Node *, Event); +void netpkt (Node *, Event); +int srvr_rply (Node *, struct sockaddr_storage *, + struct interface *, struct pkt *); +double gauss (double, double); +double poisson (double, double); +int node_clock (Node *, double); +void abortsim (char *); /* * The global Node diff --git a/include/parse.h b/include/parse.h index f10d4bea18..495fa8ed50 100644 --- a/include/parse.h +++ b/include/parse.h @@ -58,11 +58,11 @@ #endif #ifdef PARSEKERNEL #ifndef _KERNEL -extern caddr_t kmem_alloc P((unsigned int)); -extern caddr_t kmem_free P((caddr_t, unsigned int)); -extern unsigned int splx P((unsigned int)); -extern unsigned int splhigh P((void)); -extern unsigned int splclock P((void)); +extern caddr_t kmem_alloc (unsigned int); +extern caddr_t kmem_free (caddr_t, unsigned int); +extern unsigned int splx (unsigned int); +extern unsigned int splhigh (void); +extern unsigned int splclock (void); #define MALLOC(_X_) (char *)kmem_alloc(_X_) #define FREE(_X_, _Y_) kmem_free((caddr_t)_X_, _Y_) #else @@ -340,12 +340,12 @@ typedef struct clocktime clocktime_t; struct clockformat { /* special input protocol - implies fixed format */ - u_long (*input) P((parse_t *, unsigned int, timestamp_t *)); + u_long (*input) (parse_t *, unsigned int, timestamp_t *); /* conversion routine */ - u_long (*convert) P((unsigned char *, int, struct format *, clocktime_t *, void *)); + u_long (*convert) (unsigned char *, int, struct format *, clocktime_t *, void *); /* routine for handling RS232 sync events (time stamps) */ /* PPS input routine */ - u_long (*syncpps) P((parse_t *, int, timestamp_t *)); + u_long (*syncpps) (parse_t *, int, timestamp_t *); /* time code synthesizer */ void *data; /* local parameters */ @@ -359,30 +359,30 @@ typedef struct clockformat clockformat_t; /* * parse interface */ -extern int parse_ioinit P((parse_t *)); -extern void parse_ioend P((parse_t *)); -extern int parse_ioread P((parse_t *, unsigned int, timestamp_t *)); -extern int parse_iopps P((parse_t *, int, timestamp_t *)); -extern void parse_iodone P((parse_t *)); -extern int parse_timecode P((parsectl_t *, parse_t *)); -extern int parse_getfmt P((parsectl_t *, parse_t *)); -extern int parse_setfmt P((parsectl_t *, parse_t *)); -extern int parse_setcs P((parsectl_t *, parse_t *)); - -extern unsigned int parse_restart P((parse_t *, unsigned int)); -extern unsigned int parse_addchar P((parse_t *, unsigned int)); -extern unsigned int parse_end P((parse_t *)); - -extern int Strok P((const unsigned char *, const unsigned char *)); -extern int Stoi P((const unsigned char *, long *, int)); - -extern time_t parse_to_unixtime P((clocktime_t *, u_long *)); -extern u_long updatetimeinfo P((parse_t *, u_long)); -extern void syn_simple P((parse_t *, timestamp_t *, struct format *, u_long)); -extern u_long pps_simple P((parse_t *, int, timestamp_t *)); -extern u_long pps_one P((parse_t *, int, timestamp_t *)); -extern u_long pps_zero P((parse_t *, int, timestamp_t *)); -extern int parse_timedout P((parse_t *, timestamp_t *, struct timeval *)); +extern int parse_ioinit (parse_t *); +extern void parse_ioend (parse_t *); +extern int parse_ioread (parse_t *, unsigned int, timestamp_t *); +extern int parse_iopps (parse_t *, int, timestamp_t *); +extern void parse_iodone (parse_t *); +extern int parse_timecode (parsectl_t *, parse_t *); +extern int parse_getfmt (parsectl_t *, parse_t *); +extern int parse_setfmt (parsectl_t *, parse_t *); +extern int parse_setcs (parsectl_t *, parse_t *); + +extern unsigned int parse_restart (parse_t *, unsigned int); +extern unsigned int parse_addchar (parse_t *, unsigned int); +extern unsigned int parse_end (parse_t *); + +extern int Strok (const unsigned char *, const unsigned char *); +extern int Stoi (const unsigned char *, long *, int); + +extern time_t parse_to_unixtime (clocktime_t *, u_long *); +extern u_long updatetimeinfo (parse_t *, u_long); +extern void syn_simple (parse_t *, timestamp_t *, struct format *, u_long); +extern u_long pps_simple (parse_t *, int, timestamp_t *); +extern u_long pps_one (parse_t *, int, timestamp_t *); +extern u_long pps_zero (parse_t *, int, timestamp_t *); +extern int parse_timedout (parse_t *, timestamp_t *, struct timeval *); #endif diff --git a/include/recvbuff.h b/include/recvbuff.h index 1df7b371d7..3dc8f9a489 100644 --- a/include/recvbuff.h +++ b/include/recvbuff.h @@ -29,7 +29,7 @@ /* Return the event which is set when items are added to the full list */ -extern HANDLE get_recv_buff_event P((void)); +extern HANDLE get_recv_buff_event (void); #else # define RECV_BLOCK_IO() # define RECV_UNBLOCK_IO() @@ -70,7 +70,7 @@ struct recvbuf { SOCKET fd; /* fd on which it was received */ int msg_flags; /* Flags received about the packet */ l_fp recv_time; /* time of arrival */ - void (*receiver) P((struct recvbuf *)); /* routine to receive buffer */ + void (*receiver) (struct recvbuf *); /* routine to receive buffer */ int recv_length; /* number of octets received */ union { struct pkt X_recv_pkt; @@ -80,11 +80,11 @@ struct recvbuf { #define recv_buffer recv_space.X_recv_buffer }; -extern void init_recvbuff P((int)); +extern void init_recvbuff (int); /* freerecvbuf - make a single recvbuf available for reuse */ -extern void freerecvbuf P((struct recvbuf *)); +extern void freerecvbuf (struct recvbuf *); /* Get a free buffer (typically used so an async * read can directly place data into the buffer @@ -92,29 +92,29 @@ extern void freerecvbuf P((struct recvbuf *)); * The buffer is removed from the free list. Make sure * you put it back with freerecvbuf() or */ -extern struct recvbuf *get_free_recv_buffer P((void)); +extern struct recvbuf *get_free_recv_buffer (void); /* Add a buffer to the full list */ -extern void add_full_recv_buffer P((struct recvbuf *)); +extern void add_full_recv_buffer (struct recvbuf *); -/*extern void process_recv_buffers P((void)); */ +/*extern void process_recv_buffers (void); */ /* number of recvbufs on freelist */ -extern u_long free_recvbuffs P((void)); -extern u_long full_recvbuffs P((void)); -extern u_long total_recvbuffs P((void)); -extern u_long lowater_additions P((void)); +extern u_long free_recvbuffs (void); +extern u_long full_recvbuffs (void); +extern u_long total_recvbuffs (void); +extern u_long lowater_additions (void); /* Returns the next buffer in the full list. * */ -extern struct recvbuf *get_full_recv_buffer P((void)); +extern struct recvbuf *get_full_recv_buffer (void); /* * Checks to see if there are buffers to process */ -extern isc_boolean_t has_full_recv_buffer P((void)); +extern isc_boolean_t has_full_recv_buffer (void); #endif /* defined __recvbuff_h */ diff --git a/include/trimble.h b/include/trimble.h index 0387639612..aaa5baa78f 100644 --- a/include/trimble.h +++ b/include/trimble.h @@ -132,7 +132,7 @@ typedef struct cmd_info extern cmd_info_t trimble_rcmds[]; extern cmd_info_t trimble_scmds[]; -extern cmd_info_t *trimble_convert P((unsigned int cmd, cmd_info_t *tbl)); +extern cmd_info_t *trimble_convert (unsigned int cmd, cmd_info_t *tbl); #endif /* diff --git a/kernel/Makefile.am b/kernel/Makefile.am index b3cfc9d6d8..8508029cd5 100644 --- a/kernel/Makefile.am +++ b/kernel/Makefile.am @@ -1,5 +1,5 @@ #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies -AUTOMAKE_OPTIONS = ../util/ansi2knr +AUTOMAKE_OPTIONS = SUBDIRS = sys ETAGS_ARGS = Makefile.am EXTRA_DIST = chuinit.c clkinit.c tty_chu.c tty_chu_STREAMS.c tty_clk.c tty_clk_STREAMS.c diff --git a/kernel/sys/Makefile.am b/kernel/sys/Makefile.am index e8465d90d3..417111406a 100644 --- a/kernel/sys/Makefile.am +++ b/kernel/sys/Makefile.am @@ -1,5 +1,5 @@ #AUTOMAKE_OPTIONS = ../../util/ansi2knr no-dependencies -AUTOMAKE_OPTIONS = ../../util/ansi2knr +AUTOMAKE_OPTIONS = noinst_HEADERS = bsd_audioirig.h chudefs.h clkdefs.h i8253.h parsestreams.h \ pcl720.h ppsclock.h timex.h tpro.h tt560_api.h #EXTRA_DIST= TAGS diff --git a/libntp/Makefile.am b/libntp/Makefile.am index 932f87b106..54e95db652 100644 --- a/libntp/Makefile.am +++ b/libntp/Makefile.am @@ -1,5 +1,5 @@ #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies -AUTOMAKE_OPTIONS = ../util/ansi2knr +AUTOMAKE_OPTIONS = noinst_LIBRARIES = libntp.a @MAKE_LIBNTPSIM@ EXTRA_LIBRARIES = libntpsim.a libntp_a_SRCS = a_md5encrypt.c adjtime.c atoint.c atolfp.c atouint.c \ diff --git a/libntp/authreadkeys.c b/libntp/authreadkeys.c index 22020f3f85..8349d2f311 100644 --- a/libntp/authreadkeys.c +++ b/libntp/authreadkeys.c @@ -15,7 +15,7 @@ #define KEY_TYPE_MD5 4 /* Forwards */ -static char *nexttok P((char **)); +static char *nexttok (char **); /* * nexttok - basic internal tokenizing routine diff --git a/libntp/icom.c b/libntp/icom.c index b14a64710f..557fc06ae8 100644 --- a/libntp/icom.c +++ b/libntp/icom.c @@ -48,7 +48,7 @@ /* * Local function prototypes */ -static void doublefreq P((double, u_char *, int)); +static void doublefreq (double, u_char *, int); /* diff --git a/libntp/iosignal.c b/libntp/iosignal.c index 19a6e96b74..5859e40e0e 100644 --- a/libntp/iosignal.c +++ b/libntp/iosignal.c @@ -59,7 +59,7 @@ static int sigio_block_count = 0; */ static int sigio_handler_active = 0; # endif -extern void input_handler P((l_fp *)); +extern void input_handler (l_fp *); /* * SIGPOLL and SIGIO ROUTINES. diff --git a/libntp/msyslog.c b/libntp/msyslog.c index fe4d979e12..5f26fc4102 100644 --- a/libntp/msyslog.c +++ b/libntp/msyslog.c @@ -42,8 +42,8 @@ static char separator = '/'; extern char *progname; /* Declare the local functions */ -void addto_syslog P((int, char *)); -void format_errmsg P((char *, int, const char *, int)); +void addto_syslog (int, char *); +void format_errmsg (char *, int, const char *, int); /* diff --git a/libntp/ntp_random.c b/libntp/ntp_random.c index 700b4ee651..b6db2c0642 100644 --- a/libntp/ntp_random.c +++ b/libntp/ntp_random.c @@ -219,7 +219,7 @@ static long rand_deg = DEG_3; static long rand_sep = SEP_3; static long *end_ptr = &randtbl[DEG_3 + 1]; -static inline long good_rand P((long)); +static inline long good_rand (long); static inline long good_rand ( diff --git a/libntp/statestr.c b/libntp/statestr.c index 85552b3ab0..d76d5d7af6 100644 --- a/libntp/statestr.c +++ b/libntp/statestr.c @@ -146,8 +146,8 @@ struct codestring crypto_codes[] = { #endif /* OPENSSL */ /* Forwards */ -static const char *getcode P((int, struct codestring *)); -static const char *getevents P((int)); +static const char *getcode (int, struct codestring *); +static const char *getevents (int); /* * getcode - return string corresponding to code diff --git a/libparse/Makefile.am b/libparse/Makefile.am index c2c403637d..75d04ba862 100644 --- a/libparse/Makefile.am +++ b/libparse/Makefile.am @@ -1,5 +1,5 @@ #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies -AUTOMAKE_OPTIONS = ../util/ansi2knr +AUTOMAKE_OPTIONS = noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@ EXTRA_LIBRARIES = libparse.a libparse_kernel.a EXTRA_PROGRAMS = parsestreams parsesolaris diff --git a/libparse/clk_computime.c b/libparse/clk_computime.c index d0db6a9f24..b15f98764e 100644 --- a/libparse/clk_computime.c +++ b/libparse/clk_computime.c @@ -54,7 +54,7 @@ #include #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern void printf (const char *, ...); #endif /* @@ -88,8 +88,8 @@ static struct format computime_fmt = 0 }; -static u_long cvt_computime P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_computime P((parse_t *, unsigned int, timestamp_t *)); +static u_long cvt_computime (unsigned char *, int, struct format *, clocktime_t *, void *); +static unsigned long inp_computime (parse_t *, unsigned int, timestamp_t *); clockformat_t clock_computime = { diff --git a/libparse/clk_dcf7000.c b/libparse/clk_dcf7000.c index e481731702..1a4af6e90a 100644 --- a/libparse/clk_dcf7000.c +++ b/libparse/clk_dcf7000.c @@ -51,7 +51,7 @@ #include #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern void printf (const char *, ...); #endif static struct format dcf7000_fmt = @@ -64,8 +64,8 @@ static struct format dcf7000_fmt = (const unsigned char *)" - - - - - - - \r", 0 }; -static u_long cvt_dcf7000 P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_dcf7000 P((parse_t *, unsigned int, timestamp_t *)); +static u_long cvt_dcf7000 (unsigned char *, int, struct format *, clocktime_t *, void *); +static unsigned long inp_dcf7000 (parse_t *, unsigned int, timestamp_t *); clockformat_t clock_dcf7000 = { diff --git a/libparse/clk_hopf6021.c b/libparse/clk_hopf6021.c index 426ea48b3a..87ea464b58 100644 --- a/libparse/clk_hopf6021.c +++ b/libparse/clk_hopf6021.c @@ -34,7 +34,7 @@ #include #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern void printf (const char *, ...); #endif /* @@ -118,8 +118,8 @@ static struct format hopf6021_fmt = ('A' <= (x) && (x) <= 'F') ? (x) - 'A' + 10 : \ -1) -static unsigned long cvt_hopf6021 P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_hopf6021 P((parse_t *, unsigned int, timestamp_t *)); +static unsigned long cvt_hopf6021 (unsigned char *, int, struct format *, clocktime_t *, void *); +static unsigned long inp_hopf6021 (parse_t *, unsigned int, timestamp_t *); clockformat_t clock_hopf6021 = { diff --git a/libparse/clk_meinberg.c b/libparse/clk_meinberg.c index 90bb8865d7..bc0ac0e817 100644 --- a/libparse/clk_meinberg.c +++ b/libparse/clk_meinberg.c @@ -209,10 +209,10 @@ static struct format meinberg_fmt[] = } }; -static u_long cvt_meinberg P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static u_long cvt_mgps P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static u_long mbg_input P((parse_t *, unsigned int, timestamp_t *)); -static u_long gps_input P((parse_t *, unsigned int, timestamp_t *)); +static u_long cvt_meinberg (unsigned char *, int, struct format *, clocktime_t *, void *); +static u_long cvt_mgps (unsigned char *, int, struct format *, clocktime_t *, void *); +static u_long mbg_input (parse_t *, unsigned int, timestamp_t *); +static u_long gps_input (parse_t *, unsigned int, timestamp_t *); struct msg_buf { diff --git a/libparse/clk_rawdcf.c b/libparse/clk_rawdcf.c index 3ef36c43ea..20b3bf281b 100644 --- a/libparse/clk_rawdcf.c +++ b/libparse/clk_rawdcf.c @@ -101,9 +101,9 @@ * 59 - usually missing (minute indication), except for leap insertion */ -static u_long pps_rawdcf P((parse_t *, int, timestamp_t *)); -static u_long cvt_rawdcf P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static u_long inp_rawdcf P((parse_t *, unsigned int, timestamp_t *)); +static u_long pps_rawdcf (parse_t *, int, timestamp_t *); +static u_long cvt_rawdcf (unsigned char *, int, struct format *, clocktime_t *, void *); +static u_long inp_rawdcf (parse_t *, unsigned int, timestamp_t *); typedef struct last_tcode { time_t tcode; /* last converted time code */ diff --git a/libparse/clk_rcc8000.c b/libparse/clk_rcc8000.c index 9ce270d430..d4319728dc 100644 --- a/libparse/clk_rcc8000.c +++ b/libparse/clk_rcc8000.c @@ -30,7 +30,7 @@ #include #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern void printf (const char *, ...); #endif /* Type II Serial Output format @@ -57,8 +57,8 @@ static struct format rcc8000_fmt = 0 }; -static unsigned long cvt_rcc8000 P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_rcc8000 P((parse_t *, unsigned int, timestamp_t *)); +static unsigned long cvt_rcc8000 (unsigned char *, int, struct format *, clocktime_t *, void *); +static unsigned long inp_rcc8000 (parse_t *, unsigned int, timestamp_t *); clockformat_t clock_rcc8000 = { diff --git a/libparse/clk_schmid.c b/libparse/clk_schmid.c index 4f4820147d..37991e1585 100644 --- a/libparse/clk_schmid.c +++ b/libparse/clk_schmid.c @@ -52,7 +52,7 @@ #include #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern void printf (const char *, ...); #endif /* @@ -89,8 +89,8 @@ extern void printf P((const char *, ...)); #define WS_MEST 0x04 #define WS_LEAP 0x10 -static u_long cvt_schmid P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_schmid P((parse_t *, unsigned int, timestamp_t *)); +static u_long cvt_schmid (unsigned char *, int, struct format *, clocktime_t *, void *); +static unsigned long inp_schmid (parse_t *, unsigned int, timestamp_t *); clockformat_t clock_schmid = { diff --git a/libparse/clk_trimtaip.c b/libparse/clk_trimtaip.c index 67db471440..e86b6bf047 100644 --- a/libparse/clk_trimtaip.c +++ b/libparse/clk_trimtaip.c @@ -51,7 +51,7 @@ #include #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern void printf (const char *, ...); #endif /* 0000000000111111111122222222223333333 / char @@ -78,8 +78,8 @@ extern void printf P((const char *, ...)); 0 }; -static unsigned long cvt_trimtaip P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static unsigned long inp_trimtaip P((parse_t *, unsigned int, timestamp_t *)); +static unsigned long cvt_trimtaip (unsigned char *, int, struct format *, clocktime_t *, void *); +static unsigned long inp_trimtaip (parse_t *, unsigned int, timestamp_t *); clockformat_t clock_trimtaip = { diff --git a/libparse/clk_trimtsip.c b/libparse/clk_trimtsip.c index be97b74f07..474014830c 100644 --- a/libparse/clk_trimtsip.c +++ b/libparse/clk_trimtsip.c @@ -116,8 +116,8 @@ struct trimble #define STATUS_UNSAFE 1 /* not enough receivers for full precision */ #define STATUS_SYNC 2 /* enough information for good operation */ -static unsigned long inp_tsip P((parse_t *, unsigned int, timestamp_t *)); -static unsigned long cvt_trimtsip P((unsigned char *, int, struct format *, clocktime_t *, void *)); +static unsigned long inp_tsip (parse_t *, unsigned int, timestamp_t *); +static unsigned long cvt_trimtsip (unsigned char *, int, struct format *, clocktime_t *, void *); struct clockformat clock_trimtsip = { diff --git a/libparse/clk_varitext.c b/libparse/clk_varitext.c index 01b8719854..47b370390f 100644 --- a/libparse/clk_varitext.c +++ b/libparse/clk_varitext.c @@ -55,7 +55,7 @@ # include #else # include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern void printf (const char *, ...); #endif static const u_char VT_INITIALISED = 0x01; @@ -105,8 +105,8 @@ static struct format varitext_fmt = 0 }; -static u_long cvt_varitext P((unsigned char *, int, struct format *, clocktime_t *, void *)); -static u_long inp_varitext P((parse_t *, unsigned int, timestamp_t *)); +static u_long cvt_varitext (unsigned char *, int, struct format *, clocktime_t *, void *); +static u_long inp_varitext (parse_t *, unsigned int, timestamp_t *); struct varitext { unsigned char start_found; diff --git a/libparse/data_mbg.c b/libparse/data_mbg.c index 9b6f1aae28..991f1e90e2 100644 --- a/libparse/data_mbg.c +++ b/libparse/data_mbg.c @@ -46,8 +46,8 @@ #include "binio.h" #include "ieee754io.h" -static void get_mbg_tzname P((unsigned char **, char *)); -static void mbg_time_status_str P((char **, unsigned int, int)); +static void get_mbg_tzname (unsigned char **, char *); +static void mbg_time_status_str (char **, unsigned int, int); #if 0 /* no actual floats on Meinberg binary interface */ static offsets_t mbg_float = { 1, 0, 3, 2, 0, 0, 0, 0 }; /* byte order for meinberg floats */ diff --git a/libparse/ieee754io.c b/libparse/ieee754io.c index 27c65255ea..1c203d7bcd 100644 --- a/libparse/ieee754io.c +++ b/libparse/ieee754io.c @@ -43,9 +43,9 @@ #include "ntp_fp.h" #include "ieee754io.h" -static unsigned char get_byte P((unsigned char *, offsets_t, int *)); +static unsigned char get_byte (unsigned char *, offsets_t, int *); #ifdef __not_yet__ -static void put_byte P((unsigned char *, offsets_t, int *, unsigned char)); +static void put_byte (unsigned char *, offsets_t, int *, unsigned char); #endif #ifdef LIBDEBUG diff --git a/libparse/parse.c b/libparse/parse.c index dfbbaa6085..c33ecca9d3 100644 --- a/libparse/parse.c +++ b/libparse/parse.c @@ -68,7 +68,7 @@ static char rcsid[] = "parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_2005080 extern clockformat_t *clockformats[]; extern unsigned short nformats; -static u_long timepacket P((parse_t *)); +static u_long timepacket (parse_t *); /* * strings support usually not in kernel - duplicated, but what the heck diff --git a/libparse/parsesolaris.c b/libparse/parsesolaris.c index c023ad84aa..32ae144449 100644 --- a/libparse/parsesolaris.c +++ b/libparse/parsesolaris.c @@ -173,11 +173,11 @@ _fini( /*--------------- stream module definition ----------------------------*/ -static int parseopen P((queue_t *, dev_t *, int, int, cred_t *)); -static int parseclose P((queue_t *, int)); -static int parsewput P((queue_t *, mblk_t *)); -static int parserput P((queue_t *, mblk_t *)); -static int parsersvc P((queue_t *)); +static int parseopen (queue_t *, dev_t *, int, int, cred_t *); +static int parseclose (queue_t *, int); +static int parsewput (queue_t *, mblk_t *); +static int parserput (queue_t *, mblk_t *); +static int parsersvc (queue_t *); static struct module_info driverinfo = { @@ -244,8 +244,8 @@ int parsedebug = 0; }\ } while (0) -static int init_linemon P((queue_t *)); -static void close_linemon P((queue_t *, queue_t *)); +static int init_linemon (queue_t *); +static void close_linemon (queue_t *, queue_t *); #define M_PARSE 0x0001 #define M_NOPARSE 0x0002 @@ -767,8 +767,8 @@ parserput( return 0; } -static int init_zs_linemon P((queue_t *, queue_t *)); /* handle line monitor for "zs" driver */ -static void close_zs_linemon P((queue_t *, queue_t *)); +static int init_zs_linemon (queue_t *, queue_t *); /* handle line monitor for "zs" driver */ +static void close_zs_linemon (queue_t *, queue_t *); /*-------------------- CD isr status monitor ---------------*/ @@ -849,7 +849,7 @@ close_linemon( #include #include -static void zs_xsisr P((struct zscom *)); /* zs external status interupt handler */ +static void zs_xsisr (struct zscom *); /* zs external status interupt handler */ /* * there should be some docs telling how to get to @@ -911,7 +911,7 @@ init_zs_linemon( parsestream->parse_dqueue = q; /* remember driver */ szs->zsops = *zs->zs_ops; - szs->zsops.zsop_xsint = (void (*) P((struct zscom *)))zs_xsisr; /* place our bastard */ + szs->zsops.zsop_xsint = (void (*) (struct zscom *))zs_xsisr; /* place our bastard */ szs->oldzsops = zs->zs_ops; emergencyzs = zs->zs_ops; @@ -920,7 +920,7 @@ init_zs_linemon( * XXX: this is usually done via zsopinit() * - have yet to find a way to call that routine */ - zs->zs_xsint = (void (*) P((struct zscom *)))zs_xsisr; + zs->zs_xsint = (void (*) (struct zscom *))zs_xsisr; mutex_exit(zs->zs_excl); @@ -1117,7 +1117,7 @@ zs_xsisr( dname = q->q_qinfo->qi_minfo->mi_idname; if (!strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname)) { - register void (*zsisr) P((struct zscom *)); + register void (*zsisr) (struct zscom *); /* * back home - phew (hopping along stream queues might diff --git a/m4/hs_ulong_const.m4 b/m4/hs_ulong_const.m4 index b137cfdad0..c9aa653bc6 100644 --- a/m4/hs_ulong_const.m4 +++ b/m4/hs_ulong_const.m4 @@ -1,11 +1,3 @@ AC_DEFUN([hs_ULONG_CONST], [ AH_TEMPLATE(ULONG_CONST, [How do we create unsigned long constants?]) -AC_EGREP_CPP(Circus, - [#define ACAT(a,b)a ## b -ACAT(Cir,cus) -], AC_DEFINE([ULONG_CONST(a)], [a ## UL]), - AC_EGREP_CPP(Reiser, -[#define RCAT(a,b)a/**/b -RCAT(Rei,ser) -], AC_DEFINE([ULONG_CONST(a)], [a/**/L]), - AC_MSG_ERROR([How do we create an unsigned long constant?])))]) + AC_DEFINE([ULONG_CONST(a)], [a ## UL])]) diff --git a/m4/os_cflags.m4 b/m4/os_cflags.m4 index 35efa44b38..c6d40cdd71 100644 --- a/m4/os_cflags.m4 +++ b/m4/os_cflags.m4 @@ -1,6 +1,5 @@ dnl ###################################################################### dnl Specify additional compile options based on the OS and the compiler -dnl From Erez Zadok , http://www.am-utils.org AC_DEFUN([AMU_OS_CFLAGS], [ AC_CACHE_CHECK(additional compiler flags, @@ -44,9 +43,13 @@ case "${host_os}" in # turn on additional headers ac_cv_os_cflags="-D_XOPEN_EXTENDED_SOURCE" ;; + aix5.3* ) + # avoid circular dependencies in yp headers, and more + ac_cv_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE -D_USE_IRS -D_MSGQSUPPORT" + ;; aix* ) # avoid circular dependencies in yp headers - ac_cv_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE" + ac_cv_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE -D_USE_IRS" ;; OFF-sunos4* ) # make sure passing whole structures is handled in gcc @@ -56,9 +59,9 @@ case "${host_os}" in ;; esac ;; - sunos[[34]]* | solaris1* | solaris2.[[0-5]]* | sunos5.[[0-5]]* ) + sunos[[34]]* | solaris1* | solaris2.[[0-5]] | sunos5.[[0-5]] | solaris2.5.* | sunos5.5.* ) ac_cv_os_cflags="" ;; - solaris* | sunos* ) + solaris2* | sunos5* ) # turn on 64-bit file offset interface case "${CC}" in * ) @@ -74,7 +77,7 @@ case "${host_os}" in ;; esac ;; - darwin* | rhapsody* ) + darwin* | macosx* | rhapsody* ) ac_cv_os_cflags="-D_P1003_1B_VISIBLE" ;; * ) diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am index e755619f1d..1ccb852687 100644 --- a/ntpd/Makefile.am +++ b/ntpd/Makefile.am @@ -1,4 +1,4 @@ -AUTOMAKE_OPTIONS= ../util/ansi2knr +AUTOMAKE_OPTIONS= bindir= ${exec_prefix}/${BINSUBDIR} diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index d9bbc34b34..5180789325 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -394,29 +394,29 @@ struct netinfo_config_state { /* * Function prototypes */ -static unsigned long get_pfxmatch P((char **, struct masks *)); -static unsigned long get_match P((char *, struct masks *)); -static unsigned long get_logmask P((char *)); +static unsigned long get_pfxmatch (char **, struct masks *); +static unsigned long get_match (char *, struct masks *); +static unsigned long get_logmask (char *); #ifdef HAVE_NETINFO -static struct netinfo_config_state *get_netinfo_config P((void)); -static void free_netinfo_config P((struct netinfo_config_state *)); -static int gettokens_netinfo P((struct netinfo_config_state *, char **, int *)); +static struct netinfo_config_state *get_netinfo_config (void); +static void free_netinfo_config (struct netinfo_config_state *); +static int gettokens_netinfo (struct netinfo_config_state *, char **, int *); #endif -static int gettokens P((FILE *, char *, char **, int *)); -static int matchkey P((char *, struct keyword *, int)); +static int gettokens (FILE *, char *, char **, int *); +static int matchkey (char *, struct keyword *, int); enum gnn_type { t_UNK, /* Unknown */ t_REF, /* Refclock */ t_MSK, /* Network Mask */ }; -static int getnetnum P((const char *, struct sockaddr_storage *, int, - enum gnn_type)); -static void save_resolve P((char *, int, int, int, int, u_int, int, - keyid_t, u_char *)); -static void do_resolve_internal P((void)); -static void abort_resolve P((void)); +static int getnetnum (const char *, struct sockaddr_storage *, int, + enum gnn_type); +static void save_resolve (char *, int, int, int, int, u_int, int, + keyid_t, u_char *); +static void do_resolve_internal (void); +static void abort_resolve (void); #if !defined(VMS) && !defined(SYS_WINNT) -static RETSIGTYPE catchchild P((int)); +static RETSIGTYPE catchchild (int); #endif /* VMS */ /* diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c index 64603d37f5..58873776b3 100644 --- a/ntpd/ntp_control.c +++ b/ntpd/ntp_control.c @@ -30,7 +30,7 @@ struct ctl_proc { short control_code; /* defined request code */ u_short flags; /* flags word */ - void (*handler) P((struct recvbuf *, int)); /* handle request */ + void (*handler) (struct recvbuf *, int); /* handle request */ }; /* @@ -42,42 +42,42 @@ struct ctl_proc { /* * Request processing routines */ -static void ctl_error P((int)); +static void ctl_error (int); #ifdef REFCLOCK -static u_short ctlclkstatus P((struct refclockstat *)); +static u_short ctlclkstatus (struct refclockstat *); #endif -static void ctl_flushpkt P((int)); -static void ctl_putdata P((const char *, unsigned int, int)); -static void ctl_putstr P((const char *, const char *, - unsigned int)); -static void ctl_putdbl P((const char *, double)); -static void ctl_putuint P((const char *, u_long)); -static void ctl_puthex P((const char *, u_long)); -static void ctl_putint P((const char *, long)); -static void ctl_putts P((const char *, l_fp *)); -static void ctl_putadr P((const char *, u_int32, struct sockaddr_storage*)); -static void ctl_putid P((const char *, char *)); -static void ctl_putarray P((const char *, double *, int)); -static void ctl_putsys P((int)); -static void ctl_putpeer P((int, struct peer *)); +static void ctl_flushpkt (int); +static void ctl_putdata (const char *, unsigned int, int); +static void ctl_putstr (const char *, const char *, + unsigned int); +static void ctl_putdbl (const char *, double); +static void ctl_putuint (const char *, u_long); +static void ctl_puthex (const char *, u_long); +static void ctl_putint (const char *, long); +static void ctl_putts (const char *, l_fp *); +static void ctl_putadr (const char *, u_int32, struct sockaddr_storage*); +static void ctl_putid (const char *, char *); +static void ctl_putarray (const char *, double *, int); +static void ctl_putsys (int); +static void ctl_putpeer (int, struct peer *); #ifdef OPENSSL -static void ctl_putfs P((const char *, tstamp_t)); +static void ctl_putfs (const char *, tstamp_t); #endif #ifdef REFCLOCK -static void ctl_putclock P((int, struct refclockstat *, int)); +static void ctl_putclock (int, struct refclockstat *, int); #endif /* REFCLOCK */ -static struct ctl_var *ctl_getitem P((struct ctl_var *, char **)); -static u_long count_var P((struct ctl_var *)); -static void control_unspec P((struct recvbuf *, int)); -static void read_status P((struct recvbuf *, int)); -static void read_variables P((struct recvbuf *, int)); -static void write_variables P((struct recvbuf *, int)); -static void read_clock_status P((struct recvbuf *, int)); -static void write_clock_status P((struct recvbuf *, int)); -static void set_trap P((struct recvbuf *, int)); -static void unset_trap P((struct recvbuf *, int)); -static struct ctl_trap *ctlfindtrap P((struct sockaddr_storage *, - struct interface *)); +static struct ctl_var *ctl_getitem (struct ctl_var *, char **); +static u_long count_var (struct ctl_var *); +static void control_unspec (struct recvbuf *, int); +static void read_status (struct recvbuf *, int); +static void read_variables (struct recvbuf *, int); +static void write_variables (struct recvbuf *, int); +static void read_clock_status (struct recvbuf *, int); +static void write_clock_status (struct recvbuf *, int); +static void set_trap (struct recvbuf *, int); +static void unset_trap (struct recvbuf *, int); +static struct ctl_trap *ctlfindtrap (struct sockaddr_storage *, + struct interface *); static struct ctl_proc control_codes[] = { { CTL_OP_UNSPEC, NOAUTH, control_unspec }, diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c index 84adbdda1e..b7fa09e345 100644 --- a/ntpd/ntp_crypto.c +++ b/ntpd/ntp_crypto.c @@ -135,31 +135,31 @@ static u_int ident_scheme = 0; /* server identity scheme */ /* * Cryptotypes */ -static int crypto_verify P((struct exten *, struct value *, - struct peer *)); -static int crypto_encrypt P((struct exten *, struct value *, - keyid_t *)); -static int crypto_alice P((struct peer *, struct value *)); -static int crypto_alice2 P((struct peer *, struct value *)); -static int crypto_alice3 P((struct peer *, struct value *)); -static int crypto_bob P((struct exten *, struct value *)); -static int crypto_bob2 P((struct exten *, struct value *)); -static int crypto_bob3 P((struct exten *, struct value *)); -static int crypto_iff P((struct exten *, struct peer *)); -static int crypto_gq P((struct exten *, struct peer *)); -static int crypto_mv P((struct exten *, struct peer *)); -static u_int crypto_send P((struct exten *, struct value *)); -static tstamp_t crypto_time P((void)); -static u_long asn2ntp P((ASN1_TIME *)); -static struct cert_info *cert_parse P((u_char *, u_int, tstamp_t)); -static int cert_sign P((struct exten *, struct value *)); -static int cert_valid P((struct cert_info *, EVP_PKEY *)); -static int cert_install P((struct exten *, struct peer *)); -static void cert_free P((struct cert_info *)); -static EVP_PKEY *crypto_key P((char *, tstamp_t *)); -static int bighash P((BIGNUM *, BIGNUM *)); -static struct cert_info *crypto_cert P((char *)); -static void crypto_tai P((char *)); +static int crypto_verify (struct exten *, struct value *, + struct peer *); +static int crypto_encrypt (struct exten *, struct value *, + keyid_t *); +static int crypto_alice (struct peer *, struct value *); +static int crypto_alice2 (struct peer *, struct value *); +static int crypto_alice3 (struct peer *, struct value *); +static int crypto_bob (struct exten *, struct value *); +static int crypto_bob2 (struct exten *, struct value *); +static int crypto_bob3 (struct exten *, struct value *); +static int crypto_iff (struct exten *, struct peer *); +static int crypto_gq (struct exten *, struct peer *); +static int crypto_mv (struct exten *, struct peer *); +static u_int crypto_send (struct exten *, struct value *); +static tstamp_t crypto_time (void); +static u_long asn2ntp (ASN1_TIME *); +static struct cert_info *cert_parse (u_char *, u_int, tstamp_t); +static int cert_sign (struct exten *, struct value *); +static int cert_valid (struct cert_info *, EVP_PKEY *); +static int cert_install (struct exten *, struct peer *); +static void cert_free (struct cert_info *); +static EVP_PKEY *crypto_key (char *, tstamp_t *); +static int bighash (BIGNUM *, BIGNUM *); +static struct cert_info *crypto_cert (char *); +static void crypto_tai (char *); #ifdef SYS_WINNT int diff --git a/ntpd/ntp_filegen.c b/ntpd/ntp_filegen.c index 932d1b6f12..e5aab8aead 100644 --- a/ntpd/ntp_filegen.c +++ b/ntpd/ntp_filegen.c @@ -49,13 +49,13 @@ */ #define FGEN_AGE_SECS (24*60*60) /* life time of FILEGEN_AGE in seconds */ -static void filegen_open P((FILEGEN *, u_long)); -static int valid_fileref P((char *, char *)); +static void filegen_open (FILEGEN *, u_long); +static int valid_fileref (char *, char *); #ifdef UNUSED -static FILEGEN *filegen_unregister P((char *)); +static FILEGEN *filegen_unregister (char *); #endif /* UNUSED */ -static void filegen_init P((char *, const char *, FILEGEN *)); +static void filegen_init (char *, const char *, FILEGEN *); /* * filegen_init diff --git a/ntpd/ntp_intres.c b/ntpd/ntp_intres.c index f2aabe83e8..782df82b04 100644 --- a/ntpd/ntp_intres.c +++ b/ntpd/ntp_intres.c @@ -142,17 +142,17 @@ char *req_file; /* name of the file with configuration info */ /* end stuff to be filled in */ -static RETSIGTYPE bong P((int)); -static void checkparent P((void)); -static void removeentry P((struct conf_entry *)); -static void addentry P((char *, int, int, int, int, u_int, - int, keyid_t, char *)); -static int findhostaddr P((struct conf_entry *)); -static void openntp P((void)); -static int request P((struct conf_peer *)); -static char * nexttoken P((char **)); -static void readconf P((FILE *, char *)); -static void doconfigure P((int)); +static RETSIGTYPE bong (int); +static void checkparent (void); +static void removeentry (struct conf_entry *); +static void addentry (char *, int, int, int, int, u_int, + int, keyid_t, char *); +static int findhostaddr (struct conf_entry *); +static void openntp (void); +static int request (struct conf_peer *); +static char * nexttoken (char **); +static void readconf (FILE *, char *); +static void doconfigure (int); struct ntp_res_t_pkt { /* Tagged packet: */ void *tag; /* For the caller */ @@ -174,7 +174,7 @@ struct ntp_res_c_pkt { /* Control packet: */ }; -static void resolver_exit P((int)); +static void resolver_exit (int); /* * Call here instead of just exiting diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index fad74c7a22..33ea9e098f 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -170,28 +170,28 @@ int maxactivefd; */ static u_char sys_interphase = 0; -static struct interface *new_interface P((struct interface *)); -static void add_interface P((struct interface *)); -static void update_interfaces P((u_short, interface_receiver_t, void *)); -static void remove_interface P((struct interface *)); -static struct interface *create_interface P((u_short, struct interface *)); +static struct interface *new_interface (struct interface *); +static void add_interface (struct interface *); +static void update_interfaces (u_short, interface_receiver_t, void *); +static void remove_interface (struct interface *); +static struct interface *create_interface (u_short, struct interface *); -static int move_fd P((SOCKET)); +static int move_fd (SOCKET); /* * Multicast functions */ -static isc_boolean_t addr_ismulticast P((struct sockaddr_storage *)); +static isc_boolean_t addr_ismulticast (struct sockaddr_storage *); /* * Not all platforms support multicast */ #ifdef MCAST -static isc_boolean_t socket_multicast_enable P((struct interface *, int, struct sockaddr_storage *)); -static isc_boolean_t socket_multicast_disable P((struct interface *, struct sockaddr_storage *)); +static isc_boolean_t socket_multicast_enable (struct interface *, int, struct sockaddr_storage *); +static isc_boolean_t socket_multicast_disable (struct interface *, struct sockaddr_storage *); #endif #ifdef DEBUG -static void print_interface P((struct interface *, char *, char *)); +static void print_interface (struct interface *, char *, char *); #define DPRINT_INTERFACE(_LVL_, _ARGS_) do { if (debug >= (_LVL_)) { print_interface _ARGS_; } } while (0) #else #define DPRINT_INTERFACE(_LVL_, _ARGS_) @@ -223,21 +223,21 @@ struct asyncio_reader { ISC_LIST(struct asyncio_reader) asyncio_reader_list; -static void delete_asyncio_reader P((struct asyncio_reader *)); -static struct asyncio_reader *new_asyncio_reader P((void)); -static void add_asyncio_reader P((struct asyncio_reader *, enum desc_type)); -static void remove_asyncio_reader P((struct asyncio_reader *)); +static void delete_asyncio_reader (struct asyncio_reader *); +static struct asyncio_reader *new_asyncio_reader (void); +static void add_asyncio_reader (struct asyncio_reader *, enum desc_type); +static void remove_asyncio_reader (struct asyncio_reader *); #endif /* !defined(HAVE_IO_COMPLETION_PORT) && defined(HAS_ROUTING_SOCKET) */ -static void init_async_notifications P((void)); +static void init_async_notifications (void); -static int create_sockets P((u_short)); -static SOCKET open_socket P((struct sockaddr_storage *, int, int, struct interface *)); -static char * fdbits P((int, fd_set *)); -static void set_reuseaddr P((int)); -static isc_boolean_t socket_broadcast_enable P((struct interface *, SOCKET, struct sockaddr_storage *)); -static isc_boolean_t socket_broadcast_disable P((struct interface *, struct sockaddr_storage *)); +static int create_sockets (u_short); +static SOCKET open_socket (struct sockaddr_storage *, int, int, struct interface *); +static char * fdbits (int, fd_set *); +static void set_reuseaddr (int); +static isc_boolean_t socket_broadcast_enable (struct interface *, SOCKET, struct sockaddr_storage *); +static isc_boolean_t socket_broadcast_disable (struct interface *, struct sockaddr_storage *); ISC_LIST(vsock_t) fd_list; @@ -256,25 +256,25 @@ ISC_LIST(struct interface) inter_list; static struct interface *wildipv4 = NULL; static struct interface *wildipv6 = NULL; -static void add_fd_to_list P((SOCKET, enum desc_type)); -static void close_and_delete_fd_from_list P((SOCKET)); -static void add_addr_to_list P((struct sockaddr_storage *, struct interface *)); -static void delete_addr_from_list P((struct sockaddr_storage *)); -static struct interface *find_addr_in_list P((struct sockaddr_storage *)); -static struct interface *find_flagged_addr_in_list P((struct sockaddr_storage *, int)); -static void create_wildcards P((u_short)); -static isc_boolean_t address_okay P((isc_interface_t *)); -static void convert_isc_if P((isc_interface_t *, struct interface *, u_short)); -static struct interface *getinterface P((struct sockaddr_storage *)); -static struct interface *findlocalinterface P((struct sockaddr_storage *)); -static struct interface *findlocalcastinterface P((struct sockaddr_storage *, int)); +static void add_fd_to_list (SOCKET, enum desc_type); +static void close_and_delete_fd_from_list (SOCKET); +static void add_addr_to_list (struct sockaddr_storage *, struct interface *); +static void delete_addr_from_list (struct sockaddr_storage *); +static struct interface *find_addr_in_list (struct sockaddr_storage *); +static struct interface *find_flagged_addr_in_list (struct sockaddr_storage *, int); +static void create_wildcards (u_short); +static isc_boolean_t address_okay (isc_interface_t *); +static void convert_isc_if (isc_interface_t *, struct interface *, u_short); +static struct interface *getinterface (struct sockaddr_storage *); +static struct interface *findlocalinterface (struct sockaddr_storage *); +static struct interface *findlocalcastinterface (struct sockaddr_storage *, int); /* * Routines to read the ntp packets */ #if !defined(HAVE_IO_COMPLETION_PORT) -static inline int read_network_packet P((SOCKET, struct interface *, l_fp)); -static inline int read_refclock_packet P((SOCKET, struct refclockio *, l_fp)); +static inline int read_network_packet (SOCKET, struct interface *, l_fp); +static inline int read_refclock_packet (SOCKET, struct refclockio *, l_fp); #endif #ifdef SYS_WINNT diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index c604bd92b1..15935fbaa1 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -133,7 +133,7 @@ double clock_codec; /* audio codec frequency (sambles/s) */ u_long sys_clocktime; /* last system clock update */ u_long pps_control; /* last pps update */ u_long sys_tai; /* UTC offset from TAI (s) */ -static void rstclock P((int, u_long, double)); /* transition function */ +static void rstclock (int, u_long, double); /* transition function */ #ifdef KERNEL_PLL struct timex ntv; /* kernel API parameters */ @@ -173,7 +173,7 @@ static double sys_mindly; /* huff-n'-puff filter min delay */ #define MOD_BITS (MOD_OFFSET | MOD_MAXERROR | MOD_ESTERROR | \ MOD_STATUS | MOD_TIMECONST) #ifdef SIGSYS -static void pll_trap P((int)); /* configuration trap */ +static void pll_trap (int); /* configuration trap */ static struct sigaction sigsys; /* current sigaction status */ static struct sigaction newsigsys; /* new sigaction status */ static sigjmp_buf env; /* environment var. for pll_trap() */ diff --git a/ntpd/ntp_monitor.c b/ntpd/ntp_monitor.c index 753fa767ce..2c0ee7abf8 100644 --- a/ntpd/ntp_monitor.c +++ b/ntpd/ntp_monitor.c @@ -86,8 +86,8 @@ static int mon_mem_increments; /* times called malloc() */ int mon_enabled; /* enable switch */ u_long mon_age = 3000; /* preemption limit */ static int mon_have_memory; -static void mon_getmoremem P((void)); -static void remove_from_hash P((struct mon_data *)); +static void mon_getmoremem (void); +static void remove_from_hash (struct mon_data *); /* * init_mon - initialize monitoring global data diff --git a/ntpd/ntp_peer.c b/ntpd/ntp_peer.c index d4cbeca008..af1aa15108 100644 --- a/ntpd/ntp_peer.c +++ b/ntpd/ntp_peer.c @@ -103,8 +103,8 @@ int peer_associations; /* mobilized associations */ int peer_preempt; /* preemptable associations */ static struct peer init_peer_alloc[INIT_PEER_ALLOC]; /* init alloc */ -static void getmorepeermem P((void)); -static struct interface *select_peerinterface P((struct peer *, struct sockaddr_storage *, struct interface *, u_char)); +static void getmorepeermem (void); +static struct interface *select_peerinterface (struct peer *, struct sockaddr_storage *, struct interface *, u_char); /* * init_peer - initialize peer data structures and counters diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 0ab2498830..506ae8a770 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -104,14 +104,14 @@ u_long sys_badlength; /* bad length or format */ u_long sys_badauth; /* bad authentication */ u_long sys_limitrejected; /* rate exceeded */ -static double root_distance P((struct peer *)); -static void clock_combine P((struct peer **, int)); -static void peer_xmit P((struct peer *)); -static void fast_xmit P((struct recvbuf *, int, keyid_t, - int)); -static void clock_update P((void)); -static int default_get_precision P((void)); -static int peer_unfit P((struct peer *)); +static double root_distance (struct peer *); +static void clock_combine (struct peer **, int); +static void peer_xmit (struct peer *); +static void fast_xmit (struct recvbuf *, int, keyid_t, + int); +static void clock_update (void); +static int default_get_precision (void); +static int peer_unfit (struct peer *); /* diff --git a/ntpd/ntp_refclock.c b/ntpd/ntp_refclock.c index a29ef085e8..aa5a71dd97 100644 --- a/ntpd/ntp_refclock.c +++ b/ntpd/ntp_refclock.c @@ -86,11 +86,11 @@ static struct peer *typeunit[REFCLK_MAX + 1][MAXUNIT]; * Forward declarations */ #ifdef QSORT_USES_VOID_P -static int refclock_cmpl_fp P((const void *, const void *)); +static int refclock_cmpl_fp (const void *, const void *); #else -static int refclock_cmpl_fp P((const double *, const double *)); +static int refclock_cmpl_fp (const double *, const double *); #endif /* QSORT_USES_VOID_P */ -static int refclock_sample P((struct refclockproc *)); +static int refclock_sample (struct refclockproc *); /* diff --git a/ntpd/ntp_request.c b/ntpd/ntp_request.c index 9d03b35278..38dfccbbce 100644 --- a/ntpd/ntp_request.c +++ b/ntpd/ntp_request.c @@ -47,8 +47,8 @@ struct req_proc { short needs_auth; /* true when authentication needed */ short sizeofitem; /* size of request data item (older size)*/ short v6_sizeofitem; /* size of request data item (new size)*/ - void (*handler) P((struct sockaddr_storage *, struct interface *, - struct req_pkt *)); /* routine to handle request */ + void (*handler) (struct sockaddr_storage *, struct interface *, + struct req_pkt *); /* routine to handle request */ }; /* @@ -58,58 +58,58 @@ static struct req_proc univ_codes[] = { { NO_REQUEST, NOAUTH, 0, 0 } }; -static void req_ack P((struct sockaddr_storage *, struct interface *, struct req_pkt *, int)); -static char * prepare_pkt P((struct sockaddr_storage *, struct interface *, struct req_pkt *, u_int)); -static char * more_pkt P((void)); -static void flush_pkt P((void)); -static void peer_list P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void peer_list_sum P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void peer_info P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void peer_stats P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void sys_info P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void sys_stats P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void mem_stats P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void io_stats P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void timer_stats P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void loop_info P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void do_conf P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void do_unconf P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void set_sys_flag P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void clr_sys_flag P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void setclr_flags P((struct sockaddr_storage *, struct interface *, struct req_pkt *, u_long)); -static void list_restrict P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void do_resaddflags P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void do_ressubflags P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void do_unrestrict P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void do_restrict P((struct sockaddr_storage *, struct interface *, struct req_pkt *, int)); -static void mon_getlist_0 P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void mon_getlist_1 P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void reset_stats P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void reset_peer P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void do_key_reread P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void trust_key P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void untrust_key P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void do_trustkey P((struct sockaddr_storage *, struct interface *, struct req_pkt *, u_long)); -static void get_auth_info P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void reset_auth_stats P((void)); -static void req_get_traps P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void req_set_trap P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void req_clr_trap P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void do_setclr_trap P((struct sockaddr_storage *, struct interface *, struct req_pkt *, int)); -static void set_request_keyid P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void set_control_keyid P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void get_ctl_stats P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void get_if_stats P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void do_if_reload P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); +static void req_ack (struct sockaddr_storage *, struct interface *, struct req_pkt *, int); +static char * prepare_pkt (struct sockaddr_storage *, struct interface *, struct req_pkt *, u_int); +static char * more_pkt (void); +static void flush_pkt (void); +static void peer_list (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void peer_list_sum (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void peer_info (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void peer_stats (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void sys_info (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void sys_stats (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void mem_stats (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void io_stats (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void timer_stats (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void loop_info (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void do_conf (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void do_unconf (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void set_sys_flag (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void clr_sys_flag (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void setclr_flags (struct sockaddr_storage *, struct interface *, struct req_pkt *, u_long); +static void list_restrict (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void do_resaddflags (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void do_ressubflags (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void do_unrestrict (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void do_restrict (struct sockaddr_storage *, struct interface *, struct req_pkt *, int); +static void mon_getlist_0 (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void mon_getlist_1 (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void reset_stats (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void reset_peer (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void do_key_reread (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void trust_key (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void untrust_key (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void do_trustkey (struct sockaddr_storage *, struct interface *, struct req_pkt *, u_long); +static void get_auth_info (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void reset_auth_stats (void); +static void req_get_traps (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void req_set_trap (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void req_clr_trap (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void do_setclr_trap (struct sockaddr_storage *, struct interface *, struct req_pkt *, int); +static void set_request_keyid (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void set_control_keyid (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void get_ctl_stats (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void get_if_stats (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void do_if_reload (struct sockaddr_storage *, struct interface *, struct req_pkt *); #ifdef KERNEL_PLL -static void get_kernel_info P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); +static void get_kernel_info (struct sockaddr_storage *, struct interface *, struct req_pkt *); #endif /* KERNEL_PLL */ #ifdef REFCLOCK -static void get_clock_info P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); -static void set_clock_fudge P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); +static void get_clock_info (struct sockaddr_storage *, struct interface *, struct req_pkt *); +static void set_clock_fudge (struct sockaddr_storage *, struct interface *, struct req_pkt *); #endif /* REFCLOCK */ #ifdef REFCLOCK -static void get_clkbug_info P((struct sockaddr_storage *, struct interface *, struct req_pkt *)); +static void get_clkbug_info (struct sockaddr_storage *, struct interface *, struct req_pkt *); #endif /* REFCLOCK */ /* @@ -1985,7 +1985,7 @@ mon_getlist_1( */ struct reset_entry { int flag; /* flag this corresponds to */ - void (*handler) P((void)); /* routine to handle request */ + void (*handler) (void); /* routine to handle request */ }; struct reset_entry reset_entries[] = { diff --git a/ntpd/ntp_timer.c b/ntpd/ntp_timer.c index fb6de702ac..db34a65b92 100644 --- a/ntpd/ntp_timer.c +++ b/ntpd/ntp_timer.c @@ -79,7 +79,7 @@ static int vmsinc[2]; /* timer increment */ #if defined SYS_WINNT static HANDLE WaitableTimerHandle = NULL; #else -static RETSIGTYPE alarming P((int)); +static RETSIGTYPE alarming (int); #endif /* SYS_WINNT */ #if !defined(VMS) diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index 6b01881c06..96dd389977 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -194,27 +194,27 @@ int was_alarmed; /* * We put this here, since the argument profile is syscall-specific */ -extern int syscall P((int, ...)); +extern int syscall (int, ...); #endif /* DECL_SYSCALL */ #ifdef SIGDIE2 -static RETSIGTYPE finish P((int)); +static RETSIGTYPE finish (int); #endif /* SIGDIE2 */ #ifdef DEBUG #ifndef SYS_WINNT -static RETSIGTYPE moredebug P((int)); -static RETSIGTYPE lessdebug P((int)); +static RETSIGTYPE moredebug (int); +static RETSIGTYPE lessdebug (int); #endif #else /* not DEBUG */ -static RETSIGTYPE no_debug P((int)); +static RETSIGTYPE no_debug (int); #endif /* not DEBUG */ -int ntpdmain P((int, char **)); -static void set_process_priority P((void)); -static void init_logging P((char const *)); -static void setup_logfile P((void)); +int ntpdmain (int, char **); +static void set_process_priority (void); +static void init_logging (char const *); +static void setup_logfile (void); /* * Initialize the logging diff --git a/ntpd/refclock_acts.c b/ntpd/refclock_acts.c index 57f2ca7c7a..192f77760f 100644 --- a/ntpd/refclock_acts.c +++ b/ntpd/refclock_acts.c @@ -210,15 +210,15 @@ struct actsunit { /* * Function prototypes */ -static int acts_start P((int, struct peer *)); -static void acts_shutdown P((int, struct peer *)); -static void acts_receive P((struct recvbuf *)); -static void acts_message P((struct peer *)); -static void acts_timecode P((struct peer *, char *)); -static void acts_poll P((int, struct peer *)); -static void acts_timeout P((struct peer *)); -static void acts_disc P((struct peer *)); -static void acts_timer P((int, struct peer *)); +static int acts_start (int, struct peer *); +static void acts_shutdown (int, struct peer *); +static void acts_receive (struct recvbuf *); +static void acts_message (struct peer *); +static void acts_timecode (struct peer *, char *); +static void acts_poll (int, struct peer *); +static void acts_timeout (struct peer *); +static void acts_disc (struct peer *); +static void acts_timer (int, struct peer *); /* * Transfer vector (conditional structure name) diff --git a/ntpd/refclock_arbiter.c b/ntpd/refclock_arbiter.c index 88a32250df..f360d37fca 100644 --- a/ntpd/refclock_arbiter.c +++ b/ntpd/refclock_arbiter.c @@ -111,10 +111,10 @@ struct arbunit { /* * Function prototypes */ -static int arb_start P((int, struct peer *)); -static void arb_shutdown P((int, struct peer *)); -static void arb_receive P((struct recvbuf *)); -static void arb_poll P((int, struct peer *)); +static int arb_start (int, struct peer *); +static void arb_shutdown (int, struct peer *); +static void arb_receive (struct recvbuf *); +static void arb_poll (int, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_arc.c b/ntpd/refclock_arc.c index af80621926..d996ada570 100644 --- a/ntpd/refclock_arc.c +++ b/ntpd/refclock_arc.c @@ -527,8 +527,8 @@ static int possible_leap = 0; /* No resync required by default. */ #endif #if 0 -static void dummy_event_handler P((struct peer *)); -static void arc_event_handler P((struct peer *)); +static void dummy_event_handler (struct peer *); +static void arc_event_handler (struct peer *); #endif /* 0 */ #define QUALITY_UNKNOWN -1 /* Indicates unknown clock quality. */ @@ -539,10 +539,10 @@ static void arc_event_handler P((struct peer *)); /* * Function prototypes */ -static int arc_start P((int, struct peer *)); -static void arc_shutdown P((int, struct peer *)); -static void arc_receive P((struct recvbuf *)); -static void arc_poll P((int, struct peer *)); +static int arc_start (int, struct peer *); +static void arc_shutdown (int, struct peer *); +static void arc_receive (struct recvbuf *); +static void arc_poll (int, struct peer *); /* * Transfer vector @@ -1436,7 +1436,7 @@ arc_receive( /* request_time() sends a time request to the clock with given peer. */ /* This automatically reports a fault if necessary. */ /* No data should be sent after this until arc_poll() returns. */ -static void request_time P((int, struct peer *)); +static void request_time (int, struct peer *); static void request_time( int unit, diff --git a/ntpd/refclock_as2201.c b/ntpd/refclock_as2201.c index f04d417bea..a48d653195 100644 --- a/ntpd/refclock_as2201.c +++ b/ntpd/refclock_as2201.c @@ -129,10 +129,10 @@ static char stat_command[][30] = { /* * Function prototypes */ -static int as2201_start P((int, struct peer *)); -static void as2201_shutdown P((int, struct peer *)); -static void as2201_receive P((struct recvbuf *)); -static void as2201_poll P((int, struct peer *)); +static int as2201_start (int, struct peer *); +static void as2201_shutdown (int, struct peer *); +static void as2201_receive (struct recvbuf *); +static void as2201_poll (int, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_atom.c b/ntpd/refclock_atom.c index 2e469ecd40..78907dd7e6 100644 --- a/ntpd/refclock_atom.c +++ b/ntpd/refclock_atom.c @@ -105,14 +105,14 @@ struct ppsunit { /* * Function prototypes */ -static int atom_start P((int, struct peer *)); -static void atom_poll P((int, struct peer *)); -static void atom_shutdown P((int, struct peer *)); +static int atom_start (int, struct peer *); +static void atom_poll (int, struct peer *); +static void atom_shutdown (int, struct peer *); #ifdef HAVE_PPSAPI -static void atom_control P((int, struct refclockstat *, struct - refclockstat *, struct peer *)); -static void atom_timer P((int, struct peer *)); -static int atom_ppsapi P((struct peer *, int)); +static void atom_control (int, struct refclockstat *, struct + refclockstat *, struct peer *); +static void atom_timer (int, struct peer *); +static int atom_ppsapi (struct peer *, int); #endif /* HAVE_PPSAPI */ /* diff --git a/ntpd/refclock_chronolog.c b/ntpd/refclock_chronolog.c index a1d131ec03..245f68fadf 100644 --- a/ntpd/refclock_chronolog.c +++ b/ntpd/refclock_chronolog.c @@ -67,10 +67,10 @@ struct chronolog_unit { /* * Function prototypes */ -static int chronolog_start P((int, struct peer *)); -static void chronolog_shutdown P((int, struct peer *)); -static void chronolog_receive P((struct recvbuf *)); -static void chronolog_poll P((int, struct peer *)); +static int chronolog_start (int, struct peer *); +static void chronolog_shutdown (int, struct peer *); +static void chronolog_receive (struct recvbuf *); +static void chronolog_poll (int, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_chu.c b/ntpd/refclock_chu.c index 843e9aaa40..5cc5730a9b 100644 --- a/ntpd/refclock_chu.c +++ b/ntpd/refclock_chu.c @@ -373,31 +373,31 @@ struct chuunit { /* * Function prototypes */ -static int chu_start P((int, struct peer *)); -static void chu_shutdown P((int, struct peer *)); -static void chu_receive P((struct recvbuf *)); -static void chu_poll P((int, struct peer *)); +static int chu_start (int, struct peer *); +static void chu_shutdown (int, struct peer *); +static void chu_receive (struct recvbuf *); +static void chu_poll (int, struct peer *); /* * More function prototypes */ -static void chu_decode P((struct peer *, int)); -static void chu_burst P((struct peer *)); -static void chu_clear P((struct peer *)); -static void chu_a P((struct peer *, int)); -static void chu_b P((struct peer *, int)); -static int chu_dist P((int, int)); -static double chu_major P((struct peer *)); +static void chu_decode (struct peer *, int); +static void chu_burst (struct peer *); +static void chu_clear (struct peer *); +static void chu_a (struct peer *, int); +static void chu_b (struct peer *, int); +static int chu_dist (int, int); +static double chu_major (struct peer *); #ifdef HAVE_AUDIO -static void chu_uart P((struct surv *, double)); -static void chu_rf P((struct peer *, double)); -static void chu_gain P((struct peer *)); -static void chu_audio_receive P((struct recvbuf *rbufp)); +static void chu_uart (struct surv *, double); +static void chu_rf (struct peer *, double); +static void chu_gain (struct peer *); +static void chu_audio_receive (struct recvbuf *rbufp); #endif /* HAVE_AUDIO */ #ifdef ICOM -static int chu_newchan P((struct peer *, double)); +static int chu_newchan (struct peer *, double); #endif /* ICOM */ -static void chu_serial_receive P((struct recvbuf *rbufp)); +static void chu_serial_receive (struct recvbuf *rbufp); /* * Global variables diff --git a/ntpd/refclock_datum.c b/ntpd/refclock_datum.c index b26fe73cfc..2111910821 100644 --- a/ntpd/refclock_datum.c +++ b/ntpd/refclock_datum.c @@ -173,13 +173,13 @@ static struct datum_pts_unit ** Callback function prototypes that ntpd needs to know about. */ -static int datum_pts_start P((int, struct peer *)); -static void datum_pts_shutdown P((int, struct peer *)); -static void datum_pts_poll P((int, struct peer *)); -static void datum_pts_control P((int, struct refclockstat *, - struct refclockstat *, struct peer *)); -static void datum_pts_init P((void)); -static void datum_pts_buginfo P((int, struct refclockbug *, struct peer *)); +static int datum_pts_start (int, struct peer *); +static void datum_pts_shutdown (int, struct peer *); +static void datum_pts_poll (int, struct peer *); +static void datum_pts_control (int, struct refclockstat *, + struct refclockstat *, struct peer *); +static void datum_pts_init (void); +static void datum_pts_buginfo (int, struct refclockbug *, struct peer *); /* ** This is the call back function structure that ntpd actually uses for @@ -219,7 +219,7 @@ struct refclock refclock_datum = { ** the adjtime() call. */ -static void datum_pts_receive P((struct recvbuf *)); +static void datum_pts_receive (struct recvbuf *); /*......................................................................*/ /* datum_pts_start - start up the datum PTS. This means open the */ diff --git a/ntpd/refclock_dumbclock.c b/ntpd/refclock_dumbclock.c index 2788649ac3..95bb81dc96 100644 --- a/ntpd/refclock_dumbclock.c +++ b/ntpd/refclock_dumbclock.c @@ -73,11 +73,11 @@ struct dumbclock_unit { /* * Function prototypes */ -static int dumbclock_start P((int, struct peer *)); -static void dumbclock_shutdown P((int, struct peer *)); -static void dumbclock_receive P((struct recvbuf *)); +static int dumbclock_start (int, struct peer *); +static void dumbclock_shutdown (int, struct peer *); +static void dumbclock_receive (struct recvbuf *); #if 0 -static void dumbclock_poll P((int, struct peer *)); +static void dumbclock_poll (int, struct peer *); #endif /* diff --git a/ntpd/refclock_fg.c b/ntpd/refclock_fg.c index ce5085a757..5f2ca4b666 100644 --- a/ntpd/refclock_fg.c +++ b/ntpd/refclock_fg.c @@ -33,11 +33,11 @@ /* * Function prototypes */ -static int fg_init P((int)); -static int fg_start P((int, struct peer *)); -static void fg_shutdown P((int, struct peer *)); -static void fg_poll P((int, struct peer *)); -static void fg_receive P((struct recvbuf *)); +static int fg_init (int); +static int fg_start (int, struct peer *); +static void fg_shutdown (int, struct peer *); +static void fg_poll (int, struct peer *); +static void fg_receive (struct recvbuf *); /* * Forum Graphic unit control structure diff --git a/ntpd/refclock_heath.c b/ntpd/refclock_heath.c index a56b491b41..f9b2b3e646 100644 --- a/ntpd/refclock_heath.c +++ b/ntpd/refclock_heath.c @@ -186,10 +186,10 @@ static int speed[] = {B1200, B2400, B4800, B9600}; /* * Function prototypes */ -static int heath_start P((int, struct peer *)); -static void heath_shutdown P((int, struct peer *)); -static void heath_receive P((struct recvbuf *)); -static void heath_poll P((int, struct peer *)); +static int heath_start (int, struct peer *); +static void heath_shutdown (int, struct peer *); +static void heath_receive (struct recvbuf *); +static void heath_poll (int, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_hopfser.c b/ntpd/refclock_hopfser.c index 94b660be23..3385a83196 100644 --- a/ntpd/refclock_hopfser.c +++ b/ntpd/refclock_hopfser.c @@ -94,11 +94,11 @@ struct hopfclock_unit { * Function prototypes */ -static int hopfserial_start P((int, struct peer *)); -static void hopfserial_shutdown P((int, struct peer *)); -static void hopfserial_receive P((struct recvbuf *)); -static void hopfserial_poll P((int, struct peer *)); -/* static void hopfserial_io P((struct recvbuf *)); */ +static int hopfserial_start (int, struct peer *); +static void hopfserial_shutdown (int, struct peer *); +static void hopfserial_receive (struct recvbuf *); +static void hopfserial_poll (int, struct peer *); +/* static void hopfserial_io (struct recvbuf *); */ /* * Transfer vector */ diff --git a/ntpd/refclock_hpgps.c b/ntpd/refclock_hpgps.c index 5efd19eaa2..f125a425a0 100644 --- a/ntpd/refclock_hpgps.c +++ b/ntpd/refclock_hpgps.c @@ -125,10 +125,10 @@ struct hpgpsunit { /* * Function prototypes */ -static int hpgps_start P((int, struct peer *)); -static void hpgps_shutdown P((int, struct peer *)); -static void hpgps_receive P((struct recvbuf *)); -static void hpgps_poll P((int, struct peer *)); +static int hpgps_start (int, struct peer *); +static void hpgps_shutdown (int, struct peer *); +static void hpgps_receive (struct recvbuf *); +static void hpgps_poll (int, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_irig.c b/ntpd/refclock_irig.c index 9660df6e5a..128a450699 100644 --- a/ntpd/refclock_irig.c +++ b/ntpd/refclock_irig.c @@ -266,18 +266,18 @@ struct irigunit { /* * Function prototypes */ -static int irig_start P((int, struct peer *)); -static void irig_shutdown P((int, struct peer *)); -static void irig_receive P((struct recvbuf *)); -static void irig_poll P((int, struct peer *)); +static int irig_start (int, struct peer *); +static void irig_shutdown (int, struct peer *); +static void irig_receive (struct recvbuf *); +static void irig_poll (int, struct peer *); /* * More function prototypes */ -static void irig_base P((struct peer *, double)); -static void irig_rf P((struct peer *, double)); -static void irig_decode P((struct peer *, int)); -static void irig_gain P((struct peer *)); +static void irig_base (struct peer *, double); +static void irig_rf (struct peer *, double); +static void irig_decode (struct peer *, int); +static void irig_gain (struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_jjy.c b/ntpd/refclock_jjy.c index 9d1419a6f6..82c98124f2 100644 --- a/ntpd/refclock_jjy.c +++ b/ntpd/refclock_jjy.c @@ -168,16 +168,16 @@ struct jjyunit { /* * Function prototypes */ -static int jjy_start P((int, struct peer *)); -static void jjy_shutdown P((int, struct peer *)); -static void jjy_poll P((int, struct peer *)); -static void jjy_poll_tristate_jjy01 P((int, struct peer *)); -static void jjy_poll_cdex_jst2000 P((int, struct peer *)); -static void jjy_poll_echokeisokuki_lt2000 P((int, struct peer *)); -static void jjy_receive P((struct recvbuf *)); -static int jjy_receive_tristate_jjy01 P((struct recvbuf *)); -static int jjy_receive_cdex_jst2000 P((struct recvbuf *)); -static int jjy_receive_echokeisokuki_lt2000 P((struct recvbuf *)); +static int jjy_start (int, struct peer *); +static void jjy_shutdown (int, struct peer *); +static void jjy_poll (int, struct peer *); +static void jjy_poll_tristate_jjy01 (int, struct peer *); +static void jjy_poll_cdex_jst2000 (int, struct peer *); +static void jjy_poll_echokeisokuki_lt2000 (int, struct peer *); +static void jjy_receive (struct recvbuf *); +static int jjy_receive_tristate_jjy01 (struct recvbuf *); +static int jjy_receive_cdex_jst2000 (struct recvbuf *); +static int jjy_receive_echokeisokuki_lt2000 (struct recvbuf *); /* * Transfer vector diff --git a/ntpd/refclock_jupiter.c b/ntpd/refclock_jupiter.c index c10d9fa0df..583e31bc01 100644 --- a/ntpd/refclock_jupiter.c +++ b/ntpd/refclock_jupiter.c @@ -135,28 +135,28 @@ struct instance { /* * Function prototypes */ -static void jupiter_canmsg P((struct instance *, u_int)); -static u_short jupiter_cksum P((u_short *, u_int)); -static int jupiter_config P((struct instance *)); -static void jupiter_debug P((struct peer *, char *, char *, ...)) +static void jupiter_canmsg (struct instance *, u_int); +static u_short jupiter_cksum (u_short *, u_int); +static int jupiter_config (struct instance *); +static void jupiter_debug (struct peer *, char *, char *, ...) __attribute__ ((format (printf, 3, 4))); -static char * jupiter_parse_t P((struct instance *, u_short *)); -static char * jupiter_parse_gpos P((struct instance *, u_short *)); -static void jupiter_platform P((struct instance *, u_int)); -static void jupiter_poll P((int, struct peer *)); -static void jupiter_control P((int, struct refclockstat *, struct - refclockstat *, struct peer *)); +static char * jupiter_parse_t (struct instance *, u_short *); +static char * jupiter_parse_gpos (struct instance *, u_short *); +static void jupiter_platform (struct instance *, u_int); +static void jupiter_poll (int, struct peer *); +static void jupiter_control (int, struct refclockstat *, struct + refclockstat *, struct peer *); #ifdef HAVE_PPSAPI -static int jupiter_ppsapi P((struct instance *)); -static int jupiter_pps P((struct instance *)); +static int jupiter_ppsapi (struct instance *); +static int jupiter_pps (struct instance *); #endif /* HAVE_PPSAPI */ -static int jupiter_recv P((struct instance *)); -static void jupiter_receive P((struct recvbuf *rbufp)); -static void jupiter_reqmsg P((struct instance *, u_int, u_int)); -static void jupiter_reqonemsg P((struct instance *, u_int)); -static char * jupiter_send P((struct instance *, struct jheader *)); -static void jupiter_shutdown P((int, struct peer *)); -static int jupiter_start P((int, struct peer *)); +static int jupiter_recv (struct instance *); +static void jupiter_receive (struct recvbuf *rbufp); +static void jupiter_reqmsg (struct instance *, u_int, u_int); +static void jupiter_reqonemsg (struct instance *, u_int); +static char * jupiter_send (struct instance *, struct jheader *); +static void jupiter_shutdown (int, struct peer *); +static int jupiter_start (int, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_leitch.c b/ntpd/refclock_leitch.c index e1ba0c4095..908c724188 100644 --- a/ntpd/refclock_leitch.c +++ b/ntpd/refclock_leitch.c @@ -96,20 +96,20 @@ struct leitchunit { /* * Function prototypes */ -static void leitch_init P((void)); -static int leitch_start P((int, struct peer *)); -static void leitch_shutdown P((int, struct peer *)); -static void leitch_poll P((int, struct peer *)); -static void leitch_control P((int, struct refclockstat *, struct refclockstat *, struct peer *)); +static void leitch_init (void); +static int leitch_start (int, struct peer *); +static void leitch_shutdown (int, struct peer *); +static void leitch_poll (int, struct peer *); +static void leitch_control (int, struct refclockstat *, struct refclockstat *, struct peer *); #define leitch_buginfo noentry -static void leitch_receive P((struct recvbuf *)); -static void leitch_process P((struct leitchunit *)); +static void leitch_receive (struct recvbuf *); +static void leitch_process (struct leitchunit *); #if 0 -static void leitch_timeout P((struct peer *)); +static void leitch_timeout (struct peer *); #endif -static int leitch_get_date P((struct recvbuf *, struct leitchunit *)); -static int leitch_get_time P((struct recvbuf *, struct leitchunit *, int)); -static int days_per_year P((int)); +static int leitch_get_date (struct recvbuf *, struct leitchunit *); +static int leitch_get_time (struct recvbuf *, struct leitchunit *, int); +static int days_per_year (int); static struct leitchunit leitchunits[MAXUNITS]; static u_char unitinuse[MAXUNITS]; diff --git a/ntpd/refclock_local.c b/ntpd/refclock_local.c index dc6f1aefda..df5d038f45 100644 --- a/ntpd/refclock_local.c +++ b/ntpd/refclock_local.c @@ -119,8 +119,8 @@ extern int ext_enable; /* external clock enable */ /* * Function prototypes */ -static int local_start P((int, struct peer *)); -static void local_poll P((int, struct peer *)); +static int local_start (int, struct peer *); +static void local_poll (int, struct peer *); /* * Local variables diff --git a/ntpd/refclock_mx4200.c b/ntpd/refclock_mx4200.c index 68150b7c42..d65187c44d 100644 --- a/ntpd/refclock_mx4200.c +++ b/ntpd/refclock_mx4200.c @@ -167,28 +167,28 @@ static char pmvxg[] = "PMVXG"; /* * Function prototypes */ -static int mx4200_start P((int, struct peer *)); -static void mx4200_shutdown P((int, struct peer *)); -static void mx4200_receive P((struct recvbuf *)); -static void mx4200_poll P((int, struct peer *)); - -static char * mx4200_parse_t P((struct peer *)); -static char * mx4200_parse_p P((struct peer *)); -static char * mx4200_parse_s P((struct peer *)); +static int mx4200_start (int, struct peer *); +static void mx4200_shutdown (int, struct peer *); +static void mx4200_receive (struct recvbuf *); +static void mx4200_poll (int, struct peer *); + +static char * mx4200_parse_t (struct peer *); +static char * mx4200_parse_p (struct peer *); +static char * mx4200_parse_s (struct peer *); #ifdef QSORT_USES_VOID_P -int mx4200_cmpl_fp P((const void *, const void *)); +int mx4200_cmpl_fp (const void *, const void *); #else -int mx4200_cmpl_fp P((const l_fp *, const l_fp *)); +int mx4200_cmpl_fp (const l_fp *, const l_fp *); #endif /* not QSORT_USES_VOID_P */ -static int mx4200_config P((struct peer *)); -static void mx4200_ref P((struct peer *)); -static void mx4200_send P((struct peer *, char *, ...)) +static int mx4200_config (struct peer *); +static void mx4200_ref (struct peer *); +static void mx4200_send (struct peer *, char *, ...) __attribute__ ((format (printf, 2, 3))); -static u_char mx4200_cksum P((char *, int)); -static int mx4200_jday P((int, int, int)); -static void mx4200_debug P((struct peer *, char *, ...)) +static u_char mx4200_cksum (char *, int); +static int mx4200_jday (int, int, int); +static void mx4200_debug (struct peer *, char *, ...) __attribute__ ((format (printf, 2, 3))); -static int mx4200_pps P((struct peer *)); +static int mx4200_pps (struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_neoclock4x.c b/ntpd/refclock_neoclock4x.c index 374c81aeac..f13e50f160 100644 --- a/ntpd/refclock_neoclock4x.c +++ b/ntpd/refclock_neoclock4x.c @@ -138,20 +138,20 @@ struct neoclock4x_unit { int utc_msec; }; -static int neoclock4x_start P((int, struct peer *)); -static void neoclock4x_shutdown P((int, struct peer *)); -static void neoclock4x_receive P((struct recvbuf *)); -static void neoclock4x_poll P((int, struct peer *)); -static void neoclock4x_control P((int, struct refclockstat *, struct refclockstat *, struct peer *)); - -static int neol_atoi_len P((const char str[], int *, int)); -static int neol_hexatoi_len P((const char str[], int *, int)); -static void neol_jdn_to_ymd P((unsigned long, int *, int *, int *)); -static void neol_localtime P((unsigned long, int* , int*, int*, int*, int*, int*)); -static unsigned long neol_mktime P((int, int, int, int, int, int)); +static int neoclock4x_start (int, struct peer *); +static void neoclock4x_shutdown (int, struct peer *); +static void neoclock4x_receive (struct recvbuf *); +static void neoclock4x_poll (int, struct peer *); +static void neoclock4x_control (int, struct refclockstat *, struct refclockstat *, struct peer *); + +static int neol_atoi_len (const char str[], int *, int); +static int neol_hexatoi_len (const char str[], int *, int); +static void neol_jdn_to_ymd (unsigned long, int *, int *, int *); +static void neol_localtime (unsigned long, int* , int*, int*, int*, int*, int*); +static unsigned long neol_mktime (int, int, int, int, int, int); #if !defined(NEOCLOCK4X_FIRMWARE) -static int neol_query_firmware P((int, int, char *, int)); -static int neol_check_firmware P((int, const char*, char *)); +static int neol_query_firmware (int, int, char *, int); +static int neol_check_firmware (int, const char*, char *); #endif struct refclock refclock_neoclock4x = { diff --git a/ntpd/refclock_nmea.c b/ntpd/refclock_nmea.c index 5b124cb0c3..7d73ed4bfe 100644 --- a/ntpd/refclock_nmea.c +++ b/ntpd/refclock_nmea.c @@ -97,18 +97,18 @@ struct nmeaunit { /* * Function prototypes */ -static int nmea_start P((int, struct peer *)); -static void nmea_shutdown P((int, struct peer *)); +static int nmea_start (int, struct peer *); +static void nmea_shutdown (int, struct peer *); #ifdef HAVE_PPSAPI -static void nmea_control P((int, struct refclockstat *, struct - refclockstat *, struct peer *)); -static int nmea_ppsapi P((struct peer *, int, int)); -static int nmea_pps P((struct nmeaunit *, l_fp *)); +static void nmea_control (int, struct refclockstat *, struct + refclockstat *, struct peer *); +static int nmea_ppsapi (struct peer *, int, int); +static int nmea_pps (struct nmeaunit *, l_fp *); #endif /* HAVE_PPSAPI */ -static void nmea_receive P((struct recvbuf *)); -static void nmea_poll P((int, struct peer *)); -static void gps_send P((int, const char *, struct peer *)); -static char *field_parse P((char *, int)); +static void nmea_receive (struct recvbuf *); +static void nmea_poll (int, struct peer *); +static void gps_send (int, const char *, struct peer *); +static char *field_parse (char *, int); /* * Transfer vector diff --git a/ntpd/refclock_oncore.c b/ntpd/refclock_oncore.c index c720add2ca..96be77eb38 100644 --- a/ntpd/refclock_oncore.c +++ b/ntpd/refclock_oncore.c @@ -299,55 +299,55 @@ struct instance { #define rcvbuf instance->Rcvbuf #define rcvptr instance->Rcvptr -static int oncore_start P((int, struct peer *)); -static void oncore_poll P((int, struct peer *)); -static void oncore_shutdown P((int, struct peer *)); -static void oncore_consume P((struct instance *)); -static void oncore_read_config P((struct instance *)); -static void oncore_receive P((struct recvbuf *)); -static int oncore_ppsapi P((struct instance *)); -static void oncore_get_timestamp P((struct instance *, long, long)); -static void oncore_init_shmem P((struct instance *)); - -static void oncore_antenna_report P((struct instance *, enum antenna_state)); -static void oncore_chan_test P((struct instance *)); -static void oncore_check_almanac P((struct instance *)); -static void oncore_check_antenna P((struct instance *)); -static void oncore_check_leap_sec P((struct instance *)); -static int oncore_checksum_ok P((u_char *, int)); -static void oncore_compute_dH P((struct instance *)); -static void oncore_load_almanac P((struct instance *)); -static void oncore_print_Cb P((struct instance *, u_char *)); -/* static void oncore_print_array P((u_char *, int)); */ -static void oncore_print_posn P((struct instance *)); -static void oncore_sendmsg P((int, u_char *, size_t)); -static void oncore_set_posn P((struct instance *)); -static void oncore_set_traim P((struct instance *)); -static void oncore_shmem_get_3D P((struct instance *)); -static void oncore_ss P((struct instance *)); -static int oncore_wait_almanac P((struct instance *)); - -static void oncore_msg_any P((struct instance *, u_char *, size_t, int)); -static void oncore_msg_Adef P((struct instance *, u_char *, size_t)); -static void oncore_msg_Ag P((struct instance *, u_char *, size_t)); -static void oncore_msg_As P((struct instance *, u_char *, size_t)); -static void oncore_msg_At P((struct instance *, u_char *, size_t)); -static void oncore_msg_Ay P((struct instance *, u_char *, size_t)); -static void oncore_msg_Az P((struct instance *, u_char *, size_t)); -static void oncore_msg_BaEaHa P((struct instance *, u_char *, size_t)); -static void oncore_msg_Bd P((struct instance *, u_char *, size_t)); -static void oncore_msg_Bj P((struct instance *, u_char *, size_t)); -static void oncore_msg_BnEnHn P((struct instance *, u_char *, size_t)); -static void oncore_msg_CaFaIa P((struct instance *, u_char *, size_t)); -static void oncore_msg_Cb P((struct instance *, u_char *, size_t)); -static void oncore_msg_Cf P((struct instance *, u_char *, size_t)); -static void oncore_msg_Cj P((struct instance *, u_char *, size_t)); -static void oncore_msg_Cj_id P((struct instance *, u_char *, size_t)); -static void oncore_msg_Cj_init P((struct instance *, u_char *, size_t)); -static void oncore_msg_Ga P((struct instance *, u_char *, size_t)); -static void oncore_msg_Gb P((struct instance *, u_char *, size_t)); -static void oncore_msg_Gj P((struct instance *, u_char *, size_t)); -static void oncore_msg_Sz P((struct instance *, u_char *, size_t)); +static int oncore_start (int, struct peer *); +static void oncore_poll (int, struct peer *); +static void oncore_shutdown (int, struct peer *); +static void oncore_consume (struct instance *); +static void oncore_read_config (struct instance *); +static void oncore_receive (struct recvbuf *); +static int oncore_ppsapi (struct instance *); +static void oncore_get_timestamp (struct instance *, long, long); +static void oncore_init_shmem (struct instance *); + +static void oncore_antenna_report (struct instance *, enum antenna_state); +static void oncore_chan_test (struct instance *); +static void oncore_check_almanac (struct instance *); +static void oncore_check_antenna (struct instance *); +static void oncore_check_leap_sec (struct instance *); +static int oncore_checksum_ok (u_char *, int); +static void oncore_compute_dH (struct instance *); +static void oncore_load_almanac (struct instance *); +static void oncore_print_Cb (struct instance *, u_char *); +/* static void oncore_print_array (u_char *, int); */ +static void oncore_print_posn (struct instance *); +static void oncore_sendmsg (int, u_char *, size_t); +static void oncore_set_posn (struct instance *); +static void oncore_set_traim (struct instance *); +static void oncore_shmem_get_3D (struct instance *); +static void oncore_ss (struct instance *); +static int oncore_wait_almanac (struct instance *); + +static void oncore_msg_any (struct instance *, u_char *, size_t, int); +static void oncore_msg_Adef (struct instance *, u_char *, size_t); +static void oncore_msg_Ag (struct instance *, u_char *, size_t); +static void oncore_msg_As (struct instance *, u_char *, size_t); +static void oncore_msg_At (struct instance *, u_char *, size_t); +static void oncore_msg_Ay (struct instance *, u_char *, size_t); +static void oncore_msg_Az (struct instance *, u_char *, size_t); +static void oncore_msg_BaEaHa (struct instance *, u_char *, size_t); +static void oncore_msg_Bd (struct instance *, u_char *, size_t); +static void oncore_msg_Bj (struct instance *, u_char *, size_t); +static void oncore_msg_BnEnHn (struct instance *, u_char *, size_t); +static void oncore_msg_CaFaIa (struct instance *, u_char *, size_t); +static void oncore_msg_Cb (struct instance *, u_char *, size_t); +static void oncore_msg_Cf (struct instance *, u_char *, size_t); +static void oncore_msg_Cj (struct instance *, u_char *, size_t); +static void oncore_msg_Cj_id (struct instance *, u_char *, size_t); +static void oncore_msg_Cj_init (struct instance *, u_char *, size_t); +static void oncore_msg_Ga (struct instance *, u_char *, size_t); +static void oncore_msg_Gb (struct instance *, u_char *, size_t); +static void oncore_msg_Gj (struct instance *, u_char *, size_t); +static void oncore_msg_Sz (struct instance *, u_char *, size_t); struct refclock refclock_oncore = { oncore_start, /* start up driver */ @@ -367,7 +367,7 @@ struct refclock refclock_oncore = { static struct msg_desc { const char flag[3]; const int len; - void (*handler) P((struct instance *, u_char *, size_t)); + void (*handler) (struct instance *, u_char *, size_t); const char *fmt; int shmem; } oncore_messages[] = { diff --git a/ntpd/refclock_palisade.c b/ntpd/refclock_palisade.c index 217ec104dc..0b114f0118 100644 --- a/ntpd/refclock_palisade.c +++ b/ntpd/refclock_palisade.c @@ -91,7 +91,7 @@ struct refclock refclock_palisade = { NOFLAGS /* not used */ }; -int day_of_year P((char *dt)); +int day_of_year (char *dt); /* Extract the clock type from the mode setting */ #define CLK_TYPE(x) ((int)(((x)->ttl) & 0x7F)) diff --git a/ntpd/refclock_palisade.h b/ntpd/refclock_palisade.h index e63f3da364..c3340f8f05 100644 --- a/ntpd/refclock_palisade.h +++ b/ntpd/refclock_palisade.h @@ -155,16 +155,16 @@ struct palisade_unit { * Function prototypes */ -static int palisade_start P((int, struct peer *)); -static void palisade_shutdown P((int, struct peer *)); -static void palisade_receive P((struct peer *)); -static void palisade_poll P((int, struct peer *)); -static void palisade_io P((struct recvbuf *)); -int palisade_configure P((int, struct peer *)); -int TSIP_decode P((struct peer *)); -long HW_poll P((struct refclockproc *)); -float getfloat P((u_char *)); -double getdbl P((u_char *)); -short getint P((u_char *)); +static int palisade_start (int, struct peer *); +static void palisade_shutdown (int, struct peer *); +static void palisade_receive (struct peer *); +static void palisade_poll (int, struct peer *); +static void palisade_io (struct recvbuf *); +int palisade_configure (int, struct peer *); +int TSIP_decode (struct peer *); +long HW_poll (struct refclockproc *); +float getfloat (u_char *); +double getdbl (u_char *); +short getint (u_char *); #endif /* PALISADE_H */ diff --git a/ntpd/refclock_parse.c b/ntpd/refclock_parse.c index f24c75c5f3..8faa8d8581 100644 --- a/ntpd/refclock_parse.c +++ b/ntpd/refclock_parse.c @@ -188,10 +188,10 @@ static char rcsid[] = "refclock_parse.c,v 4.78 2006/12/22 20:08:27 kardel RELEAS ** external interface to ntp mechanism **/ -static int parse_start P((int, struct peer *)); -static void parse_shutdown P((int, struct peer *)); -static void parse_poll P((int, struct peer *)); -static void parse_control P((int, struct refclockstat *, struct refclockstat *, struct peer *)); +static int parse_start (int, struct peer *); +static void parse_shutdown (int, struct peer *); +static void parse_poll (int, struct peer *); +static void parse_control (int, struct refclockstat *, struct refclockstat *, struct peer *); struct refclock refclock_parse = { parse_start, @@ -225,16 +225,16 @@ struct parseunit; /* to keep inquiring minds happy */ typedef struct bind { const char *bd_description; /* name of type of binding */ - int (*bd_init) P((struct parseunit *)); /* initialize */ - void (*bd_end) P((struct parseunit *)); /* end */ - int (*bd_setcs) P((struct parseunit *, parsectl_t *)); /* set character size */ - int (*bd_disable) P((struct parseunit *)); /* disable */ - int (*bd_enable) P((struct parseunit *)); /* enable */ - int (*bd_getfmt) P((struct parseunit *, parsectl_t *)); /* get format */ - int (*bd_setfmt) P((struct parseunit *, parsectl_t *)); /* setfmt */ - int (*bd_timecode) P((struct parseunit *, parsectl_t *)); /* get time code */ - void (*bd_receive) P((struct recvbuf *)); /* receive operation */ - int (*bd_io_input) P((struct recvbuf *)); /* input operation */ + int (*bd_init) (struct parseunit *); /* initialize */ + void (*bd_end) (struct parseunit *); /* end */ + int (*bd_setcs) (struct parseunit *, parsectl_t *); /* set character size */ + int (*bd_disable) (struct parseunit *); /* disable */ + int (*bd_enable) (struct parseunit *); /* enable */ + int (*bd_getfmt) (struct parseunit *, parsectl_t *); /* get format */ + int (*bd_setfmt) (struct parseunit *, parsectl_t *); /* setfmt */ + int (*bd_timecode) (struct parseunit *, parsectl_t *); /* get time code */ + void (*bd_receive) (struct recvbuf *); /* receive operation */ + int (*bd_io_input) (struct recvbuf *); /* input operation */ } bind_t; #define PARSE_END(_X_) (*(_X_)->binding->bd_end)(_X_) @@ -417,9 +417,9 @@ struct parseunit ** includes NTP parameters, TTY parameters and IO handling parameters **/ -static void poll_dpoll P((struct parseunit *)); -static void poll_poll P((struct peer *)); -static int poll_init P((struct parseunit *)); +static void poll_dpoll (struct parseunit *); +static void poll_poll (struct peer *); +static int poll_init (struct parseunit *); typedef struct poll_info { @@ -530,8 +530,8 @@ typedef struct poll_info /* * Meinberg GPS16X receiver */ -static void gps16x_message P((struct parseunit *, parsetime_t *)); -static int gps16x_poll_init P((struct parseunit *)); +static void gps16x_message (struct parseunit *, parsetime_t *); +static int gps16x_poll_init (struct parseunit *); #define GPS16X_ROOTDELAY 0.0 /* nothing here */ #define GPS16X_BASEDELAY 0.001968 /* XXX to be fixed ! 1.968ms +- 104us (oscilloscope) - relative to start (end of STX) */ @@ -671,7 +671,7 @@ static poll_info_t wsdcf_pollinfo = { WS_POLLRATE, WS_POLLCMD, WS_CMDSIZE }; * RAWDCF receivers that need to be powered from DTR * (like Expert mouse clock) */ -static int rawdcf_init_1 P((struct parseunit *)); +static int rawdcf_init_1 (struct parseunit *); #define RAWDCFDTRSET_DESCRIPTION "RAW DCF77 CODE (DTR SET/RTS CLR)" #define RAWDCFDTRSET_INIT rawdcf_init_1 @@ -679,7 +679,7 @@ static int rawdcf_init_1 P((struct parseunit *)); * RAWDCF receivers that need to be powered from * DTR CLR and RTS SET */ -static int rawdcf_init_2 P((struct parseunit *)); +static int rawdcf_init_2 (struct parseunit *); #define RAWDCFDTRCLRRTSSET_DESCRIPTION "RAW DCF77 CODE (DTR CLR/RTS SET)" #define RAWDCFDTRCLRRTSSET_INIT rawdcf_init_2 @@ -694,17 +694,17 @@ static int rawdcf_init_2 P((struct parseunit *)); #define TRIM_TAIPCMDSIZE (sizeof(TRIM_TAIPPOLLCMD)-1) static poll_info_t trimbletaip_pollinfo = { TRIM_POLLRATE, TRIM_TAIPPOLLCMD, TRIM_TAIPCMDSIZE }; -static int trimbletaip_init P((struct parseunit *)); -static void trimbletaip_event P((struct parseunit *, int)); +static int trimbletaip_init (struct parseunit *); +static void trimbletaip_event (struct parseunit *, int); /* query time & UTC correction data */ static char tsipquery[] = { DLE, 0x21, DLE, ETX, DLE, 0x2F, DLE, ETX }; static poll_info_t trimbletsip_pollinfo = { TRIM_POLLRATE, tsipquery, sizeof(tsipquery) }; -static int trimbletsip_init P((struct parseunit *)); -static void trimbletsip_end P((struct parseunit *)); -static void trimbletsip_message P((struct parseunit *, parsetime_t *)); -static void trimbletsip_event P((struct parseunit *, int)); +static int trimbletsip_init (struct parseunit *); +static void trimbletsip_end (struct parseunit *); +static void trimbletsip_message (struct parseunit *, parsetime_t *); +static void trimbletsip_event (struct parseunit *, int); #define TRIMBLETSIP_IDLE_TIME (300) /* 5 minutes silence at most */ #define TRIMBLE_RESET_HOLDOFF TRIMBLETSIP_IDLE_TIME @@ -852,11 +852,11 @@ static poll_info_t rcc8000_pollinfo = { RCC_POLLRATE, RCC_POLLCMD, RCC_CMDSIZE } static struct parse_clockinfo { u_long cl_flags; /* operation flags (io modes) */ - void (*cl_poll) P((struct parseunit *)); /* active poll routine */ - int (*cl_init) P((struct parseunit *)); /* active poll init routine */ - void (*cl_event) P((struct parseunit *, int)); /* special event handling (e.g. reset clock) */ - void (*cl_end) P((struct parseunit *)); /* active poll end routine */ - void (*cl_message) P((struct parseunit *, parsetime_t *)); /* process a lower layer message */ + void (*cl_poll) (struct parseunit *); /* active poll routine */ + int (*cl_init) (struct parseunit *); /* active poll init routine */ + void (*cl_event) (struct parseunit *, int); /* special event handling (e.g. reset clock) */ + void (*cl_end) (struct parseunit *); /* active poll end routine */ + void (*cl_message) (struct parseunit *, parsetime_t *); /* process a lower layer message */ void *cl_data; /* local data area for "poll" mechanism */ double cl_rootdelay; /* rootdelay */ double cl_basedelay; /* current offset by which the RS232 @@ -1365,11 +1365,11 @@ static int notice = 0; #define PARSE_STATETIME(parse, i) ((parse->generic->currentstatus == i) ? parse->statetime[i] + current_time - parse->lastchange : parse->statetime[i]) -static void parse_event P((struct parseunit *, int)); -static void parse_process P((struct parseunit *, parsetime_t *)); -static void clear_err P((struct parseunit *, u_long)); -static int list_err P((struct parseunit *, u_long)); -static char * l_mktime P((u_long)); +static void parse_event (struct parseunit *, int); +static void parse_process (struct parseunit *, parsetime_t *); +static void clear_err (struct parseunit *, u_long); +static int list_err (struct parseunit *, u_long); +static char * l_mktime (u_long); /**=========================================================================== ** implementation error message regression module @@ -1548,27 +1548,27 @@ mkascii( * define possible io handling methods */ #ifdef STREAM -static int ppsclock_init P((struct parseunit *)); -static int stream_init P((struct parseunit *)); -static void stream_end P((struct parseunit *)); -static int stream_enable P((struct parseunit *)); -static int stream_disable P((struct parseunit *)); -static int stream_setcs P((struct parseunit *, parsectl_t *)); -static int stream_getfmt P((struct parseunit *, parsectl_t *)); -static int stream_setfmt P((struct parseunit *, parsectl_t *)); -static int stream_timecode P((struct parseunit *, parsectl_t *)); -static void stream_receive P((struct recvbuf *)); +static int ppsclock_init (struct parseunit *); +static int stream_init (struct parseunit *); +static void stream_end (struct parseunit *); +static int stream_enable (struct parseunit *); +static int stream_disable (struct parseunit *); +static int stream_setcs (struct parseunit *, parsectl_t *); +static int stream_getfmt (struct parseunit *, parsectl_t *); +static int stream_setfmt (struct parseunit *, parsectl_t *); +static int stream_timecode (struct parseunit *, parsectl_t *); +static void stream_receive (struct recvbuf *); #endif -static int local_init P((struct parseunit *)); -static void local_end P((struct parseunit *)); -static int local_nop P((struct parseunit *)); -static int local_setcs P((struct parseunit *, parsectl_t *)); -static int local_getfmt P((struct parseunit *, parsectl_t *)); -static int local_setfmt P((struct parseunit *, parsectl_t *)); -static int local_timecode P((struct parseunit *, parsectl_t *)); -static void local_receive P((struct recvbuf *)); -static int local_input P((struct recvbuf *)); +static int local_init (struct parseunit *); +static void local_end (struct parseunit *); +static int local_nop (struct parseunit *); +static int local_setcs (struct parseunit *, parsectl_t *); +static int local_getfmt (struct parseunit *, parsectl_t *); +static int local_setfmt (struct parseunit *, parsectl_t *); +static int local_timecode (struct parseunit *, parsectl_t *); +static void local_receive (struct recvbuf *); +static int local_input (struct recvbuf *); static bind_t io_bindings[] = { @@ -4825,11 +4825,11 @@ struct txbuf u_char *txt; /* pointer to actual data buffer */ }; -void sendcmd P((struct txbuf *buf, int c)); -void sendbyte P((struct txbuf *buf, int b)); -void sendetx P((struct txbuf *buf, struct parseunit *parse)); -void sendint P((struct txbuf *buf, int a)); -void sendflt P((struct txbuf *buf, double a)); +void sendcmd (struct txbuf *buf, int c); +void sendbyte (struct txbuf *buf, int b); +void sendetx (struct txbuf *buf, struct parseunit *parse); +void sendint (struct txbuf *buf, int a); +void sendflt (struct txbuf *buf, double a); void sendcmd( @@ -4842,11 +4842,11 @@ sendcmd( buf->idx = 2; } -void sendcmd P((struct txbuf *buf, int c)); -void sendbyte P((struct txbuf *buf, int b)); -void sendetx P((struct txbuf *buf, struct parseunit *parse)); -void sendint P((struct txbuf *buf, int a)); -void sendflt P((struct txbuf *buf, double a)); +void sendcmd (struct txbuf *buf, int c); +void sendbyte (struct txbuf *buf, int b); +void sendetx (struct txbuf *buf, struct parseunit *parse); +void sendint (struct txbuf *buf, int a); +void sendflt (struct txbuf *buf, double a); void sendbyte( @@ -5049,7 +5049,7 @@ trimbletsip_end( parse->localdata = (void *)0; } parse->peer->nextaction = 0; - parse->peer->action = (void (*) P((struct peer *)))0; + parse->peer->action = (void (*) (struct peer *))0; } /*-------------------------------------------------- diff --git a/ntpd/refclock_pcf.c b/ntpd/refclock_pcf.c index d4e9fd17a0..10fc650051 100644 --- a/ntpd/refclock_pcf.c +++ b/ntpd/refclock_pcf.c @@ -38,9 +38,9 @@ /* * Function prototypes */ -static int pcf_start P((int, struct peer *)); -static void pcf_shutdown P((int, struct peer *)); -static void pcf_poll P((int, struct peer *)); +static int pcf_start (int, struct peer *); +static void pcf_shutdown (int, struct peer *); +static void pcf_poll (int, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_pst.c b/ntpd/refclock_pst.c index 776e28eaf4..4eaa501668 100644 --- a/ntpd/refclock_pst.c +++ b/ntpd/refclock_pst.c @@ -91,10 +91,10 @@ struct pstunit { /* * Function prototypes */ -static int pst_start P((int, struct peer *)); -static void pst_shutdown P((int, struct peer *)); -static void pst_receive P((struct recvbuf *)); -static void pst_poll P((int, struct peer *)); +static int pst_start (int, struct peer *); +static void pst_shutdown (int, struct peer *); +static void pst_receive (struct recvbuf *); +static void pst_poll (int, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_true.c b/ntpd/refclock_true.c index dd355d9027..3abe56e4e3 100644 --- a/ntpd/refclock_true.c +++ b/ntpd/refclock_true.c @@ -167,15 +167,15 @@ struct true_unit { /* * Function prototypes */ -static int true_start P((int, struct peer *)); -static void true_shutdown P((int, struct peer *)); -static void true_receive P((struct recvbuf *)); -static void true_poll P((int, struct peer *)); -static void true_send P((struct peer *, const char *)); -static void true_doevent P((struct peer *, enum true_event)); +static int true_start (int, struct peer *); +static void true_shutdown (int, struct peer *); +static void true_receive (struct recvbuf *); +static void true_poll (int, struct peer *); +static void true_send (struct peer *, const char *); +static void true_doevent (struct peer *, enum true_event); #ifdef CLOCK_PPS720 -static u_long true_sample720 P((void)); +static u_long true_sample720 (void); #endif /* diff --git a/ntpd/refclock_ulink.c b/ntpd/refclock_ulink.c index d7a62fef3a..5b7f46f038 100644 --- a/ntpd/refclock_ulink.c +++ b/ntpd/refclock_ulink.c @@ -106,10 +106,10 @@ struct ulinkunit { /* * Function prototypes */ -static int ulink_start P((int, struct peer *)); -static void ulink_shutdown P((int, struct peer *)); -static void ulink_receive P((struct recvbuf *)); -static void ulink_poll P((int, struct peer *)); +static int ulink_start (int, struct peer *); +static void ulink_shutdown (int, struct peer *); +static void ulink_receive (struct recvbuf *); +static void ulink_poll (int, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_wwv.c b/ntpd/refclock_wwv.c index db227009d8..691a4c299f 100644 --- a/ntpd/refclock_wwv.c +++ b/ntpd/refclock_wwv.c @@ -567,32 +567,32 @@ struct wwvunit { /* * Function prototypes */ -static int wwv_start P((int, struct peer *)); -static void wwv_shutdown P((int, struct peer *)); -static void wwv_receive P((struct recvbuf *)); -static void wwv_poll P((int, struct peer *)); +static int wwv_start (int, struct peer *); +static void wwv_shutdown (int, struct peer *); +static void wwv_receive (struct recvbuf *); +static void wwv_poll (int, struct peer *); /* * More function prototypes */ -static void wwv_epoch P((struct peer *)); -static void wwv_rf P((struct peer *, double)); -static void wwv_endpoc P((struct peer *, int)); -static void wwv_rsec P((struct peer *, double)); -static void wwv_qrz P((struct peer *, struct sync *, int)); -static void wwv_corr4 P((struct peer *, struct decvec *, - double [], double [][4])); -static void wwv_gain P((struct peer *)); -static void wwv_tsec P((struct peer *)); -static int timecode P((struct wwvunit *, char *)); -static double wwv_snr P((double, double)); -static int carry P((struct decvec *)); -static int wwv_newchan P((struct peer *)); -static void wwv_newgame P((struct peer *)); -static double wwv_metric P((struct sync *)); -static void wwv_clock P((struct peer *)); +static void wwv_epoch (struct peer *); +static void wwv_rf (struct peer *, double); +static void wwv_endpoc (struct peer *, int); +static void wwv_rsec (struct peer *, double); +static void wwv_qrz (struct peer *, struct sync *, int); +static void wwv_corr4 (struct peer *, struct decvec *, + double [], double [][4]); +static void wwv_gain (struct peer *); +static void wwv_tsec (struct peer *); +static int timecode (struct wwvunit *, char *); +static double wwv_snr (double, double); +static int carry (struct decvec *); +static int wwv_newchan (struct peer *); +static void wwv_newgame (struct peer *); +static double wwv_metric (struct sync *); +static void wwv_clock (struct peer *); #ifdef ICOM -static int wwv_qsy P((struct peer *, int)); +static int wwv_qsy (struct peer *, int); #endif /* ICOM */ static double qsy[NCHAN] = {2.5, 5, 10, 15, 20}; /* frequencies (MHz) */ diff --git a/ntpd/refclock_wwvb.c b/ntpd/refclock_wwvb.c index 7bddd3a375..ebad7f8546 100644 --- a/ntpd/refclock_wwvb.c +++ b/ntpd/refclock_wwvb.c @@ -121,11 +121,11 @@ struct wwvbunit { /* * Function prototypes */ -static int wwvb_start P((int, struct peer *)); -static void wwvb_shutdown P((int, struct peer *)); -static void wwvb_receive P((struct recvbuf *)); -static void wwvb_poll P((int, struct peer *)); -static void wwvb_timer P((int, struct peer *)); +static int wwvb_start (int, struct peer *); +static void wwvb_shutdown (int, struct peer *); +static void wwvb_receive (struct recvbuf *); +static void wwvb_poll (int, struct peer *); +static void wwvb_timer (int, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_zyfer.c b/ntpd/refclock_zyfer.c index 44f2c4d353..ed83b2611f 100644 --- a/ntpd/refclock_zyfer.c +++ b/ntpd/refclock_zyfer.c @@ -97,10 +97,10 @@ struct zyferunit { /* * Function prototypes */ -static int zyfer_start P((int, struct peer *)); -static void zyfer_shutdown P((int, struct peer *)); -static void zyfer_receive P((struct recvbuf *)); -static void zyfer_poll P((int, struct peer *)); +static int zyfer_start (int, struct peer *); +static void zyfer_shutdown (int, struct peer *); +static void zyfer_receive (struct recvbuf *); +static void zyfer_poll (int, struct peer *); /* * Transfer vector diff --git a/ntpdate/Makefile.am b/ntpdate/Makefile.am index c6ef27d3e2..b58048ea57 100644 --- a/ntpdate/Makefile.am +++ b/ntpdate/Makefile.am @@ -1,4 +1,4 @@ -AUTOMAKE_OPTIONS= ../util/ansi2knr +AUTOMAKE_OPTIONS= bindir= ${exec_prefix}/${BINSUBDIR} #bin_PROGRAMS= ntpdate ntptimeset diff --git a/ntpdate/ntpdate.c b/ntpdate/ntpdate.c index 2ccb37d7a3..623a95880e 100644 --- a/ntpdate/ntpdate.c +++ b/ntpdate/ntpdate.c @@ -215,29 +215,29 @@ int verbose = 0; int always_step = 0; int never_step = 0; -int ntpdatemain P((int, char **)); - -static void transmit P((struct server *)); -static void receive P((struct recvbuf *)); -static void server_data P((struct server *, s_fp, l_fp *, u_fp)); -static void clock_filter P((struct server *)); -static struct server *clock_select P((void)); -static int clock_adjust P((void)); -static void addserver P((char *)); -static struct server *findserver P((struct sockaddr_storage *)); - void timer P((void)); -static void init_alarm P((void)); +int ntpdatemain (int, char **); + +static void transmit (struct server *); +static void receive (struct recvbuf *); +static void server_data (struct server *, s_fp, l_fp *, u_fp); +static void clock_filter (struct server *); +static struct server *clock_select (void); +static int clock_adjust (void); +static void addserver (char *); +static struct server *findserver (struct sockaddr_storage *); + void timer (void); +static void init_alarm (void); #ifndef SYS_WINNT -static RETSIGTYPE alarming P((int)); +static RETSIGTYPE alarming (int); #endif /* SYS_WINNT */ -static void init_io P((void)); -static void sendpkt P((struct sockaddr_storage *, struct pkt *, int)); -void input_handler P((void)); +static void init_io (void); +static void sendpkt (struct sockaddr_storage *, struct pkt *, int); +void input_handler (void); -static int l_adj_systime P((l_fp *)); -static int l_step_systime P((l_fp *)); +static int l_adj_systime (l_fp *); +static int l_step_systime (l_fp *); -static void printserver P((struct server *, FILE *)); +static void printserver (struct server *, FILE *); #ifdef SYS_WINNT int on = 1; @@ -307,7 +307,7 @@ void clear_globals() #endif #ifdef HAVE_NETINFO -static ni_namelist *getnetinfoservers P((void)); +static ni_namelist *getnetinfoservers (void); #endif /* diff --git a/ntpdate/ntpdate.h b/ntpdate/ntpdate.h index f3531b3f24..5fbce3a1c0 100644 --- a/ntpdate/ntpdate.h +++ b/ntpdate/ntpdate.h @@ -4,7 +4,7 @@ #include "ntp_malloc.h" -extern void loadservers P((char *cfgpath)); +extern void loadservers (char *cfgpath); /* * The server structure is a much simplified version of the diff --git a/ntpdc/Makefile.am b/ntpdc/Makefile.am index f10b84a1b3..b693472314 100644 --- a/ntpdc/Makefile.am +++ b/ntpdc/Makefile.am @@ -1,4 +1,4 @@ -AUTOMAKE_OPTIONS= ../util/ansi2knr +AUTOMAKE_OPTIONS= bindir= ${exec_prefix}/${BINSUBDIR} bin_PROGRAMS= ntpdc diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c index 9126533396..d1c0301b98 100644 --- a/ntpdc/ntpdc.c +++ b/ntpdc/ntpdc.c @@ -69,42 +69,42 @@ u_long current_time; /* needed by authkeys; not used */ */ s_char sys_precision; /* local clock precision (log2 s) */ -int ntpdcmain P((int, char **)); +int ntpdcmain (int, char **); /* * Built in command handler declarations */ -static int openhost P((const char *)); -static int sendpkt P((char *, int)); -static void growpktdata P((void)); -static int getresponse P((int, int, int *, int *, char **, int)); -static int sendrequest P((int, int, int, int, int, char *)); -static void getcmds P((void)); -static RETSIGTYPE abortcmd P((int)); -static void docmd P((const char *)); -static void tokenize P((const char *, char **, int *)); -static int findcmd P((char *, struct xcmd *, struct xcmd *, struct xcmd **)); -static int getarg P((char *, int, arg_v *)); -static int getnetnum P((const char *, struct sockaddr_storage *, char *, int)); -static void help P((struct parse *, FILE *)); +static int openhost (const char *); +static int sendpkt (char *, int); +static void growpktdata (void); +static int getresponse (int, int, int *, int *, char **, int); +static int sendrequest (int, int, int, int, int, char *); +static void getcmds (void); +static RETSIGTYPE abortcmd (int); +static void docmd (const char *); +static void tokenize (const char *, char **, int *); +static int findcmd (char *, struct xcmd *, struct xcmd *, struct xcmd **); +static int getarg (char *, int, arg_v *); +static int getnetnum (const char *, struct sockaddr_storage *, char *, int); +static void help (struct parse *, FILE *); #ifdef QSORT_USES_VOID_P -static int helpsort P((const void *, const void *)); +static int helpsort (const void *, const void *); #else -static int helpsort P((char **, char **)); +static int helpsort (char **, char **); #endif -static void printusage P((struct xcmd *, FILE *)); -static void timeout P((struct parse *, FILE *)); -static void my_delay P((struct parse *, FILE *)); -static void host P((struct parse *, FILE *)); -static void keyid P((struct parse *, FILE *)); -static void keytype P((struct parse *, FILE *)); -static void passwd P((struct parse *, FILE *)); -static void hostnames P((struct parse *, FILE *)); -static void setdebug P((struct parse *, FILE *)); -static void quit P((struct parse *, FILE *)); -static void version P((struct parse *, FILE *)); -static void warning P((const char *, const char *, const char *)); -static void error P((const char *, const char *, const char *)); -static u_long getkeyid P((const char *)); +static void printusage (struct xcmd *, FILE *); +static void timeout (struct parse *, FILE *); +static void my_delay (struct parse *, FILE *); +static void host (struct parse *, FILE *); +static void keyid (struct parse *, FILE *); +static void keytype (struct parse *, FILE *); +static void passwd (struct parse *, FILE *); +static void hostnames (struct parse *, FILE *); +static void setdebug (struct parse *, FILE *); +static void quit (struct parse *, FILE *); +static void version (struct parse *, FILE *); +static void warning (const char *, const char *, const char *); +static void error (const char *, const char *, const char *); +static u_long getkeyid (const char *); diff --git a/ntpdc/ntpdc.h b/ntpdc/ntpdc.h index 785c31242d..4bcee3e5f5 100644 --- a/ntpdc/ntpdc.h +++ b/ntpdc/ntpdc.h @@ -53,7 +53,7 @@ struct parse { */ struct xcmd { const char *keyword; /* command key word */ - void (*handler) P((struct parse *, FILE *)); /* command handler */ + void (*handler) (struct parse *, FILE *); /* command handler */ u_char arg[MAXARGS]; /* descriptors for arguments */ const char *desc[MAXARGS]; /* descriptions for arguments */ const char *comment; @@ -63,5 +63,5 @@ extern int impl_ver; extern int showhostnames; extern int s_port; -extern int doquery P((int, int, int, int, int, char *, int *, int *, char **, int, int)); -extern char * nntohost P((struct sockaddr_storage *)); +extern int doquery (int, int, int, int, int, char *, int *, int *, char **, int, int); +extern char * nntohost (struct sockaddr_storage *); diff --git a/ntpdc/ntpdc_ops.c b/ntpdc/ntpdc_ops.c index 20bee3a418..2d6342307d 100644 --- a/ntpdc/ntpdc_ops.c +++ b/ntpdc/ntpdc_ops.c @@ -27,59 +27,59 @@ /* * Declarations for command handlers in here */ -static int checkitems P((int, FILE *)); -static int checkitemsize P((int, int)); -static int check1item P((int, FILE *)); -static void peerlist P((struct parse *, FILE *)); -static void peers P((struct parse *, FILE *)); -static void doconfig P((struct parse *pcmd, FILE *fp, int mode, int refc)); -static void dmpeers P((struct parse *, FILE *)); -static void dopeers P((struct parse *, FILE *, int)); -static void printpeer P((struct info_peer *, FILE *)); -static void showpeer P((struct parse *, FILE *)); -static void peerstats P((struct parse *, FILE *)); -static void loopinfo P((struct parse *, FILE *)); -static void sysinfo P((struct parse *, FILE *)); -static void sysstats P((struct parse *, FILE *)); -static void iostats P((struct parse *, FILE *)); -static void memstats P((struct parse *, FILE *)); -static void timerstats P((struct parse *, FILE *)); -static void addpeer P((struct parse *, FILE *)); -static void addserver P((struct parse *, FILE *)); -static void addrefclock P((struct parse *, FILE *)); -static void broadcast P((struct parse *, FILE *)); -static void doconfig P((struct parse *, FILE *, int, int)); -static void unconfig P((struct parse *, FILE *)); -static void set P((struct parse *, FILE *)); -static void sys_clear P((struct parse *, FILE *)); -static void doset P((struct parse *, FILE *, int)); -static void reslist P((struct parse *, FILE *)); -static void new_restrict P((struct parse *, FILE *)); -static void unrestrict P((struct parse *, FILE *)); -static void delrestrict P((struct parse *, FILE *)); -static void do_restrict P((struct parse *, FILE *, int)); -static void monlist P((struct parse *, FILE *)); -static void reset P((struct parse *, FILE *)); -static void preset P((struct parse *, FILE *)); -static void readkeys P((struct parse *, FILE *)); -static void trustkey P((struct parse *, FILE *)); -static void untrustkey P((struct parse *, FILE *)); -static void do_trustkey P((struct parse *, FILE *, int)); -static void authinfo P((struct parse *, FILE *)); -static void traps P((struct parse *, FILE *)); -static void addtrap P((struct parse *, FILE *)); -static void clrtrap P((struct parse *, FILE *)); -static void do_addclr_trap P((struct parse *, FILE *, int)); -static void requestkey P((struct parse *, FILE *)); -static void controlkey P((struct parse *, FILE *)); -static void do_changekey P((struct parse *, FILE *, int)); -static void ctlstats P((struct parse *, FILE *)); -static void clockstat P((struct parse *, FILE *)); -static void fudge P((struct parse *, FILE *)); -static void clkbug P((struct parse *, FILE *)); -static void kerninfo P((struct parse *, FILE *)); -static void get_if_stats P((struct parse *, FILE *)); -static void do_if_reload P((struct parse *, FILE *)); +static int checkitems (int, FILE *); +static int checkitemsize (int, int); +static int check1item (int, FILE *); +static void peerlist (struct parse *, FILE *); +static void peers (struct parse *, FILE *); +static void doconfig (struct parse *pcmd, FILE *fp, int mode, int refc); +static void dmpeers (struct parse *, FILE *); +static void dopeers (struct parse *, FILE *, int); +static void printpeer (struct info_peer *, FILE *); +static void showpeer (struct parse *, FILE *); +static void peerstats (struct parse *, FILE *); +static void loopinfo (struct parse *, FILE *); +static void sysinfo (struct parse *, FILE *); +static void sysstats (struct parse *, FILE *); +static void iostats (struct parse *, FILE *); +static void memstats (struct parse *, FILE *); +static void timerstats (struct parse *, FILE *); +static void addpeer (struct parse *, FILE *); +static void addserver (struct parse *, FILE *); +static void addrefclock (struct parse *, FILE *); +static void broadcast (struct parse *, FILE *); +static void doconfig (struct parse *, FILE *, int, int); +static void unconfig (struct parse *, FILE *); +static void set (struct parse *, FILE *); +static void sys_clear (struct parse *, FILE *); +static void doset (struct parse *, FILE *, int); +static void reslist (struct parse *, FILE *); +static void new_restrict (struct parse *, FILE *); +static void unrestrict (struct parse *, FILE *); +static void delrestrict (struct parse *, FILE *); +static void do_restrict (struct parse *, FILE *, int); +static void monlist (struct parse *, FILE *); +static void reset (struct parse *, FILE *); +static void preset (struct parse *, FILE *); +static void readkeys (struct parse *, FILE *); +static void trustkey (struct parse *, FILE *); +static void untrustkey (struct parse *, FILE *); +static void do_trustkey (struct parse *, FILE *, int); +static void authinfo (struct parse *, FILE *); +static void traps (struct parse *, FILE *); +static void addtrap (struct parse *, FILE *); +static void clrtrap (struct parse *, FILE *); +static void do_addclr_trap (struct parse *, FILE *, int); +static void requestkey (struct parse *, FILE *); +static void controlkey (struct parse *, FILE *); +static void do_changekey (struct parse *, FILE *, int); +static void ctlstats (struct parse *, FILE *); +static void clockstat (struct parse *, FILE *); +static void fudge (struct parse *, FILE *); +static void clkbug (struct parse *, FILE *); +static void kerninfo (struct parse *, FILE *); +static void get_if_stats (struct parse *, FILE *); +static void do_if_reload (struct parse *, FILE *); /* * Commands we understand. Ntpdc imports this. diff --git a/ntpq/Makefile.am b/ntpq/Makefile.am index 55f107ca97..f3e7506bf9 100644 --- a/ntpq/Makefile.am +++ b/ntpq/Makefile.am @@ -1,4 +1,4 @@ -AUTOMAKE_OPTIONS= ../util/ansi2knr +AUTOMAKE_OPTIONS= bin_PROGRAMS= ntpq AM_CPPFLAGS= -I$(top_srcdir)/include $(LIBOPTS_CFLAGS) diff --git a/ntpq/ntpq-subs.c b/ntpq/ntpq-subs.c index 93551bd72b..b0955e947c 100644 --- a/ntpq/ntpq-subs.c +++ b/ntpq/ntpq-subs.c @@ -18,51 +18,51 @@ int maxhostlen; /* * Declarations for command handlers in here */ -static int checkassocid P((u_int32)); -static char * strsave P((char *)); -static struct varlist *findlistvar P((struct varlist *, char *)); -static void doaddvlist P((struct varlist *, char *)); -static void dormvlist P((struct varlist *, char *)); -static void doclearvlist P((struct varlist *)); -static void makequerydata P((struct varlist *, int *, char *)); -static int doquerylist P((struct varlist *, int, int, int, u_short *, int *, char **)); -static void doprintvlist P((struct varlist *, FILE *)); -static void addvars P((struct parse *, FILE *)); -static void rmvars P((struct parse *, FILE *)); -static void clearvars P((struct parse *, FILE *)); -static void showvars P((struct parse *, FILE *)); -static int dolist P((struct varlist *, int, int, int, FILE *)); -static void readlist P((struct parse *, FILE *)); -static void writelist P((struct parse *, FILE *)); -static void readvar P((struct parse *, FILE *)); -static void writevar P((struct parse *, FILE *)); -static void clocklist P((struct parse *, FILE *)); -static void clockvar P((struct parse *, FILE *)); -static int findassidrange P((u_int32, u_int32, int *, int *)); -static void mreadlist P((struct parse *, FILE *)); -static void mreadvar P((struct parse *, FILE *)); -static int dogetassoc P((FILE *)); -static void printassoc P((int, FILE *)); -static void associations P((struct parse *, FILE *)); -static void lassociations P((struct parse *, FILE *)); -static void passociations P((struct parse *, FILE *)); -static void lpassociations P((struct parse *, FILE *)); +static int checkassocid (u_int32); +static char * strsave (char *); +static struct varlist *findlistvar (struct varlist *, char *); +static void doaddvlist (struct varlist *, char *); +static void dormvlist (struct varlist *, char *); +static void doclearvlist (struct varlist *); +static void makequerydata (struct varlist *, int *, char *); +static int doquerylist (struct varlist *, int, int, int, u_short *, int *, char **); +static void doprintvlist (struct varlist *, FILE *); +static void addvars (struct parse *, FILE *); +static void rmvars (struct parse *, FILE *); +static void clearvars (struct parse *, FILE *); +static void showvars (struct parse *, FILE *); +static int dolist (struct varlist *, int, int, int, FILE *); +static void readlist (struct parse *, FILE *); +static void writelist (struct parse *, FILE *); +static void readvar (struct parse *, FILE *); +static void writevar (struct parse *, FILE *); +static void clocklist (struct parse *, FILE *); +static void clockvar (struct parse *, FILE *); +static int findassidrange (u_int32, u_int32, int *, int *); +static void mreadlist (struct parse *, FILE *); +static void mreadvar (struct parse *, FILE *); +static int dogetassoc (FILE *); +static void printassoc (int, FILE *); +static void associations (struct parse *, FILE *); +static void lassociations (struct parse *, FILE *); +static void passociations (struct parse *, FILE *); +static void lpassociations (struct parse *, FILE *); #ifdef UNUSED -static void radiostatus P((struct parse *, FILE *)); +static void radiostatus (struct parse *, FILE *); #endif /* UNUSED */ -static void pstatus P((struct parse *, FILE *)); -static long when P((l_fp *, l_fp *, l_fp *)); -static char * prettyinterval P((char *, long)); -static int doprintpeers P((struct varlist *, int, int, int, char *, FILE *, int)); -static int dogetpeers P((struct varlist *, int, FILE *, int)); -static void dopeers P((int, FILE *, int)); -static void peers P((struct parse *, FILE *)); -static void lpeers P((struct parse *, FILE *)); -static void doopeers P((int, FILE *, int)); -static void opeers P((struct parse *, FILE *)); -static void lopeers P((struct parse *, FILE *)); +static void pstatus (struct parse *, FILE *); +static long when (l_fp *, l_fp *, l_fp *); +static char * prettyinterval (char *, long); +static int doprintpeers (struct varlist *, int, int, int, char *, FILE *, int); +static int dogetpeers (struct varlist *, int, FILE *, int); +static void dopeers (int, FILE *, int); +static void peers (struct parse *, FILE *); +static void lpeers (struct parse *, FILE *); +static void doopeers (int, FILE *, int); +static void opeers (struct parse *, FILE *); +static void lopeers (struct parse *, FILE *); /* diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index 91379408ff..41192f4bf0 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -238,60 +238,60 @@ static const char *tstflagnames[] = { }; -int ntpqmain P((int, char **)); +int ntpqmain (int, char **); /* * Built in command handler declarations */ -static int openhost P((const char *)); -static int sendpkt P((char *, int)); -static int getresponse P((int, int, u_short *, int *, char **, int)); -static int sendrequest P((int, int, int, int, char *)); -static char * tstflags P((u_long)); -static void getcmds P((void)); -static RETSIGTYPE abortcmd P((int)); -static void docmd P((const char *)); -static void tokenize P((const char *, char **, int *)); -static int findcmd P((char *, struct xcmd *, struct xcmd *, struct xcmd **)); -static int getarg P((char *, int, arg_v *)); -static int rtdatetolfp P((char *, l_fp *)); -static int decodearr P((char *, int *, l_fp *)); -static void help P((struct parse *, FILE *)); +static int openhost (const char *); +static int sendpkt (char *, int); +static int getresponse (int, int, u_short *, int *, char **, int); +static int sendrequest (int, int, int, int, char *); +static char * tstflags (u_long); +static void getcmds (void); +static RETSIGTYPE abortcmd (int); +static void docmd (const char *); +static void tokenize (const char *, char **, int *); +static int findcmd (char *, struct xcmd *, struct xcmd *, struct xcmd **); +static int getarg (char *, int, arg_v *); +static int rtdatetolfp (char *, l_fp *); +static int decodearr (char *, int *, l_fp *); +static void help (struct parse *, FILE *); #ifdef QSORT_USES_VOID_P -static int helpsort P((const void *, const void *)); +static int helpsort (const void *, const void *); #else -static int helpsort P((char **, char **)); +static int helpsort (char **, char **); #endif -static void printusage P((struct xcmd *, FILE *)); -static void timeout P((struct parse *, FILE *)); -static void auth_delay P((struct parse *, FILE *)); -static void host P((struct parse *, FILE *)); -static void ntp_poll P((struct parse *, FILE *)); -static void keyid P((struct parse *, FILE *)); -static void keytype P((struct parse *, FILE *)); -static void passwd P((struct parse *, FILE *)); -static void hostnames P((struct parse *, FILE *)); -static void setdebug P((struct parse *, FILE *)); -static void quit P((struct parse *, FILE *)); -static void version P((struct parse *, FILE *)); -static void raw P((struct parse *, FILE *)); -static void cooked P((struct parse *, FILE *)); -static void authenticate P((struct parse *, FILE *)); -static void ntpversion P((struct parse *, FILE *)); -static void warning P((const char *, const char *, const char *)); -static void error P((const char *, const char *, const char *)); -static u_long getkeyid P((const char *)); -static void atoascii P((int, char *, char *)); -static void makeascii P((int, char *, FILE *)); -static void rawprint P((int, int, char *, int, FILE *)); -static void startoutput P((void)); -static void output P((FILE *, char *, char *)); -static void endoutput P((FILE *)); -static void outputarr P((FILE *, char *, int, l_fp *)); -static void cookedprint P((int, int, char *, int, FILE *)); +static void printusage (struct xcmd *, FILE *); +static void timeout (struct parse *, FILE *); +static void auth_delay (struct parse *, FILE *); +static void host (struct parse *, FILE *); +static void ntp_poll (struct parse *, FILE *); +static void keyid (struct parse *, FILE *); +static void keytype (struct parse *, FILE *); +static void passwd (struct parse *, FILE *); +static void hostnames (struct parse *, FILE *); +static void setdebug (struct parse *, FILE *); +static void quit (struct parse *, FILE *); +static void version (struct parse *, FILE *); +static void raw (struct parse *, FILE *); +static void cooked (struct parse *, FILE *); +static void authenticate (struct parse *, FILE *); +static void ntpversion (struct parse *, FILE *); +static void warning (const char *, const char *, const char *); +static void error (const char *, const char *, const char *); +static u_long getkeyid (const char *); +static void atoascii (int, char *, char *); +static void makeascii (int, char *, FILE *); +static void rawprint (int, int, char *, int, FILE *); +static void startoutput (void); +static void output (FILE *, char *, char *); +static void endoutput (FILE *); +static void outputarr (FILE *, char *, int, l_fp *); +static void cookedprint (int, int, char *, int, FILE *); #ifdef QSORT_USES_VOID_P -static int assoccmp P((const void *, const void *)); +static int assoccmp (const void *, const void *); #else -static int assoccmp P((struct association *, struct association *)); +static int assoccmp (struct association *, struct association *); #endif /* sgi || bsdi */ diff --git a/ntpq/ntpq.h b/ntpq/ntpq.h index 0f29fd53c9..7681cf432c 100644 --- a/ntpq/ntpq.h +++ b/ntpq/ntpq.h @@ -53,7 +53,7 @@ struct parse { */ struct xcmd { const char *keyword; /* command key word */ - void (*handler) P((struct parse *, FILE *)); /* command handler */ + void (*handler) (struct parse *, FILE *); /* command handler */ u_char arg[MAXARGS]; /* descriptors for arguments */ const char *desc[MAXARGS]; /* descriptions for arguments */ const char *comment; @@ -79,15 +79,15 @@ struct ctl_var { const char *text; }; -extern void asciize P((int, char *, FILE *)); -extern int getnetnum P((const char *, struct sockaddr_storage *, char *, int)); -extern void sortassoc P((void)); -extern int doquery P((int, int, int, int, char *, u_short *, int *, char **)); -extern char * nntohost P((struct sockaddr_storage *)); -extern int decodets P((char *, l_fp *)); -extern int decodeuint P((char *, u_long *)); -extern int nextvar P((int *, char **, char **, char **)); -extern int decodetime P((char *, l_fp *)); -extern void printvars P((int, char *, int, int, FILE *)); -extern int decodeint P((char *, long *)); -extern int findvar P((char *, struct ctl_var *, int code)); +extern void asciize (int, char *, FILE *); +extern int getnetnum (const char *, struct sockaddr_storage *, char *, int); +extern void sortassoc (void); +extern int doquery (int, int, int, int, char *, u_short *, int *, char **); +extern char * nntohost (struct sockaddr_storage *); +extern int decodets (char *, l_fp *); +extern int decodeuint (char *, u_long *); +extern int nextvar (int *, char **, char **, char **); +extern int decodetime (char *, l_fp *); +extern void printvars (int, char *, int, int, FILE *); +extern int decodeint (char *, long *); +extern int findvar (char *, struct ctl_var *, int code); diff --git a/parseutil/Makefile.am b/parseutil/Makefile.am index 01f6bd264e..0e6aaf022f 100644 --- a/parseutil/Makefile.am +++ b/parseutil/Makefile.am @@ -1,5 +1,5 @@ #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies -AUTOMAKE_OPTIONS = ../util/ansi2knr +AUTOMAKE_OPTIONS = noinst_PROGRAMS = @TESTDCF@ @DCFD@ EXTRA_PROGRAMS = testdcf dcfd INCLUDES = -I$(top_srcdir)/include diff --git a/parseutil/dcfd.c b/parseutil/dcfd.c index c87ab357e0..d086683730 100644 --- a/parseutil/dcfd.c +++ b/parseutil/dcfd.c @@ -1609,7 +1609,7 @@ main( struct sigaction act; # ifdef HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION - act.sa_sigaction = (void (*) P((int, siginfo_t *, void *)))0; + act.sa_sigaction = (void (*) (int, siginfo_t *, void *))0; # endif /* HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION */ act.sa_handler = tick; sigemptyset(&act.sa_mask); diff --git a/util/Makefile.am b/util/Makefile.am index 2949f7dc11..bc457fac93 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -1,5 +1,5 @@ #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies -AUTOMAKE_OPTIONS= ansi2knr +AUTOMAKE_OPTIONS= bin_PROGRAMS= @MAKE_NTPTIME@ @MAKE_TICKADJ@ @MAKE_TIMETRIM@ \ ntp-keygen diff --git a/util/jitter.h b/util/jitter.h index d0fba44b4b..db55c22c5e 100644 --- a/util/jitter.h +++ b/util/jitter.h @@ -6,17 +6,6 @@ */ #define SIZEOF_INT 4 -/* - * Set up for prototyping - */ -#ifndef P -#if defined(__STDC__) || defined(HAVE_PROTOTYPES) -#define P(x) x -#else /* not __STDC__ and not HAVE_PROTOTYPES */ -#define P(x) () -#endif /* not __STDC__ and HAVE_PROTOTYPES */ -#endif /* P */ - /* * VMS DECC (v4.1), {u_char,u_short,u_long} are only in SOCKET.H, * and u_int isn't defined anywhere diff --git a/util/ntp-keygen.c b/util/ntp-keygen.c index ed7b35328c..6f02eeb1a4 100644 --- a/util/ntp-keygen.c +++ b/util/ntp-keygen.c @@ -102,7 +102,7 @@ #include "ntp-keygen-opts.h" #ifdef SYS_WINNT -extern int ntp_getopt P((int, char **, const char *)); +extern int ntp_getopt (int, char **, const char *); #define getopt ntp_getopt #define optarg ntp_optarg #endif @@ -140,20 +140,20 @@ extern int ntp_getopt P((int, char **, const char *)); /* * Prototypes */ -FILE *fheader P((const char *, const char *)); -void fslink P((const char *, const char *)); -int gen_md5 P((char *)); +FILE *fheader (const char *, const char *); +void fslink (const char *, const char *); +int gen_md5 (char *); #ifdef OPENSSL -EVP_PKEY *gen_rsa P((char *)); -EVP_PKEY *gen_dsa P((char *)); -EVP_PKEY *gen_iff P((char *)); -EVP_PKEY *gen_gqpar P((char *)); -EVP_PKEY *gen_gqkey P((char *, EVP_PKEY *)); -EVP_PKEY *gen_mv P((char *)); -int x509 P((EVP_PKEY *, const EVP_MD *, char *, char *)); -void cb P((int, int, void *)); -EVP_PKEY *genkey P((char *, char *)); -u_long asn2ntp P((ASN1_TIME *)); +EVP_PKEY *gen_rsa (char *); +EVP_PKEY *gen_dsa (char *); +EVP_PKEY *gen_iff (char *); +EVP_PKEY *gen_gqpar (char *); +EVP_PKEY *gen_gqkey (char *, EVP_PKEY *); +EVP_PKEY *gen_mv (char *); +int x509 (EVP_PKEY *, const EVP_MD *, char *, char *); +void cb (int, int, void *); +EVP_PKEY *genkey (char *, char *); +u_long asn2ntp (ASN1_TIME *); #endif /* OPENSSL */ /* diff --git a/util/ntptime.c b/util/ntptime.c index 8f9d0c339e..4ca8234922 100644 --- a/util/ntptime.c +++ b/util/ntptime.c @@ -52,11 +52,11 @@ /* * Function prototypes */ -char *sprintb P((u_int, const char *)); -const char *timex_state P((int)); +char *sprintb (u_int, const char *); +const char *timex_state (int); #ifdef SIGSYS -void pll_trap P((int)); +void pll_trap (int); static struct sigaction newsigsys; /* new sigaction status */ static struct sigaction sigsys; /* current sigaction status */