* src/winfonts/winfnt.c: Signedness fixes.
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 125 126 127
diff --git a/ChangeLog b/ChangeLog
index f3468f2..d4e191c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2015-02-21 Werner Lemberg <wl@gnu.org>
+ * src/winfonts/winfnt.c: Signedness fixes.
+
+2015-02-21 Werner Lemberg <wl@gnu.org>
+
[type42] Signedness fixes.
* src/type42/t42parse.c, src/type42/t42parse.h,
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index c71b853..558bf8f 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -331,8 +331,8 @@
if ( type_id == 0x8008U )
{
font_count = count;
- font_offset = (FT_ULong)( FT_STREAM_POS() + 4 +
- ( stream->cursor - stream->limit ) );
+ font_offset = FT_STREAM_POS() + 4 +
+ (FT_ULong)( stream->cursor - stream->limit );
break;
}
@@ -370,8 +370,8 @@
if ( FT_NEW( face->font ) )
goto Exit;
- if ( FT_STREAM_SEEK( font_offset + face_index * 12 ) ||
- FT_FRAME_ENTER( 12 ) )
+ if ( FT_STREAM_SEEK( font_offset + (FT_ULong)face_index * 12 ) ||
+ FT_FRAME_ENTER( 12 ) )
goto Fail;
face->font->offset = (FT_ULong)FT_GET_USHORT_LE() << size_shift;
@@ -391,7 +391,7 @@
WinPE_RsrcDirEntryRec dir_entry1, dir_entry2, dir_entry3;
WinPE_RsrcDataEntryRec data_entry;
- FT_Long root_dir_offset, name_dir_offset, lang_dir_offset;
+ FT_ULong root_dir_offset, name_dir_offset, lang_dir_offset;
FT_UShort i, j, k;
@@ -739,9 +739,9 @@
/* we now need to fill the root FT_Face fields */
/* with relevant information */
{
- FT_Face root = FT_FACE( face );
- FNT_Font font = face->font;
- FT_PtrDist family_size;
+ FT_Face root = FT_FACE( face );
+ FNT_Font font = face->font;
+ FT_ULong family_size;
root->face_index = face_index;
@@ -769,9 +769,9 @@
FT_UShort x_res, y_res;
- bsize->width = font->header.avg_width;
- bsize->height = (FT_Short)(
- font->header.pixel_height + font->header.external_leading );
+ bsize->width = (FT_Short)font->header.avg_width;
+ bsize->height = (FT_Short)( font->header.pixel_height +
+ font->header.external_leading );
bsize->size = font->header.nominal_point_size << 6;
x_res = font->header.horizontal_resolution;
@@ -964,7 +964,7 @@
FNT_Font font;
FT_Error error = FT_Err_Ok;
FT_Byte* p;
- FT_Int len;
+ FT_UInt len;
FT_Bitmap* bitmap = &slot->bitmap;
FT_ULong offset;
FT_Bool new_format;
@@ -1009,7 +1009,7 @@
p = font->fnt_frame + offset;
- bitmap->width = FT_NEXT_SHORT_LE( p );
+ bitmap->width = FT_NEXT_USHORT_LE( p );
/* jump to glyph entry */
if ( new_format )
@@ -1030,12 +1030,12 @@
/* allocate and build bitmap */
{
FT_Memory memory = FT_FACE_MEMORY( slot->face );
- FT_Int pitch = ( bitmap->width + 7 ) >> 3;
+ FT_UInt pitch = ( bitmap->width + 7 ) >> 3;
FT_Byte* column;
FT_Byte* write;
- bitmap->pitch = pitch;
+ bitmap->pitch = (int)pitch;
bitmap->rows = font->header.pixel_height;
bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
@@ -1069,14 +1069,14 @@
slot->format = FT_GLYPH_FORMAT_BITMAP;
/* now set up metrics */
- slot->metrics.width = bitmap->width << 6;
- slot->metrics.height = bitmap->rows << 6;
- slot->metrics.horiAdvance = bitmap->width << 6;
+ slot->metrics.width = (FT_Pos)( bitmap->width << 6 );
+ slot->metrics.height = (FT_Pos)( bitmap->rows << 6 );
+ slot->metrics.horiAdvance = (FT_Pos)( bitmap->width << 6 );
slot->metrics.horiBearingX = 0;
slot->metrics.horiBearingY = slot->bitmap_top << 6;
ft_synthesize_vertical_metrics( &slot->metrics,
- bitmap->rows << 6 );
+ (FT_Pos)( bitmap->rows << 6 ) );
Exit:
return error;