aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/utils.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-08-29 08:51:20 +0200
committermarha <marha@users.sourceforge.net>2011-08-29 08:51:20 +0200
commit01df5d59e56a1b060568f8cad2e89f7eea22fc70 (patch)
tree9db83037fd85d0974b60fc1a05e0665083f26000 /pixman/test/utils.h
parentfd1f4d9fe3ea67fa6def8ee4927a8f71e0440f12 (diff)
downloadvcxsrv-01df5d59e56a1b060568f8cad2e89f7eea22fc70.tar.gz
vcxsrv-01df5d59e56a1b060568f8cad2e89f7eea22fc70.tar.bz2
vcxsrv-01df5d59e56a1b060568f8cad2e89f7eea22fc70.zip
xwininfo libX11 libXmu libxcb mesa xserver xkeyboard-config git update 29
aug 2011
Diffstat (limited to 'pixman/test/utils.h')
-rw-r--r--pixman/test/utils.h16
1 files changed, 12 insertions, 4 deletions
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