source: azure_iot_hub/trunk/musl-1.1.18/src/prng/rand_r.c@ 388

Last change on this file since 388 was 388, checked in by coas-nagasima, 5 years ago

Azure IoT Hub Device C SDK を使ったサンプルの追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-csrc
File size: 234 bytes
Line 
1#include <stdlib.h>
2
3static unsigned temper(unsigned x)
4{
5 x ^= x>>11;
6 x ^= x<<7 & 0x9D2C5680;
7 x ^= x<<15 & 0xEFC60000;
8 x ^= x>>18;
9 return x;
10}
11
12int rand_r(unsigned *seed)
13{
14 return temper(*seed = *seed * 1103515245 + 12345)/2;
15}
Note: See TracBrowser for help on using the repository browser.