summaryrefslogtreecommitdiff
path: root/libc/stdlib/random_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/random_r.c')
-rw-r--r--libc/stdlib/random_r.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/libc/stdlib/random_r.c b/libc/stdlib/random_r.c
index b10f29519..67234048b 100644
--- a/libc/stdlib/random_r.c
+++ b/libc/stdlib/random_r.c
@@ -134,7 +134,7 @@ static const struct random_poly_info random_poly_info =
rear pointers can't wrap on the same call by not testing the rear
pointer if the front one has wrapped. Returns a 31-bit random number. */
-int attribute_hidden __random_r(struct random_data *buf, int32_t *result)
+int random_r(struct random_data *buf, int32_t *result)
{
int32_t *state;
@@ -181,7 +181,8 @@ fail:
__set_errno (EINVAL);
return -1;
}
-strong_alias(__random_r,random_r)
+libc_hidden_proto(random_r)
+libc_hidden_def(random_r)
/* Initialize the random number generator based on the given seed. If the
type is the trivial no-state-information type, just remember the seed.
@@ -191,7 +192,7 @@ strong_alias(__random_r,random_r)
information a given number of times to get rid of any initial dependencies
introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
for default usage relies on values produced by this routine. */
-int attribute_hidden __srandom_r (unsigned int seed, struct random_data *buf)
+int srandom_r (unsigned int seed, struct random_data *buf)
{
int type;
int32_t *state;
@@ -236,7 +237,7 @@ int attribute_hidden __srandom_r (unsigned int seed, struct random_data *buf)
while (--kc >= 0)
{
int32_t discard;
- (void) __random_r (buf, &discard);
+ (void) random_r (buf, &discard);
}
done:
@@ -245,7 +246,8 @@ done:
fail:
return -1;
}
-strong_alias(__srandom_r,srandom_r)
+libc_hidden_proto(srandom_r)
+libc_hidden_def(srandom_r)
/* Initialize the state information in the given array of N bytes for
future random number generation. Based on the number of bytes we
@@ -258,7 +260,7 @@ strong_alias(__srandom_r,srandom_r)
Note: The first thing we do is save the current state, if any, just like
setstate so that it doesn't matter when initstate is called.
Returns a pointer to the old state. */
-int attribute_hidden __initstate_r (unsigned int seed, char *arg_state, size_t n, struct random_data *buf)
+int initstate_r (unsigned int seed, char *arg_state, size_t n, struct random_data *buf)
{
int type;
int degree;
@@ -294,7 +296,7 @@ int attribute_hidden __initstate_r (unsigned int seed, char *arg_state, size_t n
buf->state = state;
- __srandom_r (seed, buf);
+ srandom_r (seed, buf);
state[-1] = TYPE_0;
if (type != TYPE_0)
@@ -306,7 +308,8 @@ fail:
__set_errno (EINVAL);
return -1;
}
-strong_alias(__initstate_r,initstate_r)
+libc_hidden_proto(initstate_r)
+libc_hidden_def(initstate_r)
/* Restore the state from the given state array.
Note: It is important that we also remember the locations of the pointers
@@ -316,7 +319,7 @@ strong_alias(__initstate_r,initstate_r)
to the order in which things are done, it is OK to call setstate with the
same state as the current state
Returns a pointer to the old state information. */
-int attribute_hidden __setstate_r (char *arg_state, struct random_data *buf)
+int setstate_r (char *arg_state, struct random_data *buf)
{
int32_t *new_state = 1 + (int32_t *) arg_state;
int type;
@@ -359,4 +362,5 @@ fail:
__set_errno (EINVAL);
return -1;
}
-strong_alias(__setstate_r,setstate_r)
+libc_hidden_proto(setstate_r)
+libc_hidden_def(setstate_r)