[cairo] [PATCH 2/4] scaled fonts: Use wide enough type for pointer arithmetic

Adrian Johnson ajohnson at redneon.com
Thu Feb 11 03:38:18 CET 2016


On 11/02/16 07:19, Simon Richter wrote:
>  struct _cairo_hash_entry {
> -    unsigned long hash;
> +    intptr_t hash;
>  };

The hash value is used for looking up the hash table (after performing a
hash % table_size). size_t would be a better type since the hash table
object can't exceed size_t. Scaled fonts uses a pointer as a convenient
means of generating a hash value. But the hash value in general is not
intended to contain a pointer.



More information about the cairo mailing list