From 01658be6fbda2ff17616158ae5df5dc240a4347c Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 15 Dec 2016 23:10:59 +0100 Subject: [PATCH] Fix clang warnings. * src/cff/cffload.c (cff_blend_doBlend): Add cast. (cff_subfont_load): Set `error' correctly. * src/sfnt/ttmtx.c (tt_face_get_metrics): Typo. --- ChangeLog | 9 +++++++++ src/cff/cffload.c | 17 +++++++++-------- src/sfnt/ttmtx.c | 4 ++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 976595f4f..77899d438 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2016-12-15 Werner Lemberg + + Fix clang warnings. + + * src/cff/cffload.c (cff_blend_doBlend): Add cast. + (cff_subfont_load): Set `error' correctly. + + * src/sfnt/ttmtx.c (tt_face_get_metrics): Typo. + 2016-12-15 Dave Arnold Werner Lemberg diff --git a/src/cff/cffload.c b/src/cff/cffload.c index 0698c8f23..e930bbc79 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -1339,7 +1339,7 @@ /* CFF2 DICTs. See `cff_parse_num' for decode of this, which rounds */ /* to an integer. */ *subFont->blend_top++ = 255; - *((FT_UInt32*)subFont->blend_top) = sum; /* write 4 bytes */ + *((FT_UInt32*)subFont->blend_top) = (FT_UInt32)sum; /* write 4 bytes */ subFont->blend_top += 4; } @@ -1928,13 +1928,14 @@ /* Note: We use default stack size for CFF2 Font DICT because */ /* Top and Font DICTs are not allowed to have blend operators. */ - if ( cff_parser_init( &parser, - code, - &subfont->font_dict, - font->library, - stackSize, - 0, - 0 ) ) + error = cff_parser_init( &parser, + code, + &subfont->font_dict, + font->library, + stackSize, + 0, + 0 ); + if ( error ) goto Exit; /* set defaults */ diff --git a/src/sfnt/ttmtx.c b/src/sfnt/ttmtx.c index 117a1c8ea..8c5508e24 100644 --- a/src/sfnt/ttmtx.c +++ b/src/sfnt/ttmtx.c @@ -308,8 +308,8 @@ var->lsb_adjust( f, gindex, &b ); } - *aadvance = (FT_Short)a; - *abearing = (FT_UShort)b; + *aadvance = (FT_UShort)a; + *abearing = (FT_Short)b; } #endif }