From: Harlan Stenn Date: Sat, 6 Jan 2007 08:25:15 +0000 (-0500) Subject: [Bug 756] Require function prototypes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bf4580a57e5beaba90c5d88f672fbb7158dc5b5;p=thirdparty%2Fntp.git [Bug 756] Require function prototypes bk: 459f5cebSVrmDD2KYZSTdDQVE_gG3w --- diff --git a/configure.ac b/configure.ac index aee796581c..5f44832e5f 100644 --- a/configure.ac +++ b/configure.ac @@ -596,25 +596,6 @@ case "$ac_cv_c_volatile" in ;; esac -# AM_C_PROTOTYPES gives us ansi2knr -case "$build" in - *-*-solaris2*) - # Assume that solaris2 is Ansi C... - ;; - *) - AM_C_PROTOTYPES - ;; -esac -AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes, -[AC_TRY_COMPILE([ -extern int foo (short); -int foo(short i) { return i; }],[ -int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no) -]) -if test "$ac_cv_have_prototypes" = yes; then - AC_DEFINE(HAVE_PROTOTYPES, 1, [Are function prototypes OK?]) -fi - AC_C_CONST AC_C_BIGENDIAN AC_TYPE_SIGNAL @@ -1304,14 +1285,8 @@ ac_cv_func_qsort_argtype, [AC_TRY_COMPILE([ #include "l_stdlib.h" -#ifdef HAVE_PROTOTYPES -#define P(x) x -#else -#define P(x) () -#endif - extern void *base; -extern sortfunc P((const void *, const void *)); +extern sortfunc (const void *, const void *); int sortfunc(a, b) const void *a; const void *b; { return 0; } @@ -1387,13 +1362,8 @@ AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall, #ifdef HAVE_UNISTD_H # include #endif -#ifdef HAVE_PROTOTYPES -#define P(x) x -#else -#define P(x) () -#endif ], - [extern int syscall P((int, ...));], + [extern int syscall (int, ...);], ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)]) case "$ac_cv_decl_syscall" in yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;; diff --git a/include/ntp_rfc2553.h b/include/ntp_rfc2553.h index 662b118942..da73362f9d 100644 --- a/include/ntp_rfc2553.h +++ b/include/ntp_rfc2553.h @@ -260,12 +260,12 @@ struct addrinfo { #define EAI_MAX 14 -int getaddrinfo P((const char *, const char *, - const struct addrinfo *, struct addrinfo **)); -int getnameinfo P((const struct sockaddr *, u_int, char *, - size_t, char *, size_t, int)); -void freeaddrinfo P((struct addrinfo *)); -char *gai_strerror P((int)); +int getaddrinfo (const char *, const char *, + const struct addrinfo *, struct addrinfo **); +int getnameinfo (const struct sockaddr *, u_int, char *, + size_t, char *, size_t, int); +void freeaddrinfo (struct addrinfo *); +char *gai_strerror (int); /* * Constants for getnameinfo() diff --git a/include/ntp_select.h b/include/ntp_select.h index 79c0fc0a56..dd7fc86c98 100644 --- a/include/ntp_select.h +++ b/include/ntp_select.h @@ -11,8 +11,8 @@ #include #else #include -extern int select P((int width, fd_set *pReadFds, fd_set *pWriteFds, - fd_set *pExceptFds, struct timeval *pTimeOut)); +extern int select (int width, fd_set *pReadFds, fd_set *pWriteFds, + fd_set *pExceptFds, struct timeval *pTimeOut); #endif #endif diff --git a/include/ntp_syscall.h b/include/ntp_syscall.h index 521e753f67..6bf4a1d116 100644 --- a/include/ntp_syscall.h +++ b/include/ntp_syscall.h @@ -20,7 +20,7 @@ # define ntp_gettime(t) syscall(SYS_ntp_gettime, (t)) #else /* !NTP_SYSCALLS_STD */ # ifdef HAVE___ADJTIMEX -extern int __adjtimex P((struct timex *)); +extern int __adjtimex (struct timex *); # define ntp_adjtime(t) __adjtimex((t)) diff --git a/include/rsa_md5.h b/include/rsa_md5.h index 8241647601..c66af24d54 100644 --- a/include/rsa_md5.h +++ b/include/rsa_md5.h @@ -39,10 +39,9 @@ typedef struct { unsigned char buffer[64]; /* input buffer */ } MD5_CTX; -void MD5Init PROTO_LIST ((MD5_CTX *)); -void MD5Update PROTO_LIST - ((MD5_CTX *, unsigned char *, unsigned int)); -void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); +void MD5Init (MD5_CTX *); +void MD5Update (MD5_CTX *, unsigned char *, unsigned int); +void MD5Final (unsigned char [16], MD5_CTX *); #ifdef __cplusplus } diff --git a/libntp/audio.c b/libntp/audio.c index 00770c266a..28038c59c4 100644 --- a/libntp/audio.c +++ b/libntp/audio.c @@ -67,8 +67,8 @@ static struct audio_info info; /* audio device info */ static int ctl_fd; /* audio control file descriptor */ #ifdef PCM_STYLE_SOUND -static void audio_config_read P((int, char **, char **)); -static int mixer_name P((const char *, int)); +static void audio_config_read (int, char **, char **); +static int mixer_name (const char *, int); int diff --git a/libntp/md5c.c b/libntp/md5c.c index 07eec6c2f7..ceeb8cbee6 100644 --- a/libntp/md5c.c +++ b/libntp/md5c.c @@ -46,13 +46,11 @@ #define S43 15 #define S44 21 -static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); -static void Encode PROTO_LIST - ((unsigned char *, UINT4 *, unsigned int)); -static void Decode PROTO_LIST - ((UINT4 *, unsigned char *, unsigned int)); -static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); -static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); +static void MD5Transform (UINT4 [4], unsigned char [64]); +static void Encode (unsigned char *, UINT4 *, unsigned int); +static void Decode (UINT4 *, unsigned char *, unsigned int); +static void MD5_memcpy (POINTER, POINTER, unsigned int); +static void MD5_memset (POINTER, int, unsigned int); static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/libntp/syssignal.c b/libntp/syssignal.c index 6ec4c4c16c..68099f5fb3 100644 --- a/libntp/syssignal.c +++ b/libntp/syssignal.c @@ -23,7 +23,7 @@ signal_no_reset( #if defined(__STDC__) || defined(HAVE_STDARG_H) #else int sig; - void (*func) P((int)); + void (*func) (int); #endif { int n; diff --git a/libparse/clk_wharton.c b/libparse/clk_wharton.c index b4332fbcd7..0a1ee0b03a 100644 --- a/libparse/clk_wharton.c +++ b/libparse/clk_wharton.c @@ -30,7 +30,7 @@ #include #else #include "sys/parsestreams.h" -extern void printf P((const char *, ...)); +extern void printf (const char *, ...); #endif /* diff --git a/libparse/parsestreams.c b/libparse/parsestreams.c index 7df3542922..3fb4cc3511 100644 --- a/libparse/parsestreams.c +++ b/libparse/parsestreams.c @@ -77,15 +77,15 @@ static char rcsid[] = "parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_ /* * just make checking compilers more silent */ -extern int printf P((const char *, ...)); -extern int putctl1 P((queue_t *, int, int)); -extern int canput P((queue_t *)); -extern void putbq P((queue_t *, mblk_t *)); -extern void freeb P((mblk_t *)); -extern void qreply P((queue_t *, mblk_t *)); -extern void freemsg P((mblk_t *)); -extern void panic P((const char *, ...)); -extern void usec_delay P((int)); +extern int printf (const char *, ...); +extern int putctl1 (queue_t *, int, int); +extern int canput (queue_t *); +extern void putbq (queue_t *, mblk_t *); +extern void freeb (mblk_t *); +extern void qreply (queue_t *, mblk_t *); +extern void freemsg (mblk_t *); +extern void panic (const char *, ...); +extern void usec_delay (int); #include "parse.h" #include "sys/parsestreams.h" @@ -357,11 +357,11 @@ xxxinit( /*--------------- stream module definition ----------------------------*/ -static int parseopen P((queue_t *, dev_t, int, int)); -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); +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 char mn[] = "parse"; @@ -416,7 +416,7 @@ int cd_invert = 1; /* invert status of CD line - PPS support via CD input */ int parsedebug = ~0; -extern void uniqtime P((struct timeval *)); +extern void uniqtime (struct timeval *); /*--------------- module implementation -----------------------------*/ @@ -429,8 +429,8 @@ extern void uniqtime P((struct timeval *)); }\ } 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 @@ -919,8 +919,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 ---------------*/ @@ -1010,8 +1010,8 @@ struct savedzsops }; struct zsops *emergencyzs; -extern void zsopinit P((struct zscom *, struct zsops *)); -static int zs_xsisr P((struct zscom *)); /* zs external status interupt handler */ +extern void zsopinit (struct zscom *, struct zsops *); +static int zs_xsisr (struct zscom *); /* zs external status interupt handler */ static int init_zs_linemon( @@ -1112,7 +1112,7 @@ close_zs_linemon( #define MAXDEPTH 50 /* maximum allowed stream crawl */ #ifdef PPS_SYNC -extern void hardpps P((struct timeval *, long)); +extern void hardpps (struct timeval *, long); #ifdef PPS_NEW extern struct timeval timestamp; #else @@ -1282,7 +1282,7 @@ zs_xsisr( dname = q->q_qinfo->qi_minfo->mi_idname; if (!Strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname)) { - register int (*zsisr) P((struct zscom *)); + register int (*zsisr) (struct zscom *); /* * back home - phew (hopping along stream queues might diff --git a/ntpd/refclock_ripencc.c b/ntpd/refclock_ripencc.c index d9fa2044cd..994cd0c7bd 100644 --- a/ntpd/refclock_ripencc.c +++ b/ntpd/refclock_ripencc.c @@ -411,33 +411,33 @@ void cmd_0x8EADq (TSIPPKT *cmd); /* header/source border XXXXXXXXXXXXXXXXXXXXXXXXXX */ /* Trimble parse functions */ -static int parse0x8FAD P((TSIPPKT *, struct peer *)); -static int parse0x8F0B P((TSIPPKT *, struct peer *)); +static int parse0x8FAD (TSIPPKT *, struct peer *); +static int parse0x8F0B (TSIPPKT *, struct peer *); #ifdef TRIMBLE_OUTPUT_FUNC -static int parseany P((TSIPPKT *, struct peer *)); -static void TranslateTSIPReportToText P((TSIPPKT *, char *)); +static int parseany (TSIPPKT *, struct peer *); +static void TranslateTSIPReportToText (TSIPPKT *, char *); #endif /* TRIMBLE_OUTPUT_FUNC */ -static int parse0x5C P((TSIPPKT *, struct peer *)); -static int parse0x4F P((TSIPPKT *, struct peer *)); -static void tsip_input_proc P((TSIPPKT *, int)); +static int parse0x5C (TSIPPKT *, struct peer *); +static int parse0x4F (TSIPPKT *, struct peer *); +static void tsip_input_proc (TSIPPKT *, int); /* Trimble helper functions */ -static void bPutFloat P((float *, unsigned char *)); -static void bPutDouble P((double *, unsigned char *)); -static void bPutULong P((unsigned long *, unsigned char *)); -static int print_msg_table_header P((int rptcode, char *HdrStr, int force)); -static char * show_time P((float time_of_week)); +static void bPutFloat (float *, unsigned char *); +static void bPutDouble (double *, unsigned char *); +static void bPutULong (unsigned long *, unsigned char *); +static int print_msg_table_header (int rptcode, char *HdrStr, int force); +static char * show_time (float time_of_week); /* RIPE NCC functions */ -static void ripencc_control P((int, struct refclockstat *, struct - refclockstat *, struct peer *)); -static int ripencc_ppsapi P((struct peer *, int, int)); -static int ripencc_get_pps_ts P((struct ripencc_unit *, l_fp *)); -static int ripencc_start P((int, struct peer *)); -static void ripencc_shutdown P((int, struct peer *)); -static void ripencc_poll P((int, struct peer *)); -static void ripencc_send P((struct peer *, TSIPPKT spt)); -static void ripencc_receive P((struct recvbuf *)); +static void ripencc_control (int, struct refclockstat *, struct + refclockstat *, struct peer *); +static int ripencc_ppsapi (struct peer *, int, int); +static int ripencc_get_pps_ts (struct ripencc_unit *, l_fp *); +static int ripencc_start (int, struct peer *); +static void ripencc_shutdown (int, struct peer *); +static void ripencc_poll (int, struct peer *); +static void ripencc_send (struct peer *, TSIPPKT spt); +static void ripencc_receive (struct recvbuf *); /* fill in reflock structure for our clock */ struct refclock refclock_ripencc = { diff --git a/ntpd/refclock_tpro.c b/ntpd/refclock_tpro.c index 3c425684ec..3c9ddf7eb7 100644 --- a/ntpd/refclock_tpro.c +++ b/ntpd/refclock_tpro.c @@ -42,9 +42,9 @@ struct tprounit { /* * Function prototypes */ -static int tpro_start P((int, struct peer *)); -static void tpro_shutdown P((int, struct peer *)); -static void tpro_poll P((int unit, struct peer *)); +static int tpro_start (int, struct peer *); +static void tpro_shutdown (int, struct peer *); +static void tpro_poll (int unit, struct peer *); /* * Transfer vector diff --git a/ntpd/refclock_tt560.c b/ntpd/refclock_tt560.c index f3d7bc17a7..7aa2180e75 100644 --- a/ntpd/refclock_tt560.c +++ b/ntpd/refclock_tt560.c @@ -47,9 +47,9 @@ typedef union byteswap_u /* * Function prototypes */ -static int tt560_start P((int, struct peer *)); -static void tt560_shutdown P((int, struct peer *)); -static void tt560_poll P((int unit, struct peer *)); +static int tt560_start (int, struct peer *); +static void tt560_shutdown (int, struct peer *); +static void tt560_poll (int unit, struct peer *); /* * Transfer vector diff --git a/sntp/configure.ac b/sntp/configure.ac index 5cc52b12db..e90f3f9531 100644 --- a/sntp/configure.ac +++ b/sntp/configure.ac @@ -96,7 +96,7 @@ case "$ac_cv_have_ss_family_in_struct_ss$ac_cv_have___ss_family_in_struct_ss" in esac # Checks for library functions. -AC_FUNC_MEMCMP +#AC_FUNC_MEMCMP dnl HMS: we don't have a memcmp.c to use here, so why bother? AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL AC_CHECK_FUNCS([alarm]) diff --git a/util/hist.c b/util/hist.c index 9453b6c0dc..244f595fe7 100644 --- a/util/hist.c +++ b/util/hist.c @@ -20,7 +20,7 @@ #define NSRT 20000 /* size of overflow histogram */ #define NCNT (600 * 1000000) /* sample interval (us) */ -int col P((long *, long *)); +int col (long *, long *); int main( diff --git a/util/jitter.h b/util/jitter.h index db55c22c5e..8c774b0909 100644 --- a/util/jitter.h +++ b/util/jitter.h @@ -371,25 +371,25 @@ typedef u_int32 u_fp; * Prototypes */ #if 0 -extern char * dofptoa P((u_fp, int, short, int)); -extern char * dolfptoa P((u_long, u_long, int, short, int)); +extern char * dofptoa (u_fp, int, short, int); +extern char * dolfptoa (u_long, u_long, int, short, int); #endif -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 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); #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/util/tickadj.c b/util/tickadj.c index 4a7f2c4427..48ed869b4b 100644 --- a/util/tickadj.c +++ b/util/tickadj.c @@ -225,10 +225,10 @@ const char *kmem = KMEM; const char *file = NULL; int fd = -1; -static void getoffsets P((off_t *, off_t *, off_t *, off_t *)); -static int openfile P((const char *, int)); -static void writevar P((int, off_t, int)); -static void readvar P((int, off_t, int *)); +static void getoffsets (off_t *, off_t *, off_t *, off_t *); +static int openfile (const char *, int); +static void writevar (int, off_t, int); +static void readvar (int, off_t, int *); /* * main - parse arguments and handle options