* src/type1/t1load.c: fixed memory leak bugs that appeared with certain

synthetized fonts (e.g. CourierBoldOblique, a.k.a. "cobo_____.pfb")

	* src/pshinter/pshalgo2.c, src/pshinter/pshalgo1.c,
	src/pshinter/pshglob.c: removing compiler warnings in pedantic modes
	(in multi-object compilation mode, mainly)
This commit is contained in:
David Turner 2001-10-21 15:41:11 +00:00
parent e6eaadf683
commit 12d40dac42
7 changed files with 1060 additions and 1033 deletions

View File

@ -1,3 +1,10 @@
2001-10-21 David Turner <david@freetype.org>
* src/pshinter/pshalgo2.c, src/pshinter/pshalgo1.c,
src/pshinter/pshglob.c: removing compiler warnings in pedantic modes
(in multi-object compilation mode, mainly)
2001-10-20 Tom Kacvinsky <tjk@ams.org> 2001-10-20 Tom Kacvinsky <tjk@ams.org>
* src/type1/t1load.c (parse_encoding): Add a test to make sure * src/type1/t1load.c (parse_encoding): Add a test to make sure
@ -12,6 +19,7 @@
objects were not deallocated when the objects were parsed the objects were not deallocated when the objects were parsed the
second time. second time.
2001-10-19 David Turner <david@freetype.org> 2001-10-19 David Turner <david@freetype.org>
* src/smooth/ftgrays.c, src/pshinter/pshglob.h, src/pshinter/pshrec.c, * src/smooth/ftgrays.c, src/pshinter/pshglob.h, src/pshinter/pshrec.c,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -311,7 +311,7 @@
ps_simple_scale( PSH1_Hint_Table table, ps_simple_scale( PSH1_Hint_Table table,
FT_Fixed scale, FT_Fixed scale,
FT_Fixed delta, FT_Fixed delta,
FT_Bool vertical ) FT_Int vertical )
{ {
PSH1_Hint hint; PSH1_Hint hint;
FT_UInt count; FT_UInt count;
@ -335,12 +335,14 @@
psh1_hint_table_optimize( PSH1_Hint_Table table, psh1_hint_table_optimize( PSH1_Hint_Table table,
PSH_Globals globals, PSH_Globals globals,
FT_Outline* outline, FT_Outline* outline,
FT_Bool vertical ) FT_Int vertical )
{ {
PSH_Dimension dim = &globals->dimension[vertical]; PSH_Dimension dim = &globals->dimension[vertical];
FT_Fixed scale = dim->scale_mult; FT_Fixed scale = dim->scale_mult;
FT_Fixed delta = dim->scale_delta; FT_Fixed delta = dim->scale_delta;
FT_UNUSED(outline);
#ifdef DEBUG_HINTER #ifdef DEBUG_HINTER
if ( ps_debug_no_vert_hints && vertical ) if ( ps_debug_no_vert_hints && vertical )
{ {
@ -385,7 +387,8 @@
hint->cur_len = fit_len; hint->cur_len = fit_len;
/* check blue zones for horizontal stems */ /* check blue zones for horizontal stems */
align.align = 0; align.align = 0;
align.align_bot = align.align_top = 0;
if (!vertical) if (!vertical)
{ {
psh_blues_snap_stem( &globals->blues, psh_blues_snap_stem( &globals->blues,
@ -627,7 +630,7 @@
psh1_hint_table_tune_outline( PSH1_Hint_Table table, psh1_hint_table_tune_outline( PSH1_Hint_Table table,
FT_Outline* outline, FT_Outline* outline,
PSH_Globals globals, PSH_Globals globals,
FT_Bool vertical ) FT_Int vertical )
{ {
FT_UInt count, first, last; FT_UInt count, first, last;
@ -707,8 +710,8 @@
PSH_Globals globals ) PSH_Globals globals )
{ {
PSH1_Hint_TableRec hints; PSH1_Hint_TableRec hints;
FT_Error error; FT_Error error = 0;
FT_Int dimension; FT_Int dimension;
for ( dimension = 1; dimension >= 0; dimension-- ) for ( dimension = 1; dimension >= 0; dimension-- )
{ {

View File

@ -317,7 +317,7 @@
ps_simple_scale( PSH2_Hint_Table table, ps_simple_scale( PSH2_Hint_Table table,
FT_Fixed scale, FT_Fixed scale,
FT_Fixed delta, FT_Fixed delta,
FT_Bool vertical ) FT_Int vertical )
{ {
PSH2_Hint hint; PSH2_Hint hint;
FT_UInt count; FT_UInt count;
@ -339,7 +339,7 @@
static void static void
psh2_hint_align( PSH2_Hint hint, psh2_hint_align( PSH2_Hint hint,
PSH_Globals globals, PSH_Globals globals,
FT_Bool vertical ) FT_Int vertical )
{ {
PSH_Dimension dim = &globals->dimension[vertical]; PSH_Dimension dim = &globals->dimension[vertical];
FT_Fixed scale = dim->scale_mult; FT_Fixed scale = dim->scale_mult;
@ -370,6 +370,8 @@
/* check blue zones for horizontal stems */ /* check blue zones for horizontal stems */
align.align = 0; align.align = 0;
align.align_bot = align.align_top = 0;
if (!vertical) if (!vertical)
{ {
psh_blues_snap_stem( &globals->blues, psh_blues_snap_stem( &globals->blues,
@ -458,7 +460,7 @@
static void static void
psh2_hint_table_align_hints( PSH2_Hint_Table table, psh2_hint_table_align_hints( PSH2_Hint_Table table,
PSH_Globals globals, PSH_Globals globals,
FT_Bool vertical ) FT_Int vertical )
{ {
PSH2_Hint hint; PSH2_Hint hint;
FT_UInt count; FT_UInt count;
@ -616,6 +618,7 @@
} }
#endif #endif
#if 0
/* tune a single coordinate with the current interpolation zones */ /* tune a single coordinate with the current interpolation zones */
static FT_Pos static FT_Pos
psh2_hint_table_tune_coord( PSH2_Hint_Table table, psh2_hint_table_tune_coord( PSH2_Hint_Table table,
@ -652,7 +655,7 @@
return FT_MulFix( coord, zone->scale ) + zone->delta; return FT_MulFix( coord, zone->scale ) + zone->delta;
} }
#endif
#if 0 #if 0
/* tune a given outline with current interpolation zones */ /* tune a given outline with current interpolation zones */
@ -661,7 +664,7 @@
psh2_hint_table_tune_outline( PSH2_Hint_Table table, psh2_hint_table_tune_outline( PSH2_Hint_Table table,
FT_Outline* outline, FT_Outline* outline,
PSH_Globals globals, PSH_Globals globals,
FT_Bool vertical ) FT_Int vertical )
{ {
FT_UInt count, first, last; FT_UInt count, first, last;
@ -887,12 +890,12 @@
dxi = vec[n].x - vec[n_prev].x; dxi = vec[n].x - vec[n_prev].x;
dyi = vec[n].y - vec[n_prev].y; dyi = vec[n].y - vec[n_prev].y;
point->dir_in = psh2_compute_dir( dxi, dyi ); point->dir_in = (FT_Char) psh2_compute_dir( dxi, dyi );
dxo = vec[n_next].x - vec[n].x; dxo = vec[n_next].x - vec[n].x;
dyo = vec[n_next].y - vec[n].y; dyo = vec[n_next].y - vec[n].y;
point->dir_out = psh2_compute_dir( dxo, dyo ); point->dir_out = (FT_Char) psh2_compute_dir( dxo, dyo );
/* detect smooth points */ /* detect smooth points */
if ( point->flags & PSH2_POINT_OFF ) if ( point->flags & PSH2_POINT_OFF )
@ -952,7 +955,7 @@
/* load outline point coordinates into hinter glyph */ /* load outline point coordinates into hinter glyph */
static void static void
psh2_glyph_load_points( PSH2_Glyph glyph, psh2_glyph_load_points( PSH2_Glyph glyph,
FT_Bool vertical ) FT_Int vertical )
{ {
FT_Vector* vec = glyph->outline->points; FT_Vector* vec = glyph->outline->points;
PSH2_Point point = glyph->points; PSH2_Point point = glyph->points;
@ -978,7 +981,7 @@
/* save hinted point coordinates back to outline */ /* save hinted point coordinates back to outline */
static void static void
psh2_glyph_save_points( PSH2_Glyph glyph, psh2_glyph_save_points( PSH2_Glyph glyph,
FT_Bool vertical ) FT_Int vertical )
{ {
FT_UInt n; FT_UInt n;
PSH2_Point point = glyph->points; PSH2_Point point = glyph->points;
@ -1061,7 +1064,7 @@
/* find strong points in a glyph */ /* find strong points in a glyph */
static void static void
psh2_glyph_find_strong_points( PSH2_Glyph glyph, psh2_glyph_find_strong_points( PSH2_Glyph glyph,
FT_Bool vertical ) FT_Int vertical )
{ {
/* a point is strong if it is located on a stem */ /* a point is strong if it is located on a stem */
/* edge and has an "in" or "out" tangent to the hint's direction */ /* edge and has an "in" or "out" tangent to the hint's direction */
@ -1128,7 +1131,7 @@
/* interpolate strong points with the help of hinted coordinates */ /* interpolate strong points with the help of hinted coordinates */
static void static void
psh2_glyph_interpolate_strong_points( PSH2_Glyph glyph, psh2_glyph_interpolate_strong_points( PSH2_Glyph glyph,
FT_Bool vertical ) FT_Int vertical )
{ {
PSH_Dimension dim = &glyph->globals->dimension[vertical]; PSH_Dimension dim = &glyph->globals->dimension[vertical];
FT_Fixed scale = dim->scale_mult; FT_Fixed scale = dim->scale_mult;
@ -1169,7 +1172,7 @@
static void static void
psh2_glyph_interpolate_normal_points( PSH2_Glyph glyph, psh2_glyph_interpolate_normal_points( PSH2_Glyph glyph,
FT_Bool vertical ) FT_Int vertical )
{ {
#if 1 #if 1
PSH_Dimension dim = &glyph->globals->dimension[vertical]; PSH_Dimension dim = &glyph->globals->dimension[vertical];
@ -1279,7 +1282,7 @@
/* interpolate other points */ /* interpolate other points */
static void static void
psh2_glyph_interpolate_other_points( PSH2_Glyph glyph, psh2_glyph_interpolate_other_points( PSH2_Glyph glyph,
FT_Bool vertical ) FT_Int vertical )
{ {
PSH_Dimension dim = &glyph->globals->dimension[vertical]; PSH_Dimension dim = &glyph->globals->dimension[vertical];
FT_Fixed scale = dim->scale_mult; FT_Fixed scale = dim->scale_mult;

View File

@ -101,6 +101,8 @@
FT_UInt count_bot = bot_table->count; FT_UInt count_bot = bot_table->count;
FT_Bool first = 1; FT_Bool first = 1;
FT_UNUSED(target);
for ( ; read_count > 0; read_count -= 2 ) for ( ; read_count > 0; read_count -= 2 )
{ {
FT_Int reference, delta; FT_Int reference, delta;

View File

@ -959,12 +959,10 @@
FT_Memory memory = parser->root.memory; FT_Memory memory = parser->root.memory;
FT_Error error; FT_Error error;
if ( encode->char_index ) if ( encode->char_index )
/* with synthetic fonts, it's possible we get here twice */ /* with synthetic fonts, it's possible we get here twice */
return; return;
/* read the number of entries in the encoding, should be 256 */ /* read the number of entries in the encoding, should be 256 */
count = T1_ToInt( parser ); count = T1_ToInt( parser );
if ( parser->root.error ) if ( parser->root.error )