]> git.ozlabs.org Git - ppp.git/commitdiff
magic: Remove K&R style of arguments
authorKurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Thu, 26 Sep 2019 07:20:58 +0000 (09:20 +0200)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 1 Oct 2019 22:46:29 +0000 (08:46 +1000)
The __P() macro does not exist in libmusl so
I switched magic.{c,h} to using the std-c argument style, which had
already been used in some functions.

Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
pppd/magic.c
pppd/magic.h

index 2fb23ff4adf48b68e6da309eb90373cd6bcc1d0f..3f3ce32cea67045a6b5872c5fa5665fbe570b942 100644 (file)
@@ -53,8 +53,8 @@
 
 static const char rcsid[] = RCSID;
 
 
 static const char rcsid[] = RCSID;
 
-extern long mrand48 __P((void));
-extern void srand48 __P((long));
+extern long mrand48 (void);
+extern void srand48 (long);
 
 /*
  * magic_init - Initialize the magic number generator.
 
 /*
  * magic_init - Initialize the magic number generator.
@@ -64,7 +64,7 @@ extern void srand48 __P((long));
  * and current time, currently.
  */
 void
  * and current time, currently.
  */
 void
-magic_init()
+magic_init(void)
 {
     long seed;
     struct timeval t;
 {
     long seed;
     struct timeval t;
@@ -78,7 +78,7 @@ magic_init()
  * magic - Returns the next magic number.
  */
 u_int32_t
  * magic - Returns the next magic number.
  */
 u_int32_t
-magic()
+magic(void)
 {
     return (u_int32_t) mrand48();
 }
 {
     return (u_int32_t) mrand48();
 }
@@ -102,20 +102,19 @@ random_bytes(unsigned char *buf, int len)
  */
 
 double
  */
 
 double
-drand48()
+drand48(void)
 {
     return (double)random() / (double)0x7fffffffL; /* 2**31-1 */
 }
 
 long
 {
     return (double)random() / (double)0x7fffffffL; /* 2**31-1 */
 }
 
 long
-mrand48()
+mrand48(void)
 {
     return random();
 }
 
 void
 {
     return random();
 }
 
 void
-srand48(seedval)
-long seedval;
+srand48(long seedval)
 {
     srandom((int)seedval);
 }
 {
     srandom((int)seedval);
 }
index c81213b40545bd204818a4f1053c6aeba5151a53..9d399e307a5fe252321039b708053018054242b8 100644 (file)
@@ -42,8 +42,8 @@
  * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $
  */
 
  * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $
  */
 
-void magic_init __P((void));   /* Initialize the magic number generator */
-u_int32_t magic __P((void));   /* Returns the next magic number */
+void magic_init (void);        /* Initialize the magic number generator */
+u_int32_t magic (void);        /* Returns the next magic number */
 
 /* Fill buffer with random bytes */
 
 /* Fill buffer with random bytes */
-void random_bytes __P((unsigned char *buf, int len));
+void random_bytes (unsigned char *buf, int len);