Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/modules/GUI/rand.c

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

Archive Download this file

Revision: 789