cache: Insert explict casts for LP64 systems.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/ChangeLog b/ChangeLog
index 4371d87..dc313a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+ cache: Insert explict casts for LP64 systems.
+
+ * src/cache/ftcbasic.c (FTC_ImageCache_Lookup,
+ FTC_SBitCache_Lookup): The type of FTC_ImageType->width
+ is FT_Int, so the cast to unsigned larger type FT_ULong
+ is introduced for the comparisons with 0x10000L for
+ LP64 platform.
+
+2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
cache: Fix some data types mismatching with their sources.
* src/cache/ftccache.h: The type of return value
diff --git a/src/cache/ftcbasic.c b/src/cache/ftcbasic.c
index 9f822e4..7539f55 100644
--- a/src/cache/ftcbasic.c
+++ b/src/cache/ftcbasic.c
@@ -334,7 +334,7 @@
* This one is a major hack used to detect whether we are passed a
* regular FTC_ImageType handle, or a legacy FTC_OldImageDesc one.
*/
- if ( type->width >= 0x10000 )
+ if ( (FT_ULong)type->width >= 0x10000L )
{
FTC_OldImageDesc desc = (FTC_OldImageDesc)type;
@@ -656,7 +656,7 @@
/* This one is a major hack used to detect whether we are passed a
* regular FTC_ImageType handle, or a legacy FTC_OldImageDesc one.
*/
- if ( type->width >= 0x10000 )
+ if ( (FT_ULong)type->width >= 0x10000L )
{
FTC_OldImageDesc desc = (FTC_OldImageDesc)type;