ref: cb13e7109ce10a3860066e59ce8907ac67d2e297
parent: a974e9acdf9c436a8520dd883179ae19d93a1c17
author: Werner Lemberg <[email protected]>
date: Mon Feb 23 01:41:52 EST 2015
[smooth] Signedness fixes. * src/smooth/ftgrays.c, src/smooth/ftsmooth.c: Apply.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2015-02-22 Werner Lemberg <[email protected]>
+ [smooth] Signedness fixes.
+
+ * src/smooth/ftgrays.c, src/smooth/ftsmooth.c: Apply.
+
+2015-02-22 Werner Lemberg <[email protected]>
+
* src/raster/ftraster.c: Use the file's typedefs everywhere.
2015-02-22 Werner Lemberg <[email protected]>
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -476,7 +476,7 @@
/* */
static void
gray_init_cells( RAS_ARG_ void* buffer,
- long byte_size )
+ long byte_size )
{
ras.buffer = buffer;
ras.buffer_size = byte_size;
@@ -634,8 +634,8 @@
ras.ey = ey;
}
- ras.invalid = ( (unsigned)ey >= (unsigned)ras.count_ey ||
- ex >= ras.count_ex );
+ ras.invalid = ( (unsigned int)ey >= (unsigned int)ras.count_ey ||
+ ex >= ras.count_ex );
}
@@ -1208,7 +1208,7 @@
/* first of all, compute the scanline offset */
p = (unsigned char*)map->buffer - y * map->pitch;
if ( map->pitch >= 0 )
- p += (unsigned)( ( map->rows - 1 ) * map->pitch );
+ p += ( map->rows - 1 ) * (unsigned int)map->pitch;
for ( ; count > 0; count--, spans++ )
{
@@ -1838,13 +1838,13 @@
ras.ycells = (PCell*)ras.buffer;
ras.ycount = band->max - band->min;
- cell_start = sizeof ( PCell ) * ras.ycount;
- cell_mod = cell_start % sizeof ( TCell );
+ cell_start = (long)sizeof ( PCell ) * ras.ycount;
+ cell_mod = cell_start % (long)sizeof ( TCell );
if ( cell_mod > 0 )
- cell_start += sizeof ( TCell ) - cell_mod;
+ cell_start += (long)sizeof ( TCell ) - cell_mod;
cell_end = ras.buffer_size;
- cell_end -= cell_end % sizeof ( TCell );
+ cell_end -= cell_end % (long)sizeof ( TCell );
cells_max = (PCell)( (char*)ras.buffer + cell_end );
ras.cells = (PCell)( (char*)ras.buffer + cell_start );
@@ -1921,7 +1921,8 @@
TCell buffer[FT_MAX( FT_RENDER_POOL_SIZE, 2048 ) / sizeof ( TCell )];
long buffer_size = sizeof ( buffer );
- int band_size = (int)( buffer_size / ( sizeof ( TCell ) * 8 ) );
+ int band_size = (int)( buffer_size /
+ (long)( sizeof ( TCell ) * 8 ) );
if ( !raster )
@@ -1965,8 +1966,8 @@
/* compute clip box from target pixmap */
ras.clip_box.xMin = 0;
ras.clip_box.yMin = 0;
- ras.clip_box.xMax = target_map->width;
- ras.clip_box.yMax = target_map->rows;
+ ras.clip_box.xMax = (FT_Pos)target_map->width;
+ ras.clip_box.yMax = (FT_Pos)target_map->rows;
}
else if ( params->flags & FT_RASTER_FLAG_CLIP )
ras.clip_box = params->clip_box;
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -230,7 +230,7 @@
}
/* allocate new one */
- if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
+ if ( FT_ALLOC( bitmap->buffer, (FT_ULong)( pitch * height ) ) )
goto Exit;
else
have_buffer = TRUE;
@@ -243,8 +243,8 @@
bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
bitmap->num_grays = 256;
- bitmap->width = width;
- bitmap->rows = height;
+ bitmap->width = (unsigned int)width;
+ bitmap->rows = (unsigned int)height;
bitmap->pitch = pitch;
/* translate outline to render it into the bitmap */