diff --git a/ChangeLog b/ChangeLog index 677fe8153..2376263b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2007-05-15 Graham Asher + + * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Remove unused + variable. + * src/autofit/afloader.c (af_loader_load_g): Ditto. + + * src/base/ftobjs.c (ft_validator_error): Use `ft_jmp_buf'. + (open_face_from_buffer): Initialize `stream'. + (FT_Request_Metrics): Remove unused variable. + Remove redundant `break' statements. + (FT_Get_Track_Kerning): Remove unused variable. + + * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs, + afm_parse_kern_data): Remove redundant + `break' statements. + (afm_parser_parse): Ditto. + Don't use uninitialized variables. + + * src/psnames/psmodule.c (VARIANT_BIT): Define as unsigned long. + Use `|' operator instead of `^' to set it. + Update all users. + + * src/sfnt/ttcmap.c (tt_face_build_cmaps): Use `ft_jmp_buf'. + * src/sfnt/ttkern.c (tt_face_load_kern): Remove unused variable. + + * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant + comparison. + (TT_Process_Simple_Glyph): Use FT_UInt for `n_points' and `i'. + (TT_Load_Glyph): Remove unused variable. + 2007-05-13 Derek Clegg * src/base/ftobjs.c (FT_New_Library): Only allocate rendering pool diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c index 2d0111166..bd6b4b2f1 100644 --- a/src/autofit/afcjk.c +++ b/src/autofit/afcjk.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK script (body). */ /* */ -/* Copyright 2006 by */ +/* Copyright 2006, 2007 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -332,7 +332,6 @@ AF_Segment segment_limit = segments + axis->num_segments; AF_Segment seg; - AF_Direction up_dir; FT_Fixed scale; FT_Pos edge_distance_threshold; @@ -342,9 +341,6 @@ scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale : hints->y_scale; - up_dir = ( dim == AF_DIMENSION_HORZ ) ? AF_DIR_UP - : AF_DIR_RIGHT; - /*********************************************************************/ /* */ /* We begin by generating a sorted table of edges for the current */ diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c index 1633e9e7f..e4d8478bf 100644 --- a/src/autofit/afloader.c +++ b/src/autofit/afloader.c @@ -173,7 +173,7 @@ /* width/positioning that occurred during the hinting process */ if ( scaler->render_mode != FT_RENDER_MODE_LIGHT ) { - FT_Pos old_advance, old_rsb, old_lsb, new_lsb; + FT_Pos old_rsb, old_lsb, new_lsb; FT_Pos pp1x_uh, pp2x_uh; AF_AxisHints axis = &hints->axis[AF_DIMENSION_HORZ]; AF_Edge edge1 = axis->edges; /* leftmost edge */ @@ -183,7 +183,6 @@ if ( axis->num_edges > 1 && AF_HINTS_DO_ADVANCE( hints ) ) { - old_advance = loader->pp2.x - loader->pp1.x; old_rsb = loader->pp2.x - edge2->opos; old_lsb = edge1->opos; new_lsb = edge1->pos; diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index be9bf16f1..9f4e128d0 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -92,14 +92,14 @@ /* since the cast below also disables the compiler's */ /* type check, we introduce a dummy variable, which */ /* will be optimized away */ - volatile jmp_buf* jump_buffer = &valid->jump_buffer; + volatile ft_jmp_buf* jump_buffer = &valid->jump_buffer; valid->error = error; /* throw away volatileness; use `jump_buffer' or the */ /* compiler may warn about an unused local variable */ - ft_longjmp( *(jmp_buf*) jump_buffer, 1 ); + ft_longjmp( *(ft_jmp_buf*) jump_buffer, 1 ); } @@ -1198,7 +1198,7 @@ { FT_Open_Args args; FT_Error error; - FT_Stream stream; + FT_Stream stream = NULL; FT_Memory memory = library->memory; @@ -2223,11 +2223,9 @@ FT_Request_Metrics( FT_Face face, FT_Size_Request req ) { - FT_Driver_Class clazz; FT_Size_Metrics* metrics; - clazz = face->driver->clazz; metrics = &face->size->metrics; if ( FT_IS_SCALABLE( face ) ) @@ -2263,12 +2261,10 @@ else if ( !metrics->y_scale ) metrics->y_scale = metrics->x_scale; goto Calculate_Ppem; - break; default: /* this never happens */ return; - break; } /* to be on the safe side */ @@ -2554,7 +2550,6 @@ { FT_Service_Kerning service; FT_Error error = FT_Err_Ok; - FT_Driver driver; if ( !face ) @@ -2563,8 +2558,6 @@ if ( !akerning ) return FT_Err_Invalid_Argument; - driver = face->driver; - FT_FACE_FIND_SERVICE( face, service, KERNING ); if ( !service ) return FT_Err_Unimplemented_Feature; diff --git a/src/psaux/afmparse.c b/src/psaux/afmparse.c index 012ff8c75..0528fe6ff 100644 --- a/src/psaux/afmparse.c +++ b/src/psaux/afmparse.c @@ -4,7 +4,7 @@ /* */ /* AFM parser (body). */ /* */ -/* Copyright 2006 by */ +/* Copyright 2006, 2007 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -642,14 +642,12 @@ case AFM_TOKEN_ENDFONTMETRICS: fi->NumTrackKern = n + 1; return PSaux_Err_Ok; - break; case AFM_TOKEN_UNKNOWN: break; default: goto Fail; - break; } } @@ -761,7 +759,6 @@ default: goto Fail; - break; } } @@ -804,7 +801,6 @@ default: goto Fail; - break; } } @@ -921,7 +917,7 @@ case AFM_TOKEN_STARTCHARMETRICS: { - FT_Int n; + FT_Int n = 0; if ( afm_parser_read_int( parser, &n ) ) @@ -942,7 +938,6 @@ case AFM_TOKEN_ENDFONTMETRICS: return PSaux_Err_Ok; - break; default: break; diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c index 76fb17414..8d8c476a1 100644 --- a/src/psnames/psmodule.c +++ b/src/psnames/psmodule.c @@ -32,7 +32,7 @@ #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST -#define VARIANT_BIT ( 1L << 31 ) +#define VARIANT_BIT 0x80000000UL #define BASE_GLYPH( code ) ( (code) & ~VARIANT_BIT ) @@ -92,7 +92,7 @@ if ( *p == '\0' ) return value; if ( *p == '.' ) - return value ^ VARIANT_BIT; + return value | VARIANT_BIT; } } @@ -132,7 +132,7 @@ if ( *p == '\0' ) return value; if ( *p == '.' ) - return value ^ VARIANT_BIT; + return value | VARIANT_BIT; } } @@ -156,7 +156,7 @@ if ( !dot ) return ft_get_adobe_glyph_index( glyph_name, p ); else - return ft_get_adobe_glyph_index( glyph_name, dot ) ^ VARIANT_BIT; + return ft_get_adobe_glyph_index( glyph_name, dot ) | VARIANT_BIT; } } diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c index 8a35e14c4..f5dc49ffa 100644 --- a/src/sfnt/ttcmap.c +++ b/src/sfnt/ttcmap.c @@ -2299,7 +2299,8 @@ valid.num_glyphs = (FT_UInt)face->max_profile.numGlyphs; - if ( ft_setjmp( FT_VALIDATOR( &valid )->jump_buffer ) == 0 ) + if ( ft_setjmp( + *((ft_jmp_buf*)&FT_VALIDATOR( &valid )->jump_buffer) ) == 0 ) { /* validate this cmap sub-table */ error = clazz->validate( cmap, FT_VALIDATOR( &valid ) ); diff --git a/src/sfnt/ttkern.c b/src/sfnt/ttkern.c index 08f9dba3d..28e52c333 100644 --- a/src/sfnt/ttkern.c +++ b/src/sfnt/ttkern.c @@ -84,7 +84,7 @@ for ( nn = 0; nn < num_tables; nn++ ) { - FT_UInt num_pairs, version, length, coverage; + FT_UInt num_pairs, length, coverage; FT_Byte* p_next; FT_UInt32 mask = 1UL << nn; @@ -94,7 +94,7 @@ p_next = p; - version = FT_NEXT_USHORT( p ); + p += 2; /* skip version */ length = FT_NEXT_USHORT( p ); coverage = FT_NEXT_USHORT( p ); diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 105518cc4..acb5a4e4d 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -271,11 +271,7 @@ n_points = 0; if ( n_contours > 0 ) - { n_points = cont[-1] + 1; - if ( n_points < 0 ) - goto Invalid_Outline; - } /* note that we will add four phantom points later */ error = FT_GLYPHLOADER_CHECK_POINTS( gloader, n_points + 4, 0 ); @@ -686,7 +682,7 @@ FT_GlyphLoader gloader = loader->gloader; FT_Error error = TT_Err_Ok; FT_Outline* outline; - FT_Int n_points; + FT_UInt n_points; outline = &gloader->current.outline; @@ -713,7 +709,7 @@ /* Deltas apply to the unscaled data. */ FT_Vector* deltas; FT_Memory memory = loader->face->memory; - FT_Int i; + FT_UInt i; error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face), @@ -1856,13 +1852,11 @@ FT_Int32 load_flags ) { TT_Face face; - FT_Stream stream; FT_Error error; TT_LoaderRec loader; face = (TT_Face)glyph->face; - stream = face->root.stream; error = TT_Err_Ok; #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS