Fix clang warnings.

* src/autofit/aflatin.c (af_latin_hints_compute_segments): Use
FT_UShort for `min_flags' and `max_flags'.
Initialize `prev_*' variables.

* src/cff/cffobjs.c (cff_face_init) [FT_DEBUG_LEVEL_TRACE]: Fix
types of local variables.

* src/smooth/ftgrays.c (gray_dump_cells) [FT_DEBUG_LEVEL_TRACE]:
Update `printf' format string.

* src/tools/ftfuzzer/ftfuzzer.cc (setIntermediateAxis): Add cast.
(LLVMFuzzerTestOneInput): Fix loop type.
This commit is contained in:
Werner Lemberg 2016-03-01 06:45:52 +01:00
parent 5c7646d226
commit 015c6e08a1
5 changed files with 47 additions and 29 deletions

View File

@ -1,3 +1,20 @@
2016-03-01 Werner Lemberg <wl@gnu.org>
Fix clang warnings.
* src/autofit/aflatin.c (af_latin_hints_compute_segments): Use
FT_UShort for `min_flags' and `max_flags'.
Initialize `prev_*' variables.
* src/cff/cffobjs.c (cff_face_init) [FT_DEBUG_LEVEL_TRACE]: Fix
types of local variables.
* src/smooth/ftgrays.c (gray_dump_cells) [FT_DEBUG_LEVEL_TRACE]:
Update `printf' format string.
* src/tools/ftfuzzer/ftfuzzer.cc (setIntermediateAxis): Add cast.
(LLVMFuzzerTestOneInput): Fix loop type.
2016-02-29 Werner Lemberg <wl@gnu.org>
[autofit] Add blue-zone support for Sinhala script.

View File

@ -1443,27 +1443,27 @@
/* we call values measured along a segment (point->v) */
/* `coordinates', and values orthogonal to it (point->u) */
/* `positions' */
FT_Pos min_pos = 32000;
FT_Pos max_pos = -32000;
FT_Pos min_coord = 32000;
FT_Pos max_coord = -32000;
FT_Pos min_flags = AF_FLAG_NONE;
FT_Pos max_flags = AF_FLAG_NONE;
FT_Pos min_on_coord = 32000;
FT_Pos max_on_coord = -32000;
FT_Pos min_pos = 32000;
FT_Pos max_pos = -32000;
FT_Pos min_coord = 32000;
FT_Pos max_coord = -32000;
FT_UShort min_flags = AF_FLAG_NONE;
FT_UShort max_flags = AF_FLAG_NONE;
FT_Pos min_on_coord = 32000;
FT_Pos max_on_coord = -32000;
FT_Bool passed;
AF_Segment prev_segment = NULL;
FT_Pos prev_min_pos;
FT_Pos prev_max_pos;
FT_Pos prev_min_coord;
FT_Pos prev_max_coord;
FT_UShort prev_min_flags;
FT_UShort prev_max_flags;
FT_Pos prev_min_on_coord;
FT_Pos prev_max_on_coord;
FT_Pos prev_min_pos = min_pos;
FT_Pos prev_max_pos = max_pos;
FT_Pos prev_min_coord = min_coord;
FT_Pos prev_max_coord = max_coord;
FT_UShort prev_min_flags = min_flags;
FT_UShort prev_max_flags = max_flags;
FT_Pos prev_min_on_coord = min_on_coord;
FT_Pos prev_max_on_coord = max_on_coord;
if ( point == last ) /* skip singletons -- just in case */

View File

@ -638,13 +638,13 @@
/* We thus access `cff->strings' directly. */
for ( idx = 1; idx < cff->num_strings; idx++ )
{
FT_Byte* s1 = cff->strings[idx - 1];
FT_Byte* s2 = cff->strings[idx];
size_t s1len = s2 - s1 - 1; /* without the final NULL byte */
size_t l;
FT_Byte* s1 = cff->strings[idx - 1];
FT_Byte* s2 = cff->strings[idx];
FT_PtrDist s1len = s2 - s1 - 1; /* without the final NULL byte */
FT_PtrDist l;
FT_TRACE4(( " %5d ", idx + 390, s ));
FT_TRACE4(( " %5d ", idx + 390 ));
for ( l = 0; l < s1len; l++ )
FT_TRACE4(( "%c", s1[l] ));
FT_TRACE4(( "\n" ));
@ -653,13 +653,13 @@
/* print last element */
if ( cff->num_strings )
{
FT_Byte* s1 = cff->strings[cff->num_strings - 1];
FT_Byte* s2 = cff->string_pool + cff->string_pool_size;
size_t s1len = s2 - s1 - 1;
size_t l;
FT_Byte* s1 = cff->strings[cff->num_strings - 1];
FT_Byte* s2 = cff->string_pool + cff->string_pool_size;
FT_PtrDist s1len = s2 - s1 - 1;
FT_PtrDist l;
FT_TRACE4(( " %5d ", cff->num_strings + 390, s ));
FT_TRACE4(( " %5d ", cff->num_strings + 390 ));
for ( l = 0; l < s1len; l++ )
FT_TRACE4(( "%c", s1[l] ));
FT_TRACE4(( "\n" ));

View File

@ -1503,7 +1503,8 @@ typedef ptrdiff_t FT_PtrDist;
printf( "%3d:", yindex );
for ( cell = ras.ycells[yindex]; cell != NULL; cell = cell->next )
printf( " (%3ld, c:%4ld, a:%6d)", cell->x, cell->cover, cell->area );
printf( " (%3ld, c:%4ld, a:%6ld)",
cell->x, cell->cover, cell->area );
printf( "\n" );
}
}

View File

@ -161,7 +161,7 @@
variations->axis[i].def ) / 2;
if ( FT_Set_Var_Design_Coordinates( face,
coords.size(),
FT_UInt( coords.size() ),
coords.data() ) )
return;
}
@ -248,7 +248,7 @@
// loop over all bitmap stroke sizes
// and an arbitrary size for outlines
for ( long fixed_sizes_index = 0;
for ( int fixed_sizes_index = 0;
fixed_sizes_index < face->num_fixed_sizes + 1;
fixed_sizes_index++ )
{