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-ft-font.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-ft-font.c')
-rw-r--r-- | src/cairo-ft-font.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index 1f5befec3..fca24b3cd 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -397,7 +397,7 @@ _cairo_ft_unscaled_font_init_key (cairo_ft_unscaled_font_t *key, int id, FT_Face face) { - unsigned long hash; + uintptr_t hash; key->from_face = from_face; key->filename = filename; @@ -406,8 +406,8 @@ _cairo_ft_unscaled_font_init_key (cairo_ft_unscaled_font_t *key, hash = _cairo_hash_string (filename); /* the constants are just arbitrary primes */ - hash += ((unsigned long) id) * 1607; - hash += ((unsigned long) face) * 2137; + hash += ((uintptr_t) id) * 1607; + hash += ((uintptr_t) face) * 2137; key->base.hash_entry.hash = hash; } |