From 01df5d59e56a1b060568f8cad2e89f7eea22fc70 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 29 Aug 2011 08:51:20 +0200 Subject: xwininfo libX11 libXmu libxcb mesa xserver xkeyboard-config git update 29 aug 2011 --- pixman/test/utils.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'pixman/test/utils.h') diff --git a/pixman/test/utils.h b/pixman/test/utils.h index 615ad7841..f0c9c300c 100644 --- a/pixman/test/utils.h +++ b/pixman/test/utils.h @@ -44,10 +44,14 @@ lcg_rand_N (int max) static inline uint32_t lcg_rand_u32 (void) { - uint32_t lo = lcg_rand(); - uint32_t hi = lcg_rand(); - - return (hi << 16) | lo; + /* This uses the 10/11 most significant bits from the 3 lcg results + * (and mixes them with the low from the adjacent one). + */ + uint32_t lo = lcg_rand() >> -(32 - 15 - 11 * 2); + uint32_t mid = lcg_rand() << (32 - 15 - 11 * 1); + uint32_t hi = lcg_rand() << (32 - 15 - 11 * 0); + + return (hi ^ mid ^ lo); } /* CRC 32 computation @@ -57,6 +61,10 @@ compute_crc32 (uint32_t in_crc32, const void *buf, size_t buf_len); +/* Returns TRUE if running on a little endian system */ +pixman_bool_t +is_little_endian (void); + /* perform endian conversion of pixel data */ void -- cgit v1.2.3