diff options
author | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2010-10-25 02:07:52 +0900 |
---|---|---|
committer | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2010-10-25 02:08:56 +0900 |
commit | 3512a71269d8916bf93c324d6058ab3a535dbb08 (patch) | |
tree | 0a291430f85dabbb4749fbf7edb56573a44b7301 /src/cache/ftcglyph.c | |
parent | 61590b73d176ee5bb5adf02fe87886ee8286ffdc (diff) |
[cache] Change the hash types to FT_PtrDist.
On LLP64 platforms (e.g. Win64), FT_ULong (32-bit)
variables are inappropriate to calculate hash values
from the memory address (64-bit). The hash variables
are extended from FT_ULong to FT_PtrDist and new
hashing macro functions are introduced. The hash
values on 16-bit memory platforms are changed, but
ILP32 and LP64 are not changed. The hash value in
the cache subsystem is not reverted to the memory
address, so using signed type FT_PtrDist is safe.
* src/cache/ftccache.h (_FTC_FACE_ID_HASH): New hash
function to replace FTC_FACE_ID_HASH() for portability.
* src/cache/ftcmanag.h (FTC_SCALER_HASH): Replace
FTC_FACE_ID_HASH() by _FTC_FACE_ID_HASH().
* src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto.
* src/cache/ftccache.h (FTC_NodeRec): The type of the
member `hash' is changed from FT_UInt32 to FT_PtrDist.
* src/cache/ftccache.h (FTC_Cache_Lookup): The type of the
argument `hash' is changed from FT_UInt32 to FT_PtrDist.
(FTC_Cache_NewNode): Ditto.
* src/cache/ftccache.c (ftc_cache_add): Ditto.
(FTC_Cache_Lookup): Ditto. (FTC_Cache_NewNode): Ditto.
* src/cache/ftcglyph.h (FTC_GCache_Lookup): Ditto.
* src/cache/ftcglyph.c (FTC_GCache_Lookup): Ditto.
* src/cache/ftcbasic.c (FTC_ImageCache_Lookup): The type
of the internal variable `hash' is changed to FT_PtrDist
from FT_UInt32. (FTC_ImageCache_LookupScaler): Ditto.
(FTC_SBitCache_Lookup): Ditto.
(FTC_SBitCache_LookupScaler): Ditto.
* src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto.
* src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Ditto.
Also the type of the internal variable `_idx' is changed to
FT_PtrDist from FT_UInt32 for better pointer calculation.
Diffstat (limited to 'src/cache/ftcglyph.c')
-rw-r--r-- | src/cache/ftcglyph.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cache/ftcglyph.c b/src/cache/ftcglyph.c index a9ab0c31..a73e2431 100644 --- a/src/cache/ftcglyph.c +++ b/src/cache/ftcglyph.c @@ -175,7 +175,7 @@ FT_LOCAL_DEF( FT_Error ) FTC_GCache_Lookup( FTC_GCache cache, - FT_UInt32 hash, + FT_PtrDist hash, FT_UInt gindex, FTC_GQuery query, FTC_Node *anode ) |