[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.
This commit is contained in:
suzuki toshiya 2017-09-11 19:23:14 +09:00
parent 5d2e1ac3b6
commit 7576da1c3e
2 changed files with 7 additions and 7 deletions

View File

@ -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 );

View File

@ -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;