cff: Fix some data types mismatching with their sources.

This commit is contained in:
suzuki toshiya 2009-07-03 18:01:29 +09:00
parent cac24ae82d
commit 5ac77d159e
3 changed files with 30 additions and 8 deletions

View File

@ -1,3 +1,25 @@
2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
cff: Fix some data types mismatching with their sources.
* src/cff/cffobjs.c (cff_face_init): The type of
`scaling' is matched with the scaling parameter
in FT_Matrix_Multiply_Scaled() and
FT_Vector_Transform_Scaled().
* src/cff/cffparse.c (cff_parse_real): The type of
`power_ten', `scaling', `exponent_add',
`integer_length', `fraction_length',
`new_fraction_length' and `shift' are matched with
the type of `exponent' to avoid unexpected truncation.
(cff_parse_fixed_scaled): The type of `scaling' is
matched with the `scaling' argument to
cff_parse_real().
(cff_parse_fixed_dynamic): Ditto.
(cff_parse_font_matrix): The type of `scaling' is
matched with the `scaling' argument to
cff_parse_dynamic().
2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
autofit: Fix some data types mismatching with their sources.

View File

@ -584,7 +584,7 @@
if ( sub->units_per_em )
{
FT_Int scaling;
FT_Long scaling;
if ( top->units_per_em > 1 && sub->units_per_em > 1 )

View File

@ -130,8 +130,8 @@
static FT_Fixed
cff_parse_real( FT_Byte* start,
FT_Byte* limit,
FT_Int power_ten,
FT_Int* scaling )
FT_Long power_ten,
FT_Long* scaling )
{
FT_Byte* p = start;
FT_UInt nib;
@ -139,7 +139,7 @@
FT_Long result, number, rest, exponent;
FT_Int sign = 0, exponent_sign = 0;
FT_Int exponent_add, integer_length, fraction_length;
FT_Long exponent_add, integer_length, fraction_length;
if ( scaling )
@ -286,7 +286,7 @@
{
if ( exponent > 0 )
{
FT_Int new_fraction_length, shift;
FT_Long new_fraction_length, shift;
/* Make `scaling' as small as possible. */
@ -386,7 +386,7 @@
/* but return `10^scaling' times the number read in */
static FT_Fixed
cff_parse_fixed_scaled( FT_Byte** d,
FT_Int scaling )
FT_Long scaling )
{
return **d == 30 ? cff_parse_real( d[0], d[1], scaling, NULL )
: ( cff_parse_integer( d[0], d[1] ) *
@ -399,7 +399,7 @@
/* the scaling factor (as a power of 10) */
static FT_Fixed
cff_parse_fixed_dynamic( FT_Byte** d,
FT_Int* scaling )
FT_Long* scaling )
{
FT_ASSERT( scaling );
@ -452,7 +452,7 @@
if ( parser->top >= parser->stack + 6 )
{
FT_Int scaling;
FT_Long scaling;
error = CFF_Err_Ok;