From b56680240a10db7e13cf5925a61946626d269c84 Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Sat, 1 Aug 2009 00:32:07 +0900 Subject: [PATCH] autofit: Count the size of the memory object by ptrdiff_t. --- ChangeLog | 20 ++++++++++++++++++++ src/autofit/afcjk.c | 2 +- src/autofit/afhints.c | 6 +++--- src/autofit/aflatin.c | 2 +- src/autofit/aftypes.h | 2 +- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c83ac972..7798e4619 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2009-07-31 suzuki toshiya + + autofit: Count the size of the memory object by ptrdiff_t. + + * src/autofit/afcjk.c (af_cjk_hint_edges): The + number of edges `n_edges' should be counted by + FT_PtrDist variable instead of FT_Int. + + * src/autofit/aflatin.c (af_latin_hint_edges): + Ditto. + + * src/autofit/aftypes.h: In AF_ScriptClassRec, + the size of metric `script_metrics_size' should + be counted by FT_Offset variable instead of FT_UInt. + + * src/autofit/afhints.c + (af_glyph_hints_align_strong_points): The cursors + for the edges `min', `max', `mid' in the memory + buffer should be typed FT_PtrDist. + 2009-07-31 suzuki toshiya autofit: Fix for unused variable `first'. diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c index 9e0cea868..bab0c42ba 100644 --- a/src/autofit/afcjk.c +++ b/src/autofit/afcjk.c @@ -1020,7 +1020,7 @@ AF_AxisHints axis = &hints->axis[dim]; AF_Edge edges = axis->edges; AF_Edge edge_limit = edges + axis->num_edges; - FT_Int n_edges; + FT_PtrDist n_edges; AF_Edge edge; AF_Edge anchor = 0; FT_Pos delta = 0; diff --git a/src/autofit/afhints.c b/src/autofit/afhints.c index e175b0441..8396a20b3 100644 --- a/src/autofit/afhints.c +++ b/src/autofit/afhints.c @@ -941,8 +941,8 @@ } { - FT_UInt min, max, mid; - FT_Pos fpos; + FT_PtrDist min, max, mid; + FT_Pos fpos; /* find enclosing edges */ @@ -953,7 +953,7 @@ /* for small edge counts, a linear search is better */ if ( max <= 8 ) { - FT_UInt nn; + FT_PtrDist nn; for ( nn = 0; nn < max; nn++ ) if ( edges[nn].fpos >= u ) diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c index 062f863ab..252703ed9 100644 --- a/src/autofit/aflatin.c +++ b/src/autofit/aflatin.c @@ -1701,7 +1701,7 @@ AF_AxisHints axis = &hints->axis[dim]; AF_Edge edges = axis->edges; AF_Edge edge_limit = edges + axis->num_edges; - FT_Int n_edges; + FT_PtrDist n_edges; AF_Edge edge; AF_Edge anchor = 0; FT_Int has_serifs = 0; diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h index 71c9badd9..5574f0c30 100644 --- a/src/autofit/aftypes.h +++ b/src/autofit/aftypes.h @@ -332,7 +332,7 @@ extern void* _af_debug_hints; AF_Script script; AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */ - FT_UInt script_metrics_size; + FT_Offset script_metrics_size; AF_Script_InitMetricsFunc script_metrics_init; AF_Script_ScaleMetricsFunc script_metrics_scale; AF_Script_DoneMetricsFunc script_metrics_done;