summaryrefslogtreecommitdiff
path: root/src/cairo-mempool.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2021-07-25 06:18:37 +0930
committerAdrian Johnson <ajohnson@redneon.com>2021-07-25 11:01:20 +0930
commit9fbf42754899898934bc8bf4f8eeacba37656fdc (patch)
tree71290e364a7dd65973cb0cdcef32615c4c8dc374 /src/cairo-mempool.c
parent099d71fb9f267153da8b45adc288f9715fbb4611 (diff)
downloadcairo-9fbf42754899898934bc8bf4f8eeacba37656fdc.tar.gz
Use uintptr_t for all casts between pointer and integer
On 64-bit windows, long is 32-bit. When compiling there are a large number of warnings about mismatched sizes when casting long to/from a pointer. Use the (u)intptr_t type for any integer that will have a pointer stored in it. Use a (u)intptr_t cast when integers are stored in pointers to silence warnings. Fixes #263
Diffstat (limited to 'src/cairo-mempool.c')
-rw-r--r--src/cairo-mempool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cairo-mempool.c b/src/cairo-mempool.c
index ce40ce521..6ba254690 100644
--- a/src/cairo-mempool.c
+++ b/src/cairo-mempool.c
@@ -284,19 +284,19 @@ _cairo_mempool_init (cairo_mempool_t *pool,
void *base, size_t bytes,
int min_bits, int num_sizes)
{
- unsigned long tmp;
+ uintptr_t tmp;
int num_blocks;
int i;
/* Align the start to an integral chunk */
- tmp = ((unsigned long) base) & ((1 << min_bits) - 1);
+ tmp = ((uintptr_t) base) & ((1 << min_bits) - 1);
if (tmp) {
tmp = (1 << min_bits) - tmp;
base = (char *)base + tmp;
bytes -= tmp;
}
- assert ((((unsigned long) base) & ((1 << min_bits) - 1)) == 0);
+ assert ((((uintptr_t) base) & ((1 << min_bits) - 1)) == 0);
assert (num_sizes < ARRAY_LENGTH (pool->free));
pool->base = base;