* include/freetype/internal/psaux.h (PS_TableRec): Change type of `lengths' to FT_PtrDist. (T1_DecoderRec): Change type of `subrs_len' to FT_PtrDist. * include/freetype/internal/t1types.h (T1_FontRec): Change type of `subrs_len' and `charstrings_len' to FT_PtrDist. * src/base/ftobjs.c (Mac_Read_POST_Resource): Replace `junk' variable with better solution. (IsMacResource): Remove unused variable `map_len'. Replace `junk' variable with better solution. (FT_Open_Face) [!FT_MACINTOSH]: Add conditional FT_CONFIG_OPTION_MAC_FONTS. * src/autohint/ahhint.c (ah_hinter_hint_edges, ah_hinter_align_strong_points): Add some casts. * src/base/ftoutln.c (FT_OrientationExtremumRec): Change type of `pos' to FT_Long. * src/base/ftobjs.c (Mac_Read_POST_Resource, Mac_Read_sfnt_Resource): Change type of `len' to FT_Long. * src/type42/t42parse.c (t42_parse_dict): Add cast for `n_keywords'.
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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
diff --git a/ChangeLog b/ChangeLog
index 5ff28eb..9b9f670 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2003-12-08 Werner Lemberg <wl@gnu.org>
+
+ * include/freetype/internal/psaux.h (PS_TableRec): Change type
+ of `lengths' to FT_PtrDist.
+ (T1_DecoderRec): Change type of `subrs_len' to FT_PtrDist.
+ * include/freetype/internal/t1types.h (T1_FontRec): Change type
+ of `subrs_len' and `charstrings_len' to FT_PtrDist.
+
+ * src/base/ftobjs.c (Mac_Read_POST_Resource): Replace `junk'
+ variable with better solution.
+ (IsMacResource): Remove unused variable `map_len'.
+ Replace `junk' variable with better solution.
+ (FT_Open_Face) [!FT_MACINTOSH]: Add conditional
+ FT_CONFIG_OPTION_MAC_FONTS.
+
+2003-12-08 Wolfgang Domröse <porthos.domroese@harz.de>
+
+ * src/autohint/ahhint.c (ah_hinter_hint_edges,
+ ah_hinter_align_strong_points): Add some casts.
+
+ * src/base/ftoutln.c (FT_OrientationExtremumRec): Change type
+ of `pos' to FT_Long.
+
+ * src/base/ftobjs.c (Mac_Read_POST_Resource,
+ Mac_Read_sfnt_Resource): Change type of `len' to FT_Long.
+
+ * src/type42/t42parse.c (t42_parse_dict): Add cast for `n_keywords'.
+
2003-12-07 Werner Lemberg <wl@gnu.org>
* docs/raster.txt: New file, taken from FreeType 1 and completely
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index e013d52..8d419be 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -124,7 +124,7 @@ FT_BEGIN_HEADER
FT_Int max_elems;
FT_Int num_elems;
FT_Byte** elements; /* addresses of table elements */
- FT_Int* lengths; /* lengths of table elements */
+ FT_PtrDist* lengths; /* lengths of table elements */
FT_Memory memory;
PS_Table_FuncsRec funcs;
@@ -658,7 +658,7 @@ FT_BEGIN_HEADER
FT_Int lenIV; /* internal for sub routine calls */
FT_UInt num_subrs;
FT_Byte** subrs;
- FT_Int* subrs_len; /* array of subrs length (optional) */
+ FT_PtrDist* subrs_len; /* array of subrs length (optional) */
FT_Matrix font_matrix;
FT_Vector font_offset;
diff --git a/include/freetype/internal/t1types.h b/include/freetype/internal/t1types.h
index 08bdfb1..8de9a6b 100644
--- a/include/freetype/internal/t1types.h
+++ b/include/freetype/internal/t1types.h
@@ -102,12 +102,12 @@ FT_BEGIN_HEADER
FT_Int num_subrs;
FT_Byte** subrs;
- FT_Int* subrs_len;
+ FT_PtrDist* subrs_len;
FT_Int num_glyphs;
FT_String** glyph_names; /* array of glyph names */
FT_Byte** charstrings; /* array of glyph charstrings */
- FT_Int* charstrings_len;
+ FT_PtrDist* charstrings_len;
FT_Byte paint_type;
FT_Byte font_type;
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index 4a10bd5..aad5725 100644
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -703,7 +703,7 @@
/* the third (lowest) stem aligns with the base line; it might end up */
/* one pixel higher or lower. */
- n_edges = edge_limit - edges;
+ n_edges = (FT_Int)( edge_limit - edges );
if ( !dimension && ( n_edges == 6 || n_edges == 12 ) )
{
AH_EdgeRec *edge1, *edge2, *edge3;
@@ -943,7 +943,7 @@
/* find enclosing edges */
min = 0;
- max = edge_limit - edges;
+ max = (FT_UInt)( edge_limit - edges );
while ( min < max )
{
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 69f74c0..8d1c5fa 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1135,9 +1135,10 @@
FT_Error error = FT_Err_Cannot_Open_Resource;
FT_Memory memory = library->memory;
FT_Byte* pfb_data;
- int i, type, flags, len;
+ int i, type, flags;
+ FT_Long len;
FT_Long pfb_len, pfb_pos, pfb_lenpos;
- FT_Long rlen, junk, temp;
+ FT_Long rlen, temp;
FT_Long *offsets;
@@ -1156,12 +1157,11 @@
/* Find all the POST resource offsets */
for ( i = 0; i < resource_cnt; ++i )
{
- (void)FT_READ_USHORT( junk ); /* resource id */
- (void)FT_READ_USHORT( junk ); /* rsource name */
+ (void)FT_STREAM_SKIP( 4 ); /* resource id and resource name */
if ( FT_READ_LONG( temp ) )
goto Exit;
offsets[i] = resource_data + ( temp & 0xFFFFFFL );
- (void)FT_READ_LONG( junk ); /* mbz */
+ (void)FT_STREAM_SKIP( 4 ); /* mbz */
}
/* Find the length of all the POST resources, concatenated. Assume */
@@ -1273,7 +1273,7 @@
FT_Error error;
int i;
FT_Long flag_offset= 0xFFFFFFL;
- FT_Long rlen, junk;
+ FT_Long rlen;
int is_cff;
@@ -1288,12 +1288,11 @@
for ( i = 0; i <= face_index; ++i )
{
- (void)FT_READ_USHORT( junk ); /* resource id */
- (void)FT_READ_USHORT( junk ); /* rsource name */
+ (void)FT_STREAM_SKIP( 4 ); /* resource id and resource name */
if ( FT_READ_LONG( flag_offset ) )
goto Exit;
flag_offset &= 0xFFFFFFL;
- (void)FT_READ_LONG( junk ); /* mbz */
+ (void)FT_STREAM_SKIP( 4 ); /* mbz */
}
if ( flag_offset == 0xFFFFFFL )
@@ -1344,9 +1343,9 @@
{
FT_Error error;
unsigned char head[16], head2[16];
- FT_Long rdata_pos, map_pos, rdata_len, map_len;
+ FT_Long rdata_pos, map_pos, rdata_len;
int allzeros, allmatch, i, cnt, subcnt;
- FT_Long type_list, rpos, junk;
+ FT_Long type_list, rpos;
FT_ULong tag;
@@ -1369,10 +1368,7 @@
( head[ 9] << 16 ) |
( head[10] << 8 ) |
head[11];
- map_len = ( head[12] << 24 ) |
- ( head[13] << 16 ) |
- ( head[14] << 8 ) |
- head[15];
+ /* map_len = head[12] .. head[15] */
if ( rdata_pos + rdata_len != map_pos || map_pos == resource_offset )
return FT_Err_Unknown_File_Format;
@@ -1402,9 +1398,9 @@
/* If we've gotten this far then it's probably a mac resource file. */
/* Now, does it contain any interesting resources? */
- (void)FT_READ_LONG( junk ); /* skip handle to next resource map */
- (void)FT_READ_USHORT( junk ); /* skip file resource number */
- (void)FT_READ_USHORT( junk ); /* skip attributes */
+ /* Skip handle to next resource map, the file resource number, and */
+ /* attributes. */
+ (void)FT_STREAM_SKIP( 4 + 2 + 2 );
if ( FT_READ_USHORT( type_list ) )
goto Exit;
@@ -1675,7 +1671,7 @@
FT_ERROR_BASE( error ) != FT_Err_Invalid_Stream_Operation )
goto Fail2;
-#ifndef FT_MACINTOSH
+#if !defined( FT_MACINTOSH ) && defined( FT_CONFIG_OPTION_MAC_FONTS )
error = load_mac_face( library, stream, face_index, aface, args );
if ( !error )
{
@@ -1690,7 +1686,7 @@
if ( FT_ERROR_BASE( error ) != FT_Err_Unknown_File_Format )
goto Fail2;
-#endif /* !FT_MACINTOSH */
+#endif /* !FT_MACINTOSH && FT_CONFIG_OPTION_MAC_FONTS */
/* no driver is able to handle this format */
error = FT_Err_Unknown_File_Format;
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index c19e210..5bcdf13 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -658,10 +658,10 @@
typedef struct FT_OrientationExtremumRec_
{
- FT_Int index;
- FT_Int pos;
- FT_Int first;
- FT_Int last;
+ FT_Int index;
+ FT_Long pos;
+ FT_Int first;
+ FT_Int last;
} FT_OrientationExtremumRec;
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 826947d..7f49530 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -142,7 +142,7 @@
/* table :: The target table. */
/* */
/* <Input> */
- /* idx :: The index of the object in the table. */
+ /* idx :: The index of the object in the table. */
/* */
/* object :: The address of the object to copy in memory. */
/* */
diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c
index 20dcb90..bf97947 100644
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -964,8 +964,8 @@
{
T42_Parser parser = &loader->parser;
FT_Byte* limit;
- int n_keywords = sizeof ( t42_keywords ) /
- sizeof ( t42_keywords[0] );
+ FT_Int n_keywords = (FT_Int)( sizeof ( t42_keywords ) /
+ sizeof ( t42_keywords[0] ) );
parser->root.cursor = base;