More 16bit fixes. * src/autohint/ahglobal.c (sort_values): Use FT_Pos for `swap'. (ah_hinter_compute_widths): Use FT_Pos for `dist'. Use AH_MAX_WIDTHS. * src/autohint/ahglyph.c (ah_outline_scale_blue_edges): Use FT_Pos for `delta'. (ah_outline_compute_edges): Replace some ints with FT_Int and FT_Pos. (ah_test_extrema): Clean up code. (ah_get_orientation): Use 4 FT_Int variables instead of FT_BBox to hold indices. * src/autohint/ahtypes.h (AH_SegmentRec): Change type of `score' to FT_Pos.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
diff --git a/ChangeLog b/ChangeLog
index 5184007..1faa04e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2002-09-19 Wolfgang Domröse <porthos.domroese@harz.de>
+
+ More 16bit fixes.
+
+ * src/autohint/ahglobal.c (sort_values): Use FT_Pos for `swap'.
+ (ah_hinter_compute_widths): Use FT_Pos for `dist'.
+ Use AH_MAX_WIDTHS.
+ * src/autohint/ahglyph.c (ah_outline_scale_blue_edges): Use FT_Pos
+ for `delta'.
+ (ah_outline_compute_edges): Replace some ints with FT_Int and
+ FT_Pos.
+ (ah_test_extrema): Clean up code.
+ (ah_get_orientation): Use 4 FT_Int variables instead of FT_BBox to
+ hold indices.
+ * src/autohint/ahtypes.h (AH_SegmentRec): Change type of `score'
+ to FT_Pos.
+
2002-09-19 Werner Lemberg <wl@gnu.org>
* builds/unix/config.guess, builds/unix/config.sub: Updated to
diff --git a/src/autohint/ahglobal.c b/src/autohint/ahglobal.c
index f2b6799..2ce8ac3 100644
--- a/src/autohint/ahglobal.c
+++ b/src/autohint/ahglobal.c
@@ -43,7 +43,8 @@
sort_values( FT_Int count,
FT_Pos* table )
{
- FT_Int i, j, swap;
+ FT_Int i, j;
+ FT_Pos swap;
for ( i = 1; i < count; i++ )
@@ -345,14 +346,14 @@
/* we only consider stem segments there! */
if ( link && link->link == seg && link > seg )
{
- FT_Int dist;
+ FT_Pos dist;
dist = seg->pos - link->pos;
if ( dist < 0 )
dist = -dist;
- if ( num_widths < 12 )
+ if ( num_widths < AH_MAX_WIDTHS )
widths[num_widths++] = dist;
}
}
diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c
index 052aef4..ee628be 100644
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -164,13 +164,14 @@
/* this function is used by ah_get_orientation (see below) to test */
/* the fill direction of a given bbox extrema */
- static int
+ static FT_Int
ah_test_extrema( FT_Outline* outline,
- int n )
+ FT_Int n )
{
FT_Vector *prev, *cur, *next;
FT_Pos product;
FT_Int first, last, c;
+ FT_Int retval;
/* we need to compute the `previous' and `next' point */
@@ -201,10 +202,11 @@
next->x - cur->x, /* out.x */
0x40 );
+ retval = 0;
if ( product )
- product = product > 0 ? 2 : 1;
+ retval = product > 0 ? 2 : 1;
- return product;
+ return retval;
}
@@ -218,18 +220,18 @@
/* */
/* The function returns either 1 or -1. */
/* */
- static int
+ static FT_Int
ah_get_orientation( FT_Outline* outline )
{
FT_BBox box;
- FT_BBox indices;
- int n, last;
+ FT_Int indices_xMin, indices_yMin, indices_xMax, indices_yMax;
+ FT_Int n, last;
- indices.xMin = -1;
- indices.yMin = -1;
- indices.xMax = -1;
- indices.yMax = -1;
+ indices_xMin = -1;
+ indices_yMin = -1;
+ indices_xMax = -1;
+ indices_yMax = -1;
box.xMin = box.yMin = 32767L;
box.xMax = box.yMax = -32768L;
@@ -249,41 +251,41 @@
if ( x < box.xMin )
{
box.xMin = x;
- indices.xMin = n;
+ indices_xMin = n;
}
if ( x > box.xMax )
{
box.xMax = x;
- indices.xMax = n;
+ indices_xMax = n;
}
y = outline->points[n].y;
if ( y < box.yMin )
{
box.yMin = y;
- indices.yMin = n;
+ indices_yMin = n;
}
if ( y > box.yMax )
{
box.yMax = y;
- indices.yMax = n;
+ indices_yMax = n;
}
}
/* test orientation of the xmin */
- n = ah_test_extrema( outline, indices.xMin );
+ n = ah_test_extrema( outline, indices_xMin );
if ( n )
goto Exit;
- n = ah_test_extrema( outline, indices.yMin );
+ n = ah_test_extrema( outline, indices_yMin );
if ( n )
goto Exit;
- n = ah_test_extrema( outline, indices.xMax );
+ n = ah_test_extrema( outline, indices_xMax );
if ( n )
goto Exit;
- n = ah_test_extrema( outline, indices.yMax );
+ n = ah_test_extrema( outline, indices_yMax );
if ( !n )
n = 1;
@@ -1284,10 +1286,10 @@
/* now, compute each edge properties */
for ( edge = edges; edge < edge_limit; edge++ )
{
- int is_round = 0; /* does it contain round segments? */
- int is_straight = 0; /* does it contain straight segments? */
- int ups = 0; /* number of upwards segments */
- int downs = 0; /* number of downwards segments */
+ FT_Int is_round = 0; /* does it contain round segments? */
+ FT_Int is_straight = 0; /* does it contain straight segments? */
+ FT_Pos ups = 0; /* number of upwards segments */
+ FT_Pos downs = 0; /* number of downwards segments */
seg = edge->first;
@@ -1561,7 +1563,7 @@
{
AH_Edge edge = outline->horz_edges;
AH_Edge edge_limit = edge + outline->num_hedges;
- FT_Int delta;
+ FT_Pos delta;
delta = globals->scaled.blue_refs - globals->design.blue_refs;
diff --git a/src/autohint/ahtypes.h b/src/autohint/ahtypes.h
index a893e84..f492d7b 100644
--- a/src/autohint/ahtypes.h
+++ b/src/autohint/ahtypes.h
@@ -286,7 +286,7 @@ FT_BEGIN_HEADER
AH_Segment link; /* link segment */
AH_Segment serif; /* primary segment for serifs */
FT_Pos num_linked; /* number of linked segments */
- FT_Int score;
+ FT_Pos score;
} AH_SegmentRec;