summaryrefslogtreecommitdiff
path: root/libc/stdlib/random_r.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-01 09:43:37 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-01 09:43:37 +0000
commit94ecebc42368bd20dc671baaf397c136c530d09d (patch)
tree0ff49d2dab95a69bdcd8891be2df5caaab09018d /libc/stdlib/random_r.c
parent3b1b9d4638f0b92c161453f2896355183296803f (diff)
random: use smaller data fields where appropriate
text data bss dec hex filename - 130 156 0 286 11e libc/stdlib/random.o + 130 148 0 278 116 libc/stdlib/random.o - 586 0 0 586 24a libc/stdlib/random_r.o + 570 0 0 570 23a libc/stdlib/random_r.o
Diffstat (limited to 'libc/stdlib/random_r.c')
-rw-r--r--libc/stdlib/random_r.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libc/stdlib/random_r.c b/libc/stdlib/random_r.c
index b6ff6afd2..cb70b7dc4 100644
--- a/libc/stdlib/random_r.c
+++ b/libc/stdlib/random_r.c
@@ -27,8 +27,7 @@
#include <limits.h>
#include <stddef.h>
#include <stdlib.h>
-
-
+#include <unistd.h>
/* An improved random number generation package. In addition to the standard
rand()/srand() like interface, this package also has a special state info
@@ -109,8 +108,8 @@
struct random_poly_info
{
- int seps[MAX_TYPES];
- int degrees[MAX_TYPES];
+ smallint seps[MAX_TYPES];
+ smallint degrees[MAX_TYPES];
};
static const struct random_poly_info random_poly_info =
@@ -121,7 +120,6 @@ static const struct random_poly_info random_poly_info =
-
/* If we are using the trivial TYPE_0 R.N.G., just do the old linear
congruential bit. Otherwise, we do our fancy trinomial stuff, which is the
same in all the other cases due to all the global variables that have been