From 94ecebc42368bd20dc671baaf397c136c530d09d Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 1 Dec 2008 09:43:37 +0000 Subject: 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 --- libc/stdlib/random.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'libc/stdlib/random.c') diff --git a/libc/stdlib/random.c b/libc/stdlib/random.c index 6d5d06e09..967a1e52a 100644 --- a/libc/stdlib/random.c +++ b/libc/stdlib/random.c @@ -74,11 +74,7 @@ __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); -/* For each of the currently supported random number generators, we have a - break value on the amount of state information (you need at least this many - bytes of state info to support this random number generator), a degree for - the polynomial (actually a trinomial) that the R.N.G. is based on, and - separation between the two lower order coefficients of the trinomial. */ +/* Keep constants in sync with random_r.c */ /* Linear congruential. */ #define TYPE_0 0 @@ -110,13 +106,8 @@ __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); #define DEG_4 63 #define SEP_4 1 - -/* Array versions of the above information to make code run faster. - Relies on fact that TYPE_i == i. */ - #define MAX_TYPES 5 /* Max number of types above. */ - /* Initially, everything is set up as if from: initstate(1, randtbl, 128); Note that this initialization takes advantage of the fact that srandom -- cgit v1.2.3