diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2021-07-25 06:18:37 +0930 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2021-07-25 11:01:20 +0930 |
commit | 9fbf42754899898934bc8bf4f8eeacba37656fdc (patch) | |
tree | 71290e364a7dd65973cb0cdcef32615c4c8dc374 /src/cairo-cache.c | |
parent | 099d71fb9f267153da8b45adc288f9715fbb4611 (diff) | |
download | cairo-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-cache.c')
-rw-r--r-- | src/cairo-cache.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cairo-cache.c b/src/cairo-cache.c index 5c4e4caa3..96809b585 100644 --- a/src/cairo-cache.c +++ b/src/cairo-cache.c @@ -315,18 +315,18 @@ _cairo_cache_foreach (cairo_cache_t *cache, closure); } -unsigned long +uintptr_t _cairo_hash_string (const char *c) { /* This is the djb2 hash. */ - unsigned long hash = _CAIRO_HASH_INIT_VALUE; + uintptr_t hash = _CAIRO_HASH_INIT_VALUE; while (c && *c) hash = ((hash << 5) + hash) + *c++; return hash; } -unsigned long -_cairo_hash_bytes (unsigned long hash, +uintptr_t +_cairo_hash_bytes (uintptr_t hash, const void *ptr, unsigned int length) { |