From 71cc1a83d86526cb9423225e77dc796700646d4c Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 30 May 2011 07:20:37 +0200 Subject: [PATCH] Fix gcc 4.6 compiler warnings. * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Use casts and remove unused variables. * src/autofit/aflatin.c (af_latin_hints_compute_edges): Comment out `up_dir'. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `height_org' and `width_org' conditionalized. --- ChangeLog | 11 +++++++++++ src/autofit/afcjk.c | 25 +++++++++++-------------- src/autofit/aflatin.c | 4 ++++ src/smooth/ftsmooth.c | 9 +++++++-- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 79a3e074e..f9149be88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-05-30 Werner Lemberg + + Fix gcc 4.6 compiler warnings. + + * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Use casts and + remove unused variables. + * src/autofit/aflatin.c (af_latin_hints_compute_edges): Comment out + `up_dir'. + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `height_org' + and `width_org' conditionalized. + 2011-05-27 Werner Lemberg [autofit] Improve tracing of hinting process. diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c index d7670f427..0acef9c85 100644 --- a/src/autofit/afcjk.c +++ b/src/autofit/afcjk.c @@ -281,10 +281,16 @@ FT_GlyphSlot glyph = face->glyph; #ifdef FT_DEBUG_LEVEL_TRACE - FT_String* cjk_blue_name[AF_CJK_BLUE_MAX] = { "top", "bottom", - "left", "right" }; - FT_String* cjk_blue_type_name[AF_CJK_BLUE_TYPE_MAX] = { "filled", - "unfilled" }; + FT_String* cjk_blue_name[AF_CJK_BLUE_MAX] = { + (FT_String*)"top", + (FT_String*)"bottom", + (FT_String*)"left", + (FT_String*)"right" + }; + FT_String* cjk_blue_type_name[AF_CJK_BLUE_TYPE_MAX] = { + (FT_String*)"filled", + (FT_String*)"unfilled" + }; #endif @@ -321,7 +327,7 @@ { FT_UInt glyph_index; FT_Pos best_pos; /* same as points.y */ - FT_Int best_point, best_first, best_last; + FT_Int best_point; FT_Vector* points; @@ -346,8 +352,6 @@ points = glyph->outline.points; best_point = -1; best_pos = 0; /* make compiler happy */ - best_first = 0; /* ditto */ - best_last = 0; /* ditto */ { FT_Int nn; @@ -359,7 +363,6 @@ nn < glyph->outline.n_contours; first = last + 1, nn++ ) { - FT_Int old_best_point = best_point; FT_Int pp; @@ -413,12 +416,6 @@ default: ; } - - if ( best_point != old_best_point ) - { - best_first = first; - best_last = last; - } } FT_TRACE5(( "best_pos=%5ld\n", best_pos )); } diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c index b93993832..9bb2ef833 100644 --- a/src/autofit/aflatin.c +++ b/src/autofit/aflatin.c @@ -1046,7 +1046,9 @@ AF_Segment segment_limit = segments + axis->num_segments; AF_Segment seg; +#if 0 AF_Direction up_dir; +#endif FT_Fixed scale; FT_Pos edge_distance_threshold; FT_Pos segment_length_threshold; @@ -1057,8 +1059,10 @@ scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale : hints->y_scale; +#if 0 up_dir = ( dim == AF_DIMENSION_HORZ ) ? AF_DIR_UP : AF_DIR_RIGHT; +#endif /* * We ignore all segments that are less than 1 pixel in length diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c index eb12f1802..1350a5661 100644 --- a/src/smooth/ftsmooth.c +++ b/src/smooth/ftsmooth.c @@ -4,7 +4,7 @@ /* */ /* Anti-aliasing renderer interface (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */ +/* Copyright 2000-2006, 2009-2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -105,7 +105,10 @@ FT_Error error; FT_Outline* outline = NULL; FT_BBox cbox; - FT_UInt width, height, height_org, width_org, pitch; + FT_UInt width, height, pitch; +#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING + FT_UInt height_org, width_org; +#endif FT_Bitmap* bitmap; FT_Memory memory; FT_Int hmul = mode == FT_RENDER_MODE_LCD; @@ -163,8 +166,10 @@ bitmap = &slot->bitmap; memory = render->root.memory; +#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING width_org = width; height_org = height; +#endif /* release old bitmap buffer */ if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )