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.
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
diff --git a/ChangeLog b/ChangeLog
index 976595f..77899d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-12-15 Werner Lemberg <wl@gnu.org>
+
+ 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 <darnold@adobe.com>
Werner Lemberg <wl@gnu.org>
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 0698c8f..e930bbc 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 117a1c8..8c5508e 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
}