summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:33 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:33 +0900
commit6b7c0a901c3ac32ff51d7881bb8342f89765dbdf (patch)
tree6beb11405aea8a116c8cff759533288ef3ee3aa3
parent2abe8d63fc14d7f2ad6511ab7144300369f794b8 (diff)
downloadfreetype2-6b7c0a901c3ac32ff51d7881bb8342f89765dbdf.tar.gz
sfnt: Cast a character code to FT_UInt32 for LP64 system.
-rw-r--r--ChangeLog13
-rw-r--r--src/sfnt/ttcmap.c30
2 files changed, 28 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 44604dcac..433dbc77a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,19 @@
sfnt: Cast a character code to FT_UInt32 for LP64 system.
+ * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary,
+ tt_cmap14_variants, tt_cmap14_char_variants,
+ tt_cmap14_def_char_count, tt_cmap14_get_def_chars,
+ tt_cmap14_get_nondef_chars, tt_cmap14_variant_chars)
+ Insert casts when FT_UInt32 variable is loaded by
+ TT_NEXT_{UINT24|ULONG}. Because most of them are
+ compared with FT_UInt32 values in public API, replacing
+ FT_UFast is not recommended.
+
+2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
+ sfnt: Cast a character code to FT_UInt32 for LP64 system.
+
* src/sfnt/ttcmap.c (tt_cmap4_init, tt_cmap4_next):
Insert the casts from unsigned long constant to
FT_UInt32.
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index c55afe2ba..0aeae5003 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -2912,7 +2912,7 @@
{
FT_UInt32 mid = ( min + max ) >> 1;
FT_Byte* p = base + 5 * mid;
- FT_UInt32 uni = TT_NEXT_UINT24( p );
+ FT_UInt32 uni = (FT_UInt32)TT_NEXT_UINT24( p );
if ( char_code < uni )
@@ -3039,7 +3039,7 @@
result = cmap14->results;
for ( i = 0; i < count; ++i )
{
- result[i] = TT_NEXT_UINT24( p );
+ result[i] = (FT_UInt32)TT_NEXT_UINT24( p );
p += 8;
}
result[i] = 0;
@@ -3089,7 +3089,7 @@
static FT_UInt
tt_cmap14_def_char_count( FT_Byte *p )
{
- FT_UInt32 numRanges = TT_NEXT_ULONG( p );
+ FT_UInt32 numRanges = (FT_UInt32)TT_NEXT_ULONG( p );
FT_UInt tot = 0;
@@ -3116,14 +3116,14 @@
cnt = tt_cmap14_def_char_count( p );
- numRanges = TT_NEXT_ULONG( p );
+ numRanges = (FT_UInt32)TT_NEXT_ULONG( p );
if ( tt_cmap14_ensure( cmap14, ( cnt + 1 ), memory ) )
return NULL;
for ( q = cmap14->results; numRanges > 0; --numRanges )
{
- FT_UInt32 uni = TT_NEXT_UINT24( p );
+ FT_UInt32 uni = (FT_UInt32)TT_NEXT_UINT24( p );
cnt = FT_NEXT_BYTE( p ) + 1;
@@ -3151,7 +3151,7 @@
FT_UInt32 *ret;
- numMappings = TT_NEXT_ULONG( p );
+ numMappings = (FT_UInt32)TT_NEXT_ULONG( p );
if ( tt_cmap14_ensure( cmap14, ( numMappings + 1 ), memory ) )
return NULL;
@@ -3159,7 +3159,7 @@
ret = cmap14->results;
for ( i = 0; i < numMappings; ++i )
{
- ret[i] = TT_NEXT_UINT24( p );
+ ret[i] = (FT_UInt32)TT_NEXT_UINT24( p );
p += 2;
}
ret[i] = 0;
@@ -3213,9 +3213,9 @@
p = cmap->data + nondefOff;
dp = cmap->data + defOff;
- numMappings = TT_NEXT_ULONG( p );
+ numMappings = (FT_UInt32)TT_NEXT_ULONG( p );
dcnt = tt_cmap14_def_char_count( dp );
- numRanges = TT_NEXT_ULONG( dp );
+ numRanges = (FT_UInt32)TT_NEXT_ULONG( dp );
if ( numMappings == 0 )
return tt_cmap14_get_def_chars( cmap, cmap->data + defOff,
@@ -3228,10 +3228,10 @@
return NULL;
ret = cmap14->results;
- duni = TT_NEXT_UINT24( dp );
+ duni = (FT_UInt32)TT_NEXT_UINT24( dp );
dcnt = FT_NEXT_BYTE( dp );
di = 1;
- nuni = TT_NEXT_UINT24( p );
+ nuni = (FT_UInt32)TT_NEXT_UINT24( p );
p += 2;
ni = 1;
i = 0;
@@ -3248,7 +3248,7 @@
if ( di > numRanges )
break;
- duni = TT_NEXT_UINT24( dp );
+ duni = (FT_UInt32)TT_NEXT_UINT24( dp );
dcnt = FT_NEXT_BYTE( dp );
}
else
@@ -3261,7 +3261,7 @@
if ( ni > numMappings )
break;
- nuni = TT_NEXT_UINT24( p );
+ nuni = (FT_UInt32)TT_NEXT_UINT24( p );
p += 2;
}
}
@@ -3274,7 +3274,7 @@
ret[i++] = nuni;
while ( ni < numMappings )
{
- ret[i++] = TT_NEXT_UINT24( p );
+ ret[i++] = (FT_UInt32)TT_NEXT_UINT24( p );
p += 2;
++ni;
}
@@ -3289,7 +3289,7 @@
while ( di < numRanges )
{
- duni = TT_NEXT_UINT24( dp );
+ duni = (FT_UInt32)TT_NEXT_UINT24( dp );
dcnt = FT_NEXT_BYTE( dp );
for ( k = 0; k <= dcnt; ++k )