* 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.
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 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
diff --git a/ChangeLog b/ChangeLog
index 677fe81..2376263 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2007-05-15 Graham Asher <graham.asher@btinternet.com>
+
+ * 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 <dclegg@apple.com>
* src/base/ftobjs.c (FT_New_Library): Only allocate rendering pool
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 2d01111..bd6b4b2 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 1633e9e..e4d8478 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 be9bf16..9f4e128 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 012ff8c..0528fe6 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 76fb174..8d8c476 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 8a35e14..f5dc49f 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 08f9dba..28e52c3 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 105518c..acb5a4e 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