From: Willy Tarreau Date: Fri, 18 Dec 2020 15:26:36 +0000 (+0100) Subject: CLEANUP: debug: mark the RNG's seed as unsigned X-Git-Tag: v2.4-dev4~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7ead07b9c31d9648d67c1f652ddf571bf6ea025;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/debug.c b/src/debug.c index f83a7c018c..460ee4d3c5 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;