develop/ktcc: Post-SVN tidy
- Move source code from `trunk` into program root directory. - Update build files and include paths. - Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden.
This commit is contained in:
15
programs/develop/ktcc/libc.obj/source/stdlib/rand.c
Normal file
15
programs/develop/ktcc/libc.obj/source/stdlib/rand.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static uint64_t seed;
|
||||
|
||||
void srand(unsigned s)
|
||||
{
|
||||
seed = s - 1;
|
||||
}
|
||||
|
||||
int rand(void)
|
||||
{
|
||||
seed = 6364136223846793005ULL * seed + 1;
|
||||
return seed >> 33;
|
||||
}
|
Reference in New Issue
Block a user