From e6a3df6ca6e8fac99736789ac1e82647cd0686e8 Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 14 Nov 2022 13:14:25 -0800 Subject: [PATCH] Move `xoshiro_seed` debug print to top In its previous location, it would only print the value of `s` after it had been mutated by `splitmix32` four times, and it doesn't get used after that, so the print isn't very useful. Mixing code and declarations here is fine because starting from a few months ago, we compile with C99 and if we ever need to compile with C90 then it's trivial to add braces surrounding the declarations. --- desktop_version/src/Xoshiro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Xoshiro.c b/desktop_version/src/Xoshiro.c index 1af6f929..c10d8d07 100644 --- a/desktop_version/src/Xoshiro.c +++ b/desktop_version/src/Xoshiro.c @@ -53,13 +53,13 @@ uint32_t xoshiro_next(void) void xoshiro_seed(uint32_t s) { + vlog_debug("Xoshiro seeded with %u.", s); + const uint32_t s0 = splitmix32(&s); const uint32_t s1 = splitmix32(&s); const uint32_t s2 = splitmix32(&s); const uint32_t s3 = splitmix32(&s); seed(s0, s1, s2, s3); - - vlog_debug("Xoshiro seeded with %u.", s); } float xoshiro_rand(void)