ReactOS 0.4.16-dev-109-gf4cb10f
rand.c File Reference
#include <precomp.h>
#include <ntsecapi.h>
#include <internal/tls.h>
Include dependency graph for rand.c:

Go to the source code of this file.

Functions

int rand (void)
 
void srand (unsigned int seed)
 

Function Documentation

◆ rand()

int rand ( void  )

Definition at line 10 of file rand.c.

11{
13
14 /* this is the algorithm used by MSVC, according to
15 * http://en.wikipedia.org/wiki/List_of_pseudorandom_number_generators */
16 data->random_seed = data->random_seed * 214013 + 2531011;
17 return (data->random_seed >> 16) & RAND_MAX;
18}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define RAND_MAX
Definition: stdlib.h:87
thread_data_t * msvcrt_get_thread_data(void)
Definition: tls.c:31

◆ srand()

void srand ( unsigned int  seed)

Definition at line 24 of file rand.c.

25{
27 data->random_seed = seed;
28}