aboutsummaryrefslogtreecommitdiffstats
path: root/support/random.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-10-15 09:37:58 +0300
committerArnold D. Robbins <arnold@skeeve.com>2020-10-15 09:37:58 +0300
commit20fec8ce0e2e6c52c23bf1b2fa6ff9846ddf3c01 (patch)
tree6fe5e50ef205750af8914e4032fa66448eb5d198 /support/random.c
parentff37e5d04d28f5d9cd3125ff81487ccfe159a9f4 (diff)
downloadegawk-20fec8ce0e2e6c52c23bf1b2fa6ff9846ddf3c01.tar.gz
egawk-20fec8ce0e2e6c52c23bf1b2fa6ff9846ddf3c01.tar.bz2
egawk-20fec8ce0e2e6c52c23bf1b2fa6ff9846ddf3c01.zip
Update random.c to use prototypes.
Diffstat (limited to 'support/random.c')
-rw-r--r--support/random.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/support/random.c b/support/random.c
index 1aab2b50..8604b036 100644
--- a/support/random.c
+++ b/support/random.c
@@ -270,8 +270,7 @@ static uint32_t *end_ptr = &randtbl[DEG_3 + 1];
static inline uint32_t good_rand(int32_t);
-static inline uint32_t good_rand (x)
- int32_t x;
+static inline uint32_t good_rand (int32_t x)
{
#ifdef USE_WEAK_SEEDING
/*
@@ -316,8 +315,7 @@ static inline uint32_t good_rand (x)
* for default usage relies on values produced by this routine.
*/
void
-srandom(x)
- unsigned long x;
+srandom(unsigned long x)
{
int i, lim;
@@ -408,10 +406,10 @@ srandomdev()
* complain about mis-alignment, but you should disregard these messages.
*/
char *
-initstate(seed, arg_state, n)
- unsigned long seed; /* seed for R.N.G. */
- char *arg_state; /* pointer to state array */
- long n; /* # bytes of state info */
+initstate(
+ unsigned long seed, /* seed for R.N.G. */
+ char *arg_state, /* pointer to state array */
+ long n) /* # bytes of state info */
{
char *ostate = (char *)(&state[-1]);
uint32_t *int_arg_state = (uint32_t *)arg_state;
@@ -476,8 +474,7 @@ initstate(seed, arg_state, n)
* complain about mis-alignment, but you should disregard these messages.
*/
char *
-setstate(arg_state)
- char *arg_state; /* pointer to state array */
+setstate(char *arg_state) /* pointer to state array */
{
uint32_t *new_state = (uint32_t *)arg_state;
uint32_t type = new_state[0] % MAX_TYPES;