Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: fusl/src/prng/rand_r.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include <stdlib.h> 1 #include <stdlib.h>
2 2
3 static unsigned temper(unsigned x) 3 static unsigned temper(unsigned x) {
4 { 4 x ^= x >> 11;
5 » x ^= x>>11; 5 x ^= x << 7 & 0x9D2C5680;
6 » x ^= x<<7 & 0x9D2C5680; 6 x ^= x << 15 & 0xEFC60000;
7 » x ^= x<<15 & 0xEFC60000; 7 x ^= x >> 18;
8 » x ^= x>>18; 8 return x;
9 » return x;
10 } 9 }
11 10
12 int rand_r(unsigned *seed) 11 int rand_r(unsigned* seed) {
13 { 12 return temper(*seed = *seed * 1103515245 + 12345) / 2;
14 » return temper(*seed = *seed * 1103515245 + 12345)/2;
15 } 13 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698