From a6c1ed4716cf02626ea035beb6dd4a921642ba80 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 3 Jan 2018 17:39:24 -0700 Subject: Use libc from agbcc instead of standalone newlib\nYou must have AGBCC commit 80d029caec189587f8b9294b6c8a5a489b8f5f88 in order to compile pmd_red.gba --- newlib/libc/stdlib/rand.c | 86 ----------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 newlib/libc/stdlib/rand.c (limited to 'newlib/libc/stdlib/rand.c') diff --git a/newlib/libc/stdlib/rand.c b/newlib/libc/stdlib/rand.c deleted file mode 100644 index 3d739ef..0000000 --- a/newlib/libc/stdlib/rand.c +++ /dev/null @@ -1,86 +0,0 @@ -/* -FUNCTION -<>, <>---pseudo-random numbers - -INDEX - rand -INDEX - srand -INDEX - rand_r - -ANSI_SYNOPSIS - #include - int rand(void); - void srand(unsigned int <[seed]>); - int rand_r(unsigned int *<[seed]>); - -TRAD_SYNOPSIS - #include - int rand(); - - void srand(<[seed]>) - unsigned int <[seed]>; - - void rand_r(<[seed]>) - unsigned int *<[seed]>; - - -DESCRIPTION -<> returns a different integer each time it is called; each -integer is chosen by an algorithm designed to be unpredictable, so -that you can use <> when you require a random number. -The algorithm depends on a static variable called the ``random seed''; -starting with a given value of the random seed always produces the -same sequence of numbers in successive calls to <>. - -You can set the random seed using <>; it does nothing beyond -storing its argument in the static variable used by <>. You can -exploit this to make the pseudo-random sequence less predictable, if -you wish, by using some other unpredictable value (often the least -significant parts of a time-varying value) as the random seed before -beginning a sequence of calls to <>; or, if you wish to ensure -(for example, while debugging) that successive runs of your program -use the same ``random'' numbers, you can use <> to set the same -random seed at the outset. - -RETURNS -<> returns the next pseudo-random integer in sequence; it is a -number between <<0>> and <> (inclusive). - -<> does not return a result. - -NOTES -<> and <> are unsafe for multi-thread applications. -<> is MT-Safe and should be used instead. - - -PORTABILITY -<> is required by ANSI, but the algorithm for pseudo-random -number generation is not specified; therefore, even if you use -the same random seed, you cannot expect the same sequence of results -on two different systems. - -<> requires no supporting OS subroutines. -*/ - -#ifndef _REENT_ONLY - -#include -#include - -void -_DEFUN (srand, (seed), unsigned int seed) -{ - _REENT->_new._reent._rand_next = seed; -} - -int -_DEFUN_VOID (rand) -{ - return ((_REENT->_new._reent._rand_next = - _REENT->_new._reent._rand_next * 1103515245 + 12345 ) - & RAND_MAX ); -} - -#endif /* _REENT_ONLY */ -- cgit v1.2.3