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.
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
diff --git a/ChangeLog b/ChangeLog
index eed0966..eb556d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index f94190f..ff0954c 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -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 */
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 52fd0ec..b49616d 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -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" ));
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 9411cf9..d6d0e25 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -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" );
}
}
diff --git a/src/tools/ftfuzzer/ftfuzzer.cc b/src/tools/ftfuzzer/ftfuzzer.cc
index 7df7abc..39f2b39 100644
--- a/src/tools/ftfuzzer/ftfuzzer.cc
+++ b/src/tools/ftfuzzer/ftfuzzer.cc
@@ -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++ )
{