From c7ead07b9c31d9648d67c1f652ddf571bf6ea025 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 18 Dec 2020 16:26:36 +0100 Subject: [PATCH] CLEANUP: debug: mark the RNG's seed as unsigned Since commit 8a069eb9a ("MINOR: debug: add a trivial PRNG for scheduler stress-tests"), 32-bit gcc 4.7 emits this warning when parsing the initial seed for the debugger's RNG (2463534242): src/debug.c:46:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default] Let's mark it explicitly unsigned. --- src/debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/debug.c b/src/debug.c index f83a7c018..460ee4d3c 100644 --- a/src/debug.c +++ b/src/debug.c @@ -43,10 +43,9 @@ volatile unsigned long threads_to_dump = 0; unsigned int debug_commands_issued = 0; /* Xorshift RNGs from http://www.jstatsoft.org/v08/i14/paper */ -static THREAD_LOCAL unsigned int y = 2463534242; +static THREAD_LOCAL unsigned int y = 2463534242U; static unsigned int debug_prng() { - y ^= y << 13; y ^= y >> 17; y ^= y << 5;