Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/libsa/rand.c

1/*
2 *
3 * rand & srand implementation for chameleon by Cadet-petit Armel <armelcadetpetit@gmail.com>
4 */
5
6#include "libsa.h"
7
8static long holdrand = 1L;
9#defineRAND_MAX0x7fffffff
10
11void srand (unsigned int seed)
12{
13holdrand = (long)seed;
14}
15
16int rand (void)
17{
18holdrand = holdrand * 214013L + 2531011L;
19return ((holdrand >> 16) & RAND_MAX);
20}

Archive Download this file

Revision: 1654