16bit fixes from Wolfgang Domröse. * src/type1/t1parse.h (T1_ParserRec): Change type of `base_len' and `private_len' to FT_Long. * src/type1/t1parse.c (T1_Get_Private_Dict): Remove cast for `private_len'. * src/type1/t1load.c: Use FT_Int cast for most calls of T1_ToInt. Use FT_PtrDist where appropriate. (parse_encoding): Use FT_Long for `count' and `n'. (read_binary_data): Use FT_Long* for second parameter. * src/type1/t1afm.c (afm_atoindex): Use FT_PtrDist. * src/cache/ftcsbits.c (ftc_sbit_node_load): Remove unused label. * src/pshinter/pshalgo3.c (psh3_hint_align): Remove unused variable.
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
diff --git a/ChangeLog b/ChangeLog
index 6802deb..3b159a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,16 @@
2002-09-16 Werner Lemberg <wl@gnu.org>
+ 16bit fixes from Wolfgang Domröse.
+
* src/type1/t1parse.h (T1_ParserRec): Change type of `base_len'
and `private_len' to FT_Long.
+ * src/type1/t1parse.c (T1_Get_Private_Dict): Remove cast for
+ `private_len'.
+ * src/type1/t1load.c: Use FT_Int cast for most calls of T1_ToInt.
+ Use FT_PtrDist where appropriate.
+ (parse_encoding): Use FT_Long for `count' and `n'.
+ (read_binary_data): Use FT_Long* for second parameter.
+ * src/type1/t1afm.c (afm_atoindex): Use FT_PtrDist.
* src/cache/ftcsbits.c (ftc_sbit_node_load): Remove unused label.
* src/pshinter/pshalgo3.c (psh3_hint_align): Remove unused variable.
diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
index a8f993f..71ccd1e 100644
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -56,10 +56,10 @@
FT_Byte* limit,
T1_Font type1 )
{
- FT_Byte* p = *start;
- FT_Int len;
- FT_UInt result = 0;
- char temp[64];
+ FT_Byte* p = *start;
+ FT_PtrDist len;
+ FT_UInt result = 0;
+ char temp[64];
/* skip whitespace */
@@ -72,7 +72,7 @@
while ( IS_ALPHANUM( *p ) && p < limit )
p++;
- len = (FT_Int)( p - *start );
+ len = p - *start;
if ( len > 0 && len < 64 )
{
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index b9f8edb..70fda88 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -415,16 +415,16 @@
/* each token is an immediate containing the name of the axis */
for ( n = 0; n < num_axis; n++ )
{
- T1_Token token = axis_tokens + n;
- FT_Byte* name;
- FT_Int len;
+ T1_Token token = axis_tokens + n;
+ FT_Byte* name;
+ FT_PtrDist len;
/* skip first slash, if any */
if ( token->start[0] == '/' )
token->start++;
- len = (FT_Int)( token->limit - token->start );
+ len = token->limit - token->start;
if ( len <= 0 )
{
error = T1_Err_Invalid_File_Format;
@@ -794,7 +794,7 @@
static int
read_binary_data( T1_Parser parser,
- FT_Int* size,
+ FT_Long* size,
FT_Byte** base )
{
FT_Byte* cur;
@@ -838,13 +838,13 @@
parse_font_name( T1_Face face,
T1_Loader loader )
{
- T1_Parser parser = &loader->parser;
- FT_Error error;
- FT_Memory memory = parser->root.memory;
- FT_Int len;
- FT_Byte* cur;
- FT_Byte* cur2;
- FT_Byte* limit;
+ T1_Parser parser = &loader->parser;
+ FT_Error error;
+ FT_Memory memory = parser->root.memory;
+ FT_PtrDist len;
+ FT_Byte* cur;
+ FT_Byte* cur2;
+ FT_Byte* limit;
if ( face->type1.font_name )
@@ -864,7 +864,7 @@
while ( cur2 < limit && is_alpha( *cur2 ) )
cur2++;
- len = (FT_Int)( cur2 - cur );
+ len = cur2 - cur;
if ( len > 0 )
{
if ( FT_ALLOC( face->type1.font_name, len + 1 ) )
@@ -987,7 +987,7 @@
return;
/* read the number of entries in the encoding, should be 256 */
- count = T1_ToInt( parser );
+ count = (FT_Int)T1_ToInt( parser );
if ( parser->root.error )
return;
@@ -1055,7 +1055,7 @@
parser->root.cursor = cur;
- charcode = T1_ToInt( parser );
+ charcode = (FT_Int)T1_ToInt( parser );
cur = parser->root.cursor;
/* skip whitespace */
@@ -1066,14 +1066,14 @@
{
/* bingo, we have an immediate name -- it must be a */
/* character name */
- FT_Byte* cur2 = cur + 1;
- FT_Int len;
+ FT_Byte* cur2 = cur + 1;
+ FT_PtrDist len;
while ( cur2 < limit && is_alpha( *cur2 ) )
cur2++;
- len = (FT_Int)( cur2 - cur - 1 );
+ len = cur2 - cur - 1;
parser->root.error = T1_Add_Table( char_table, charcode,
cur + 1, len + 1 );
@@ -1133,7 +1133,7 @@
/* with synthetic fonts, it's possible we get here twice */
return;
- loader->num_subrs = T1_ToInt( parser );
+ loader->num_subrs = (FT_Int)T1_ToInt( parser );
if ( parser->root.error )
return;
@@ -1153,7 +1153,7 @@
/* */
for ( n = 0; n < loader->num_subrs; n++ )
{
- FT_Int idx, size;
+ FT_Long idx, size;
FT_Byte* base;
@@ -1237,7 +1237,7 @@
/* with synthetic fonts, it's possible we get here twice */
return;
- loader->num_glyphs = T1_ToInt( parser );
+ loader->num_glyphs = (FT_Int)T1_ToInt( parser );
if ( parser->root.error )
return;
@@ -1268,7 +1268,7 @@
for (;;)
{
- FT_Int size;
+ FT_Long size;
FT_Byte* base;
@@ -1300,13 +1300,13 @@
T1_Skip_Alpha( parser );
else
{
- FT_Byte* cur2 = cur + 1;
- FT_Int len;
+ FT_Byte* cur2 = cur + 1;
+ FT_PtrDist len;
while ( cur2 < limit && is_alpha( *cur2 ) )
cur2++;
- len = (FT_Int)( cur2 - cur - 1 );
+ len = cur2 - cur - 1;
error = T1_Add_Table( name_table, n, cur + 1, len + 1 );
if ( error )
@@ -1558,8 +1558,8 @@
/* look for immediates */
else if ( *cur == '/' && cur + 2 < limit )
{
- FT_Byte* cur2;
- FT_Int len;
+ FT_Byte* cur2;
+ FT_PtrDist len;
cur++;
@@ -1567,7 +1567,7 @@
while ( cur2 < limit && is_alpha( *cur2 ) )
cur2++;
- len = (FT_Int)( cur2 - cur );
+ len = cur2 - cur;
if ( len > 0 && len < 22 )
{
{
@@ -1584,10 +1584,10 @@
if ( !name )
break;
- if ( cur[0] == name[0] &&
- len == (FT_Int)ft_strlen( (const char*)name ) )
+ if ( cur[0] == name[0] &&
+ len == ft_strlen( (const char*)name ) )
{
- FT_Int n;
+ FT_PtrDist n;
for ( n = 1; n < len; n++ )
diff --git a/src/type1/t1parse.c b/src/type1/t1parse.c
index 3107e0a..c1783f0 100644
--- a/src/type1/t1parse.c
+++ b/src/type1/t1parse.c
@@ -440,7 +440,7 @@
}
/* put a safeguard */
- parser->private_len = (FT_Int)( write - parser->private_dict );
+ parser->private_len = write - parser->private_dict;
*write++ = 0;
}
}