[cache] Signedness fixes.

* src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftcimage.c,
src/cache/ftcmanag.c, src/cache/ftcsbits.c: Apply.
This commit is contained in:
Werner Lemberg 2015-02-25 06:57:16 +01:00
parent 559727d519
commit 24e4e96aff
6 changed files with 27 additions and 13 deletions

View File

@ -1,3 +1,10 @@
2015-02-25 Werner Lemberg <wl@gnu.org>
[cache] Signedness fixes.
* src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftcimage.c,
src/cache/ftcmanag.c, src/cache/ftcsbits.c: Apply.
2015-02-25 Werner Lemberg <wl@gnu.org>
Change dimension fields in `FTC_ImageTypeRec' to unsigned type.

14
src/cache/ftcbasic.c vendored
View File

@ -138,8 +138,10 @@
FT_Face face = size->face;
error = FT_Load_Glyph( face, gindex,
family->attrs.load_flags | FT_LOAD_RENDER );
error = FT_Load_Glyph(
face,
gindex,
(FT_Int)family->attrs.load_flags | FT_LOAD_RENDER );
if ( !error )
*aface = face;
}
@ -169,7 +171,9 @@
{
face = size->face;
error = FT_Load_Glyph( face, gindex, family->attrs.load_flags );
error = FT_Load_Glyph( face,
gindex,
(FT_Int)family->attrs.load_flags );
if ( !error )
{
if ( face->glyph->format == FT_GLYPH_FORMAT_BITMAP ||
@ -300,7 +304,7 @@
if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX )
FT_TRACE1(( "FTC_ImageCache_Lookup:"
" higher bits in load_flags 0x%x are dropped\n",
type->flags & ~((FT_ULong)FT_UINT_MAX) ));
(FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) ));
query.attrs.scaler.face_id = type->face_id;
query.attrs.scaler.width = type->width;
@ -481,7 +485,7 @@
if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX )
FT_TRACE1(( "FTC_ImageCache_Lookup:"
" higher bits in load_flags 0x%x are dropped\n",
type->flags & ~((FT_ULong)FT_UINT_MAX) ));
(FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) ));
query.attrs.scaler.face_id = type->face_id;
query.attrs.scaler.width = type->width;

2
src/cache/ftccmap.c vendored
View File

@ -270,7 +270,7 @@
query.cmap_index = (FT_UInt)cmap_index;
query.char_code = char_code;
hash = FTC_CMAP_HASH( face_id, cmap_index, char_code );
hash = FTC_CMAP_HASH( face_id, (FT_UInt)cmap_index, char_code );
#if 1
FTC_CACHE_LOOKUP_CMP( cache, ftc_cmap_node_compare, hash, &query,

View File

@ -133,9 +133,9 @@
outg = (FT_OutlineGlyph)glyph;
size = outg->outline.n_points *
size = (FT_Offset)outg->outline.n_points *
( sizeof ( FT_Vector ) + sizeof ( FT_Byte ) ) +
outg->outline.n_contours * sizeof ( FT_Short ) +
(FT_Offset)outg->outline.n_contours * sizeof ( FT_Short ) +
sizeof ( *outg );
}
break;

View File

@ -60,8 +60,11 @@
if ( scaler->pixel )
error = FT_Set_Pixel_Sizes( face, scaler->width, scaler->height );
else
error = FT_Set_Char_Size( face, scaler->width, scaler->height,
scaler->x_res, scaler->y_res );
error = FT_Set_Char_Size( face,
(FT_F26Dot6)scaler->width,
(FT_F26Dot6)scaler->height,
scaler->x_res,
scaler->y_res );
if ( error )
{
FT_Done_Size( size );

View File

@ -52,7 +52,7 @@
if ( pitch < 0 )
pitch = -pitch;
size = (FT_ULong)( pitch * bitmap->rows );
size = (FT_ULong)pitch * bitmap->rows;
if ( !FT_ALLOC( sbit->buffer, size ) )
FT_MEM_COPY( sbit->buffer, bitmap->buffer, size );
@ -181,7 +181,7 @@
/* now, compute size */
if ( asize )
*asize = FT_ABS( sbit->pitch ) * sbit->height;
*asize = (FT_ULong)FT_ABS( sbit->pitch ) * sbit->height;
} /* glyph loading successful */
@ -302,7 +302,7 @@
pitch = -pitch;
/* add the size of a given glyph image */
size += pitch * sbit->height;
size += (FT_Offset)pitch * sbit->height;
}
}