Fix compiler warnings. * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Make `pitch' and `new_pitch' unsigned. * src/base/ftpsprop.c: Include FT_INTERNAL_POSTSCRIPT_PROPS_H.
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 113 114 115 116 117 118 119 120 121 122 123 124
diff --git a/ChangeLog b/ChangeLog
index a2ff9ff..b01d7cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2017-12-27 Werner Lemberg <wl@gnu.org>
+ Fix compiler warnings.
+
+ * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Make `pitch' and
+ `new_pitch' unsigned.
+
+ * src/base/ftpsprop.c: Include FT_INTERNAL_POSTSCRIPT_PROPS_H.
+
+2017-12-27 Werner Lemberg <wl@gnu.org>
+
Fixes for `make multi'.
* include/freetype/internal/ftpsprop.h: Use `FT_BASE_CALLBACK'.
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index 5ad21a3..9079081 100644
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -153,8 +153,8 @@
FT_UInt ypixels )
{
FT_Error error;
- int pitch;
- int new_pitch;
+ unsigned int pitch;
+ unsigned int new_pitch;
FT_UInt bpp;
FT_UInt width, height;
unsigned char* buffer = NULL;
@@ -162,29 +162,27 @@
width = bitmap->width;
height = bitmap->rows;
- pitch = bitmap->pitch;
- if ( pitch < 0 )
- pitch = -pitch;
+ pitch = (unsigned int)FT_ABS( bitmap->pitch );
switch ( bitmap->pixel_mode )
{
case FT_PIXEL_MODE_MONO:
bpp = 1;
- new_pitch = (int)( ( width + xpixels + 7 ) >> 3 );
+ new_pitch = ( width + xpixels + 7 ) >> 3;
break;
case FT_PIXEL_MODE_GRAY2:
bpp = 2;
- new_pitch = (int)( ( width + xpixels + 3 ) >> 2 );
+ new_pitch = ( width + xpixels + 3 ) >> 2;
break;
case FT_PIXEL_MODE_GRAY4:
bpp = 4;
- new_pitch = (int)( ( width + xpixels + 1 ) >> 1 );
+ new_pitch = ( width + xpixels + 1 ) >> 1;
break;
case FT_PIXEL_MODE_GRAY:
case FT_PIXEL_MODE_LCD:
case FT_PIXEL_MODE_LCD_V:
bpp = 8;
- new_pitch = (int)( width + xpixels );
+ new_pitch = width + xpixels;
break;
default:
return FT_THROW( Invalid_Glyph_Format );
@@ -194,7 +192,7 @@
if ( ypixels == 0 && new_pitch <= pitch )
{
/* zero the padding */
- FT_UInt bit_width = (FT_UInt)pitch * 8;
+ FT_UInt bit_width = pitch * 8;
FT_UInt bit_last = ( width + xpixels ) * bpp;
@@ -239,7 +237,7 @@
unsigned char* out = buffer;
unsigned char* limit = bitmap->buffer + pitch * bitmap->rows;
- int delta = new_pitch - pitch;
+ unsigned int delta = new_pitch - pitch;
FT_MEM_ZERO( out, new_pitch * ypixels );
@@ -263,7 +261,7 @@
unsigned char* out = buffer;
unsigned char* limit = bitmap->buffer + pitch * bitmap->rows;
- int delta = new_pitch - pitch;
+ unsigned int delta = new_pitch - pitch;
while ( in < limit )
@@ -282,11 +280,11 @@
FT_FREE( bitmap->buffer );
bitmap->buffer = buffer;
- if ( bitmap->pitch < 0 )
- new_pitch = -new_pitch;
-
/* set pitch only, width and height are left untouched */
- bitmap->pitch = new_pitch;
+ if ( bitmap->pitch < 0 )
+ bitmap->pitch = -(int)new_pitch;
+ else
+ bitmap->pitch = (int)new_pitch;
return FT_Err_Ok;
}
diff --git a/src/base/ftpsprop.c b/src/base/ftpsprop.c
index 790127b..1eace3e 100644
--- a/src/base/ftpsprop.c
+++ b/src/base/ftpsprop.c
@@ -22,6 +22,7 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_POSTSCRIPT_PROPS_H
/*************************************************************************/