shithub: freetype+ttf2subf

Download patch

ref: 015c6e08a1e87b421b1dfcff313eeba024f4bc14
parent: 5c7646d22619bdf4f98acbc2585f41a75f8d0b23
author: Werner Lemberg <[email protected]>
date: Tue Mar 1 01:45:52 EST 2016

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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2016-03-01  Werner Lemberg  <[email protected]>
+
+	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  <[email protected]>
 
 	[autofit] Add blue-zone support for Sinhala script.
--- 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 */
--- 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" ));
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1503,7 +1503,8 @@
       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" );
     }
   }
--- 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++ )
         {