[smooth] Signedness fixes. * src/smooth/ftgrays.c, src/smooth/ftsmooth.c: Apply.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
diff --git a/ChangeLog b/ChangeLog
index f20ecf4..17e4379 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2015-02-22 Werner Lemberg <wl@gnu.org>
+ [smooth] Signedness fixes.
+
+ * src/smooth/ftgrays.c, src/smooth/ftsmooth.c: Apply.
+
+2015-02-22 Werner Lemberg <wl@gnu.org>
+
* src/raster/ftraster.c: Use the file's typedefs everywhere.
2015-02-22 Werner Lemberg <wl@gnu.org>
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 1347141..2ac451a 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -476,7 +476,7 @@ typedef ptrdiff_t FT_PtrDist;
/* */
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 @@ typedef ptrdiff_t FT_PtrDist;
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 @@ typedef ptrdiff_t FT_PtrDist;
/* 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 @@ typedef ptrdiff_t FT_PtrDist;
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 @@ typedef ptrdiff_t FT_PtrDist;
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 @@ typedef ptrdiff_t FT_PtrDist;
/* 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;
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index 4430cc1..3620550 100644
--- 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 */