Commit 799d27b0b68008d427df1a55e761e3f5b42bd3f6

Werner Lemberg 2018-08-04T06:39:11

Fix clang warnings. * src/base/ftoutln.c (FT_Outline_EmboldenXY): Fix type of `orientation'. * src/gxvalid/gxvcommn.c (gx_lookup_value_read): Fix signature. * src/pcf/pcfread.c (pcf_get_encodings): Fix type of some variables. Add cast. * src/type1/t1load.c (parse_weight_vector): Fix cast.

diff --git a/ChangeLog b/ChangeLog
index a031a65..48b7944 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2018-08-04  Werner Lemberg  <wl@gnu.org>
+
+	Fix clang warnings.
+
+	* src/base/ftoutln.c (FT_Outline_EmboldenXY): Fix type of
+	`orientation'.
+
+	* src/gxvalid/gxvcommn.c (gx_lookup_value_read): Fix signature.
+
+	* src/pcf/pcfread.c (pcf_get_encodings): Fix type of some variables.
+	Add cast.
+
+	* src/type1/t1load.c (parse_weight_vector): Fix cast.
+
 2018-07-31  Werner Lemberg  <wl@gnu.org>
 
 	* src/cid/cidtoken.h: Handle `XUID' keyword.
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 99edb0e..09a6a1f 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -911,9 +911,9 @@
                          FT_Pos       xstrength,
                          FT_Pos       ystrength )
   {
-    FT_Vector*  points;
-    FT_Int      c, first, last;
-    FT_Int      orientation;
+    FT_Vector*      points;
+    FT_Int          c, first, last;
+    FT_Orientation  orientation;
 
 
     if ( !outline )
diff --git a/src/gxvalid/gxvcommn.c b/src/gxvalid/gxvcommn.c
index 9a22107..4d8a4a2 100644
--- a/src/gxvalid/gxvcommn.c
+++ b/src/gxvalid/gxvcommn.c
@@ -384,8 +384,8 @@
           ( P += 2, gxv_lookup_value_load( P - 2, SIGNSPEC ) )
 
   static GXV_LookupValueDesc
-  gxv_lookup_value_load( FT_Bytes  p,
-                         int       signspec )
+  gxv_lookup_value_load( FT_Bytes                  p,
+                         GXV_LookupValue_SignSpec  signspec )
   {
     GXV_LookupValueDesc  v;
 
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index 69a4b15..9893644 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -944,12 +944,12 @@ THE SOFTWARE.
     FT_Error      error;
     FT_Memory     memory = FT_FACE( face )->memory;
     FT_ULong      format, size;
-    int           firstCol, lastCol;
-    int           firstRow, lastRow;
+    FT_Short      firstCol, lastCol;
+    FT_Short      firstRow, lastRow;
     FT_ULong      nencoding;
     FT_UShort     defaultCharRow, defaultCharCol;
     FT_UShort     encodingOffset, defaultCharEncodingOffset;
-    int           i, j;
+    FT_Short      i, j;
     FT_Byte*      pos;
     FT_ULong      k;
     PCF_Encoding  encoding = NULL;
@@ -1037,7 +1037,7 @@ THE SOFTWARE.
          defaultCharCol < (FT_UShort)firstCol ||
          defaultCharCol > (FT_UShort)lastCol  )
     {
-      face->defaultChar = firstRow * 256 + firstCol;
+      face->defaultChar = (FT_UShort)firstRow * 256U + (FT_UShort)firstCol;
       FT_TRACE0(( "pcf_get_encodings:"
                   " Invalid default character set to %d\n",
                   face->defaultChar ));
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 627d8d2..a443571 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1043,7 +1043,7 @@
       blend->default_weight_vector[n] =
       blend->weight_vector[n]         = T1_ToFixed( parser, 0 );
 
-      FT_TRACE4(( " %f", (float)blend->weight_vector[n] / 65536 ));
+      FT_TRACE4(( " %f", (double)blend->weight_vector[n] / 65536 ));
     }
 
     FT_TRACE4(( "]\n" ));