From 795aebbee77bb74d8792df96dfe1aa79ec9548fc Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 10 Jul 2017 15:02:38 -0700 Subject: Give up on uncrustify; switch to clang-format. --- src/platform/posix/posix_rand.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/platform/posix/posix_rand.c') diff --git a/src/platform/posix/posix_rand.c b/src/platform/posix/posix_rand.c index 11d166bd..4322e491 100644 --- a/src/platform/posix/posix_rand.c +++ b/src/platform/posix/posix_rand.c @@ -12,14 +12,14 @@ #ifdef PLATFORM_POSIX_RANDOM -#include #include +#include #include +#include #include -#include #include -#include -#include +#include +#include #ifdef NNG_USE_GETRANDOM #include @@ -34,17 +34,17 @@ // really really you want to have more data than this available, especially // for cryptographic applications. struct nni_plat_prng_x { - nni_time now; - pid_t pid; - uid_t uid; - struct utsname uts; + nni_time now; + pid_t pid; + uid_t uid; + struct utsname uts; }; void nni_plat_seed_prng(void *buf, size_t bufsz) { struct nni_plat_prng_x x; - int i; + int i; memset(buf, 0, bufsz); @@ -75,21 +75,20 @@ nni_plat_seed_prng(void *buf, size_t bufsz) // limited of systems, we have at least *some* level of randomness. // The mixing is done in a way to avoid diminishing entropy we may // have already collected. - memset(&x, 0, sizeof (x)); // satisfy valgrind + memset(&x, 0, sizeof(x)); // satisfy valgrind x.now = nni_clock(); x.pid = getpid(); x.uid = getuid(); uname(&x.uts); - for (i = 0; (i < bufsz) && (i < sizeof (x)); i++) { + for (i = 0; (i < bufsz) && (i < sizeof(x)); i++) { ((uint8_t *) buf)[i] ^= ((uint8_t *) &x)[i]; } } - #else // Suppress empty symbols warnings in ranlib. int nni_posix_rand_not_used = 0; -#endif // PLATFORM_POSIX_RANDOM +#endif // PLATFORM_POSIX_RANDOM -- cgit v1.2.3-70-g09d2