diff options
author | marha <marha@users.sourceforge.net> | 2010-12-19 17:44:53 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-12-19 17:44:53 +0000 |
commit | b24af6c6af003368ebb5c3e042db0ab7a295d89e (patch) | |
tree | 264d7e2272a674e3c4a6034d127cbc95def12725 /pixman/test/utils.h | |
parent | f851244b9298d88c29331ab285c2839d8bee6925 (diff) | |
download | vcxsrv-b24af6c6af003368ebb5c3e042db0ab7a295d89e.tar.gz vcxsrv-b24af6c6af003368ebb5c3e042db0ab7a295d89e.tar.bz2 vcxsrv-b24af6c6af003368ebb5c3e042db0ab7a295d89e.zip |
libXext libXdmcp pixman git update 29/12/2010
Diffstat (limited to 'pixman/test/utils.h')
-rw-r--r-- | pixman/test/utils.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/pixman/test/utils.h b/pixman/test/utils.h index e6122119a..90a84cd0e 100644 --- a/pixman/test/utils.h +++ b/pixman/test/utils.h @@ -3,6 +3,8 @@ #include <assert.h>
#include "pixman-private.h" /* For 'inline' definition */
+#define ARRAY_LENGTH(A) ((int) (sizeof (A) / sizeof ((A) [0])))
+
/* A primitive pseudorandom number generator,
* taken from POSIX.1-2001 example
*/
@@ -39,6 +41,15 @@ lcg_rand_N (int max) return (lo | hi) % max;
}
+static inline uint32_t
+lcg_rand_u32 (void)
+{
+ uint32_t lo = lcg_rand();
+ uint32_t hi = lcg_rand();
+
+ return (hi << 16) | lo;
+}
+
/* CRC 32 computation
*/
uint32_t
@@ -55,7 +66,7 @@ image_endian_swap (pixman_image_t *img, int bpp); * so that out-of-bounds access will cause segfaults
*/
void *
-fence_malloc (uint32_t len);
+fence_malloc (int64_t len);
void
fence_free (void *data);
@@ -80,6 +91,9 @@ fuzzer_test_main (const char *test_name, void
fail_after (int seconds, const char *msg);
+/* If possible, enable traps for floating point exceptions */
+void enable_fp_exceptions(void);
+
/* A pair of macros which can help to detect corruption of
* floating point registers after a function call. This may
* happen if _mm_empty() call is forgotten in MMX/SSE2 fast
@@ -118,3 +132,6 @@ fail_after (int seconds, const char *msg); /* Try to get an aligned memory chunk */
void *
aligned_malloc (size_t align, size_t size);
+
+void
+initialize_palette (pixman_indexed_t *palette, uint32_t depth, int is_rgb);
|