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.
This commit is contained in:
Werner Lemberg 2018-07-04 11:49:47 +02:00
parent d9d300ab6b
commit 29f05fd02d
3 changed files with 16 additions and 7 deletions

View File

@ -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.

View File

@ -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 ));

View File

@ -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;