From 799d27b0b68008d427df1a55e761e3f5b42bd3f6 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 4 Aug 2018 06:39:11 +0200 Subject: [PATCH] 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. --- ChangeLog | 14 ++++++++++++++ src/base/ftoutln.c | 6 +++--- src/gxvalid/gxvcommn.c | 4 ++-- src/pcf/pcfread.c | 8 ++++---- src/type1/t1load.c | 2 +- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index a031a65a0..48b7944c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2018-08-04 Werner Lemberg + + 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 * src/cid/cidtoken.h: Handle `XUID' keyword. diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c index 99edb0e0e..09a6a1ffc 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 9a221075a..4d8a4a2d7 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 69a4b15d0..989364485 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 627d8d2ff..a44357134 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" ));