[smooth] Fix Savannah bug #35604 (cont'd). * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and casts that became unnecessary after the variable type upgrades.
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
diff --git a/ChangeLog b/ChangeLog
index 4a09f59..87ae1a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-10-30 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [smooth] Fix Savannah bug #35604 (cont'd).
+
+ * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and
+ casts that became unnecessary after the variable type upgrades.
+
2014-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
[smooth] Improve code readability.
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index fce42cf..7323042 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -155,27 +155,8 @@
cbox.xMax = FT_PIX_CEIL( cbox.xMax );
cbox.yMax = FT_PIX_CEIL( cbox.yMax );
- if ( cbox.xMin < 0 && cbox.xMax > FT_INT_MAX + cbox.xMin )
- {
- FT_ERROR(( "ft_smooth_render_generic: glyph too large:"
- " xMin = %d, xMax = %d\n",
- cbox.xMin >> 6, cbox.xMax >> 6 ));
- error = FT_THROW( Raster_Overflow );
- goto Exit;
- }
- else
- width = ( cbox.xMax - cbox.xMin ) >> 6;
-
- if ( cbox.yMin < 0 && cbox.yMax > FT_INT_MAX + cbox.yMin )
- {
- FT_ERROR(( "ft_smooth_render_generic: glyph too large:"
- " yMin = %d, yMax = %d\n",
- cbox.yMin >> 6, cbox.yMax >> 6 ));
- error = FT_THROW( Raster_Overflow );
- goto Exit;
- }
- else
- height = ( cbox.yMax - cbox.yMin ) >> 6;
+ width = (FT_ULong)( cbox.xMax - cbox.xMin ) >> 6;
+ height = (FT_ULong)( cbox.yMax - cbox.yMin ) >> 6;
#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
width_org = width;
@@ -192,10 +173,10 @@
if ( vmul )
height *= 3;
- x_shift = (FT_Int) cbox.xMin;
- y_shift = (FT_Int) cbox.yMin;
- x_left = (FT_Int)( cbox.xMin >> 6 );
- y_top = (FT_Int)( cbox.yMax >> 6 );
+ x_shift = cbox.xMin;
+ y_shift = cbox.yMin;
+ x_left = cbox.xMin >> 6;
+ y_top = cbox.yMax >> 6;
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
@@ -222,8 +203,6 @@
#endif
-#if FT_UINT_MAX > 0xFFFFU
-
/* Required check is (pitch * height < FT_ULONG_MAX), */
/* but we care realistic cases only. Always pitch <= width. */
if ( width > 0x7FFF || height > 0x7FFF )
@@ -234,8 +213,6 @@
goto Exit;
}
-#endif
-
bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
bitmap->num_grays = 256;
bitmap->width = width;