summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:29 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:29 +0900
commit5ac77d159e1a972743064b40827397d9c6dcd954 (patch)
treee852d8549a359b34eafa7c5825edea0d2d5c1545
parentcac24ae82d13d6ecebd6af230e59723aaabd9e9f (diff)
downloadfreetype2-5ac77d159e1a972743064b40827397d9c6dcd954.tar.gz
cff: Fix some data types mismatching with their sources.
-rw-r--r--ChangeLog22
-rw-r--r--src/cff/cffobjs.c2
-rw-r--r--src/cff/cffparse.c14
3 files changed, 30 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index a23dab0ce..1991d3d66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
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.
* src/autofit/afglobal.c: Correct the type of
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 555f2b0b9..e0966e0d3 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -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 )
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index 57cfdc897..947ec9d34 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -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;