ref: e5c0fff5afa830947309638b714adffec7de15a0
parent: 6497b9c5a599071a631664a55cf32b7d96ce3474
author: Werner Lemberg <[email protected]>
date: Fri Jun 13 10:01:20 EDT 2014
Fix more compiler warnings. Reported by Wojciech Mamrak <[email protected]>. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Make integer constant unsigned. * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) <TT_SBIT_TABLE_TYPE_SBIX>: Fix types. (tt_sbit_decoder_load_compound, tt_face_load_sbix_image): Add proper casts.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2014-06-13 Werner Lemberg <[email protected]>
+ Fix more compiler warnings.
+ Reported by Wojciech Mamrak <[email protected]>.
+
+ * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
+ Make integer constant unsigned.
+
+ * src/sfnt/ttsbit.c (tt_face_load_strike_metrics)
+ <TT_SBIT_TABLE_TYPE_SBIX>: Fix types.
+ (tt_sbit_decoder_load_compound, tt_face_load_sbix_image): Add proper
+ casts.
+
+2014-06-13 Werner Lemberg <[email protected]>
+
Fix compiler warnings.
Reported by Wojciech Mamrak <[email protected]>.
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -138,7 +138,7 @@
FT_Byte* gstyles = globals->glyph_styles;
FT_UInt ss;
FT_UInt i;
- FT_UInt dflt = ~0; /* a non-valid value */
+ FT_UInt dflt = ~0U; /* a non-valid value */
/* the value AF_STYLE_UNASSIGNED means `uncovered glyph' */
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -256,7 +256,8 @@
case TT_SBIT_TABLE_TYPE_SBIX:
{
FT_Stream stream = face->root.stream;
- FT_UInt offset, ppem, resolution, upem;
+ FT_UInt offset, upem;
+ FT_UShort ppem, resolution;
TT_HoriHeader *hori;
FT_ULong table_size;
@@ -800,12 +801,12 @@
FT_Error error = FT_Err_Ok;
FT_UInt num_components, nn;
- FT_Char horiBearingX = decoder->metrics->horiBearingX;
- FT_Char horiBearingY = decoder->metrics->horiBearingY;
- FT_Byte horiAdvance = decoder->metrics->horiAdvance;
- FT_Char vertBearingX = decoder->metrics->vertBearingX;
- FT_Char vertBearingY = decoder->metrics->vertBearingY;
- FT_Byte vertAdvance = decoder->metrics->vertAdvance;
+ FT_Char horiBearingX = (FT_Char)decoder->metrics->horiBearingX;
+ FT_Char horiBearingY = (FT_Char)decoder->metrics->horiBearingY;
+ FT_Byte horiAdvance = (FT_Byte)decoder->metrics->horiAdvance;
+ FT_Char vertBearingX = (FT_Char)decoder->metrics->vertBearingX;
+ FT_Char vertBearingY = (FT_Char)decoder->metrics->vertBearingY;
+ FT_Byte vertAdvance = (FT_Byte)decoder->metrics->vertAdvance;
if ( p + 2 > limit )
@@ -1353,9 +1354,10 @@
tt_face_get_metrics( face, FALSE, glyph_index, &abearing, &aadvance );
metrics->horiBearingX = originOffsetX;
- metrics->horiBearingY = -originOffsetY + metrics->height;
- metrics->horiAdvance = aadvance * face->root.size->metrics.x_ppem /
- face->header.Units_Per_EM;
+ metrics->horiBearingY = (FT_Short)( -originOffsetY + metrics->height );
+ metrics->horiAdvance = (FT_Short)( aadvance *
+ face->root.size->metrics.x_ppem /
+ face->header.Units_Per_EM );
}
return error;