#include <stdlib.h>
#include <stdio.h>
#include <config.h>
-#include "pixman.h"
#include "utils.h"
/* A primitive pseudorandom number generator, taken from POSIX.1-2001 example */
-static uint32_t lcg_seed;
-
-static inline uint32_t
-lcg_rand (void)
-{
- lcg_seed = lcg_seed * 1103515245 + 12345;
- return ((uint32_t)(lcg_seed / 65536) % 32768);
-}
-
-static inline void
-lcg_srand (uint32_t seed)
-{
- lcg_seed = seed;
-}
-
-static inline uint32_t
-lcg_rand_n (int max)
-{
- return lcg_rand () % max;
-}
-
static void *
aligned_malloc (size_t align, size_t size)
{
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
-#include "pixman.h"
#include "utils.h"
-/* A primitive pseudorandom number generator, taken from POSIX.1-2001 example */
-
-static uint32_t lcg_seed;
-
-uint32_t
-lcg_rand (void)
-{
- lcg_seed = lcg_seed * 1103515245 + 12345;
- return ((uint32_t)(lcg_seed / 65536) % 32768);
-}
-
-void
-lcg_srand (uint32_t seed)
-{
- lcg_seed = seed;
-}
-
-uint32_t
-lcg_rand_n (int max)
-{
- return lcg_rand () % max;
-}
-
/* perform endian conversion of pixel data */
static void
image_endian_swap (pixman_image_t *img,
#include "utils.h"
+/* Random number seed
+ */
+
+uint32_t lcg_seed;
+
/*----------------------------------------------------------------------------*\
* CRC-32 version 2.0.0 by Craig Bruce, 2006-04-29.
*
#include <stdlib.h>
-#include "pixman.h"
+#include <config.h>
+#include "pixman-private.h" /* For 'inline' definition */
+/* A primitive pseudorandom number generator,
+ * taken from POSIX.1-2001 example
+ */
+
+extern uint32_t lcg_seed;
+
+static inline uint32_t
+lcg_rand (void)
+{
+ lcg_seed = lcg_seed * 1103515245 + 12345;
+ return ((uint32_t)(lcg_seed / 65536) % 32768);
+}
+
+static inline void
+lcg_srand (uint32_t seed)
+{
+ lcg_seed = seed;
+}
+
+static inline uint32_t
+lcg_rand_n (int max)
+{
+ return lcg_rand () % max;
+}
+
+
+/* CRC 32 computation
+ */
uint32_t
compute_crc32 (uint32_t in_crc32,
const void *buf,
size_t buf_len);
+