summaryrefslogtreecommitdiff
path: root/src/cairo-toy-font-face.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-toy-font-face.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-toy-font-face.c')
-rw-r--r--src/cairo-toy-font-face.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cairo-toy-font-face.c b/src/cairo-toy-font-face.c
index f51dab5ab..ef7122609 100644
--- a/src/cairo-toy-font-face.c
+++ b/src/cairo-toy-font-face.c
@@ -135,7 +135,7 @@ _cairo_toy_font_face_init_key (cairo_toy_font_face_t *key,
cairo_font_slant_t slant,
cairo_font_weight_t weight)
{
- unsigned long hash;
+ uintptr_t hash;
key->family = family;
key->owns_family = FALSE;
@@ -145,8 +145,8 @@ _cairo_toy_font_face_init_key (cairo_toy_font_face_t *key,
/* 1607 and 1451 are just a couple of arbitrary primes. */
hash = _cairo_hash_string (family);
- hash += ((unsigned long) slant) * 1607;
- hash += ((unsigned long) weight) * 1451;
+ hash += ((uintptr_t) slant) * 1607;
+ hash += ((uintptr_t) weight) * 1451;
key->base.hash_entry.hash = hash;
}