summaryrefslogtreecommitdiff
path: root/src/cache/ftccache.h
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2015-02-23 08:20:27 +0100
committerWerner Lemberg <wl@gnu.org>2015-02-23 08:20:27 +0100
commit3aaebe3a91e55021d99b06f95594c5ff9181968a (patch)
tree238473f3a53f11cdba21c6b644c83ab6d1c69980 /src/cache/ftccache.h
parent4d1f7af17b4b0966d5ed7fab215fc855fe459345 (diff)
downloadfreetype2-3aaebe3a91e55021d99b06f95594c5ff9181968a.tar.gz
[cache] Replace `FT_PtrDist' with `FT_Offset'.
* src/cache/ftccache.h (FTC_NodeRec): `FT_Offset' (a.k.a. `size_t') is a better choice for `hash' to hold a pointer than `FT_PtrDist' (a.k.a. `ptrdiff_t'), especially since the latter is signed, causing zillions of signedness warnings. [Note that `hash' was of type `FT_UInt32' before the change to `FT_PtrDist.] Update all users. * src/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccmap.c, src/cache/ftcglyph.c, src/cache/ftcglyph.h: Updated.
Diffstat (limited to 'src/cache/ftccache.h')
-rw-r--r--src/cache/ftccache.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cache/ftccache.h b/src/cache/ftccache.h
index ba1dfeeb7..4e17c7afe 100644
--- a/src/cache/ftccache.h
+++ b/src/cache/ftccache.h
@@ -24,8 +24,8 @@
FT_BEGIN_HEADER
-#define _FTC_FACE_ID_HASH( i ) \
- ((FT_PtrDist)(( (FT_PtrDist)(i) >> 3 ) ^ ( (FT_PtrDist)(i) << 7 )))
+#define _FTC_FACE_ID_HASH( i ) \
+ ( ( (FT_Offset)(i) >> 3 ) ^ ( (FT_Offset)(i) << 7 ) )
/* handle to cache object */
typedef struct FTC_CacheRec_* FTC_Cache;
@@ -59,7 +59,7 @@ FT_BEGIN_HEADER
{
FTC_MruNodeRec mru; /* circular mru list pointer */
FTC_Node link; /* used for hashing */
- FT_PtrDist hash; /* used for hashing too */
+ FT_Offset hash; /* used for hashing too */
FT_UShort cache_index; /* index of cache the node belongs to */
FT_Short ref_count; /* reference count for this node */
@@ -80,8 +80,8 @@ FT_BEGIN_HEADER
: ( ( hash ) & ( cache )->mask ) ) )
#else
FT_LOCAL( FTC_Node* )
- ftc_get_top_node_for_hash( FTC_Cache cache,
- FT_PtrDist hash );
+ ftc_get_top_node_for_hash( FTC_Cache cache,
+ FT_Offset hash );
#define FTC_NODE__TOP_FOR_HASH( cache, hash ) \
ftc_get_top_node_for_hash( ( cache ), ( hash ) )
#endif
@@ -179,14 +179,14 @@ FT_BEGIN_HEADER
#ifndef FTC_INLINE
FT_LOCAL( FT_Error )
FTC_Cache_Lookup( FTC_Cache cache,
- FT_PtrDist hash,
+ FT_Offset hash,
FT_Pointer query,
FTC_Node *anode );
#endif
FT_LOCAL( FT_Error )
FTC_Cache_NewNode( FTC_Cache cache,
- FT_PtrDist hash,
+ FT_Offset hash,
FT_Pointer query,
FTC_Node *anode );
@@ -211,7 +211,7 @@ FT_BEGIN_HEADER
FT_BEGIN_STMNT \
FTC_Node *_bucket, *_pnode, _node; \
FTC_Cache _cache = FTC_CACHE(cache); \
- FT_PtrDist _hash = (FT_PtrDist)(hash); \
+ FT_Offset _hash = (FT_Offset)(hash); \
FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \
FT_Bool _list_changed = FALSE; \
\