]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: debug: mark the RNG's seed as unsigned
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Dec 2020 15:26:36 +0000 (16:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Dec 2020 15:31:08 +0000 (16:31 +0100)
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

index f83a7c018c74bbd465c40562cdc2499fe186e705..460ee4d3c50f4a87498e0a2f7bcc688e34718884 100644 (file)
@@ -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;