summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2017-09-11 19:23:14 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2017-09-13 17:11:13 +0900
commit7576da1c3efd7d4c6471acb5be5caba161da6990 (patch)
treee72db0984bfab37dac3ba5439a2121ea387794ce
parent5d2e1ac3b679f4fb9649519d40d71d0f75fd0064 (diff)
downloadfreetype2-7576da1c3efd7d4c6471acb5be5caba161da6990.tar.gz
[cff] internal API is changed incompatibly for 16bit & ILP64 systems.
bias calculation is expected to be ILP32, LP64 or LLP64 systems (int = 32bit). Some internal variables and internal APIs are extended to use 32bit type for 16bit systems. Using long type is too large on LP64 systems, and induces the incompatible change of the internal API for 32bit systems, it should be avoided.
-rw-r--r--src/cff/cffgload.c10
-rw-r--r--src/cff/cffgload.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 20f3a2c28..b461d0a22 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -342,11 +342,11 @@
/* */
/* <Return> */
/* The bias value. */
- static FT_Int
+ static FT_Int32
cff_compute_bias( FT_Int in_charstring_type,
FT_UInt num_subrs )
{
- FT_Int result;
+ FT_Int32 result;
if ( in_charstring_type == 1 )
@@ -2326,7 +2326,7 @@
end = FT_MIN( idx + count, CFF_MAX_TRANS_ELEMENTS );
if ( idx < end )
- decoder->buildchar[idx] = 1 << 16;
+ decoder->buildchar[idx] = (FT_Fixed)1 << 16;
for ( i = idx + 1; i < end; i++ )
decoder->buildchar[i] = 0;
@@ -2526,7 +2526,7 @@
case cff_op_callsubr:
{
- FT_UInt idx = (FT_UInt)( ( args[0] >> 16 ) +
+ FT_UInt32 idx = (FT_UInt32)( ( args[0] >> 16 ) +
decoder->locals_bias );
@@ -2570,7 +2570,7 @@
case cff_op_callgsubr:
{
- FT_UInt idx = (FT_UInt)( ( args[0] >> 16 ) +
+ FT_UInt32 idx = (FT_UInt32)( ( args[0] >> 16 ) +
decoder->globals_bias );
diff --git a/src/cff/cffgload.h b/src/cff/cffgload.h
index 0fa93b439..dfa1f75ba 100644
--- a/src/cff/cffgload.h
+++ b/src/cff/cffgload.h
@@ -183,8 +183,8 @@ FT_BEGIN_HEADER
FT_UInt num_locals;
FT_UInt num_globals;
- FT_Int locals_bias;
- FT_Int globals_bias;
+ FT_Int32 locals_bias;
+ FT_Int32 globals_bias;
FT_Byte** locals;
FT_Byte** globals;