summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2018-07-04 11:49:47 +0200
committerWerner Lemberg <wl@gnu.org>2018-07-04 11:49:47 +0200
commit29f05fd02d2ba51965f994456d41ed1e9c9f769a (patch)
tree131700a21945c9414b765b64f19c013246d8919f
parentd9d300ab6bd8895b9247213ac87b26cc76a3fc5d (diff)
downloadfreetype2-29f05fd02d2ba51965f994456d41ed1e9c9f769a.tar.gz
Fix 32bit build warnings (#54239).
* src/base/ftbitmap.c (FT_Bitmap_Blend): Add casts to avoid signed vs. unsigned comparisons. * srb/sfnt/ttcolr.c (tt_face_get_colr_layer): Ditto.
-rw-r--r--ChangeLog9
-rw-r--r--src/base/ftbitmap.c12
-rw-r--r--src/sfnt/ttcolr.c2
3 files changed, 16 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 4941e0e24..9f927fcd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2018-07-04 Werner Lemberg <wl@gnu.org>
+
+ Fix 32bit build warnings (#54239).
+
+ * src/base/ftbitmap.c (FT_Bitmap_Blend): Add casts to avoid signed
+ vs. unsigned comparisons.
+
+ * srb/sfnt/ttcolr.c (tt_face_get_colr_layer): Ditto.
+
2018-07-02 Jeff Carey <Jeff.Carey@monotype.com>
* src/psnames/psmodule.c (ps_unicodes_init): Fix alloc debugging.
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index 7a08cc968..dc28c406d 100644
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -860,7 +860,7 @@
/* get source bitmap dimensions */
source_llx = source_offset.x;
- if ( FT_LONG_MIN + ( source_->rows << 6 ) + 64 > source_offset.y )
+ if ( FT_LONG_MIN + (FT_Pos)( source_->rows << 6 ) + 64 > source_offset.y )
{
FT_TRACE5((
"FT_Bitmap_Blend: y coordinate overflow in source bitmap\n" ));
@@ -868,7 +868,7 @@
}
source_lly = source_offset.y - ( source_->rows << 6 );
- if ( FT_LONG_MAX - ( source_->width << 6 ) - 64 < source_llx )
+ if ( FT_LONG_MAX - (FT_Pos)( source_->width << 6 ) - 64 < source_llx )
{
FT_TRACE5((
"FT_Bitmap_Blend: x coordinate overflow in source bitmap\n" ));
@@ -881,7 +881,7 @@
if ( target->width && target->rows )
{
target_llx = target_offset.x;
- if ( FT_LONG_MIN + ( target->rows << 6 ) > target_offset.y )
+ if ( FT_LONG_MIN + (FT_Pos)( target->rows << 6 ) > target_offset.y )
{
FT_TRACE5((
"FT_Bitmap_Blend: y coordinate overflow in target bitmap\n" ));
@@ -889,7 +889,7 @@
}
target_lly = target_offset.y - ( target->rows << 6 );
- if ( FT_LONG_MAX - ( target->width << 6 ) < target_llx )
+ if ( FT_LONG_MAX - (FT_Pos)( target->width << 6 ) < target_llx )
{
FT_TRACE5((
"FT_Bitmap_Blend: x coordinate overflow in target bitmap\n" ));
@@ -968,7 +968,7 @@
target->pitch = (int)final_width * 4;
target->num_grays = 256;
- if ( FT_LONG_MAX / target->pitch < target->rows )
+ if ( FT_LONG_MAX / target->pitch < (int)target->rows )
{
FT_TRACE5(( "FT_Blend_Bitmap: target bitmap too large (%d x %d)\n",
final_width, final_rows ));
@@ -995,7 +995,7 @@
new_pitch = (int)final_width * 4;
- if ( FT_LONG_MAX / new_pitch < final_rows )
+ if ( FT_LONG_MAX / new_pitch < (int)final_rows )
{
FT_TRACE5(( "FT_Blend_Bitmap: target bitmap too large (%d x %d)\n",
final_width, final_rows ));
diff --git a/src/sfnt/ttcolr.c b/src/sfnt/ttcolr.c
index 977e149b6..a8ff0261f 100644
--- a/src/sfnt/ttcolr.c
+++ b/src/sfnt/ttcolr.c
@@ -255,7 +255,7 @@
*aglyph_index = FT_NEXT_USHORT( iterator->p );
*acolor_index = FT_NEXT_USHORT( iterator->p );
- if ( *aglyph_index >= FT_FACE( face )->num_glyphs ||
+ if ( *aglyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) ||
( *acolor_index != 0xFFFF &&
*acolor_index >= face->palette_data.num_palette_entries ) )
return 0;