scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <stdlib.h>
 2
 3#undef srand
 4#undef rand
 5
 6static unsigned long next;
 7
 8void
 9srand(unsigned seed)
10{
11	next = seed;
12}
13
14int
15rand(void)
16{
17	/*
18	 * next is just an arbitrary number
19	 * used to generate a random number
20	 * which is <= RAND_MAX
21	 */
22	next = next * 1103515245 + 12345;
23	return (unsigned)(next/65536) % (RAND_MAX + 1);
24}