* src/*/*.c: Added many casts to make code more 64bit-safe.

This commit is contained in:
Werner Lemberg 2001-03-10 17:07:42 +00:00
parent 7124a8e59c
commit 914b289f16
19 changed files with 40 additions and 34 deletions

View File

@ -1,3 +1,7 @@
2001-03-10 Henrik Grubbström <grubba@roxen.com>
* src/*/*.c: Added many casts to make code more 64bit-safe.
2001-03-07 Werner Lemberg <wl@gnu.org>
* INSTALL, docs/BUILD: We need GNU make 3.78 or newer.

View File

@ -157,7 +157,7 @@
/* segment; we first need to find in which contour the extremum */
/* lies, then see its previous and next points */
{
FT_Int index = extremum - points;
FT_Int index = (FT_Int)( extremum - points );
FT_Int n;
FT_Int first, last, prev, next, end;
FT_Pos dist;

View File

@ -1109,7 +1109,7 @@
}
}
*p_num_edges = edge_limit - edges;
*p_num_edges = (FT_Int)( edge_limit - edges );
/*********************************************************************/

View File

@ -300,7 +300,7 @@
if ( !error )
{
/* good, now set the set index within the set object */
cset->cset_index = node - lru->nodes;
cset->cset_index = (FT_UInt)( node - lru->nodes );
node->root.data = cset;
}

View File

@ -327,7 +327,7 @@
if ( !error )
{
/* good, now set the gset index within the gset object */
gset->gset_index = node - lru->nodes;
gset->gset_index = (FT_UInt)( node - lru->nodes );
node->root.data = gset;
}

View File

@ -332,7 +332,7 @@
while ( cur2 < limit && is_alpha( *cur2 ) )
cur2++;
len = cur2 - cur;
len = (FT_Int)( cur2 - cur );
if ( len > 0 && len < 22 )
{
/* now compare the immediate name to the keyword table */

View File

@ -109,7 +109,7 @@
if ( p[0] == 'S' && strncmp( (char*)p, "StartData", 9 ) == 0 )
{
/* save offset of binary data after `StartData' */
offset = top_position - ( limit - p ) + 10;
offset = (FT_ULong)( top_position - ( limit - p ) + 10 );
goto Found;
}
}

View File

@ -84,7 +84,7 @@
void shift_elements( PS_Table* table,
FT_Byte* old_base )
{
FT_Long delta = table->block - old_base;
FT_Long delta = (FT_Long)( table->block - old_base );
FT_Byte** offset = table->elements;
FT_Byte** limit = offset + table->max_elems;
@ -412,7 +412,7 @@
cur++;
}
*pnum_tokens = cur - tokens;
*pnum_tokens = (FT_Int)( cur - tokens );
parser->cursor = old_cursor;
parser->limit = old_limit;
@ -847,7 +847,7 @@
case t1_field_string:
{
FT_Memory memory = parser->memory;
FT_UInt len = limit-cur;
FT_UInt len = (FT_UInt)( limit - cur );
if ( *(FT_String**)q )

View File

@ -100,7 +100,7 @@
while ( *p && *p != '.' )
p++;
len = p - glyph_name;
len = (int)( p - glyph_name );
if ( *p && len < 64 )
{
@ -181,7 +181,7 @@
}
/* now, compress the table a bit */
count = map - table->maps;
count = (FT_UInt)( map - table->maps );
if ( count > 0 && REALLOC( table->maps,
num_glyphs * sizeof ( PS_UniMap ),

View File

@ -620,7 +620,7 @@
PProfile oldProfile;
h = ras.top - ras.cProfile->offset;
h = (Long)( ras.top - ras.cProfile->offset );
if ( h < 0 )
{
@ -1102,7 +1102,7 @@
else
{
e = CEILING( y1 );
f1 = FRAC( y1 );
f1 = (Short)( FRAC( y1 ) );
e0 = e;
if ( f1 == 0 )
@ -2189,7 +2189,7 @@
e1 = TRUNC( e1 );
c1 = (Short)( e1 >> 3 );
f1 = e1 & 7;
f1 = (Short)( e1 & 7 );
if ( e1 >= 0 && e1 < ras.bWidth &&
ras.bTarget[ras.traceOfs + c1] & ( 0x80 >> f1 ) )
@ -2215,7 +2215,7 @@
if ( e1 >= 0 && e1 < ras.bWidth )
{
c1 = (Short)( e1 >> 3 );
f1 = e1 & 7;
f1 = (Short)( e1 & 7 );
if ( ras.gray_min_x > c1 ) ras.gray_min_x = c1;
if ( ras.gray_max_x < c1 ) ras.gray_max_x = c1;
@ -2677,7 +2677,7 @@
Q = P->link;
bottom = (Short)P->start;
top = (Short)P->start + P->height - 1;
top = (Short)( P->start + P->height - 1 );
if ( min_Y > bottom ) min_Y = bottom;
if ( max_Y < top ) max_Y = top;
@ -2705,7 +2705,7 @@
while ( P )
{
P->countL = P->start - min_Y;
P->countL = (UShort)( P->start - min_Y );
P = P->link;
}

View File

@ -97,7 +97,7 @@
error = TT_Get_PS_Name( face, glyph_index, &gname );
if ( !error && buffer_max > 0 )
{
FT_UInt len = strlen( gname );
FT_UInt len = (FT_UInt)( strlen( gname ) );
if ( len >= buffer_max )

View File

@ -493,10 +493,10 @@
else
{
/* otherwise, we must use the glyphIdArray to do it */
index1 = seg4->idRangeOffset / 2
+ ( charCode - seg4->startCount )
+ ( seg4 - cmap4->segments )
- segCount;
index1 = (FT_UInt)( seg4->idRangeOffset / 2
+ ( charCode - seg4->startCount )
+ ( seg4 - cmap4->segments )
- segCount );
if ( index1 < (FT_UInt)cmap4->numGlyphId &&
cmap4->glyphIdArray[index1] != 0 )

View File

@ -1037,7 +1037,7 @@
for (;;)
{
int len = limit - base;
int len = (int)( limit - base );
PCell i, j, pivot;

View File

@ -494,7 +494,8 @@
/* composite instructions, if we find some. */
/* we will process them later... */
/* */
loader->ins_pos = FILE_Pos() + stream->cursor - stream->limit;
loader->ins_pos = (FT_ULong)( FILE_Pos() +
stream->cursor - stream->limit );
}
#endif

View File

@ -74,7 +74,7 @@
while ( IS_ALPHANUM( *p ) && p < limit )
p++;
len = p - *start;
len = (FT_Int)( p - *start );
if ( len > 0 && len < 64 )
{

View File

@ -55,7 +55,7 @@
if ( buffer_max > 0 )
{
FT_UInt len = strlen( gname );
FT_UInt len = (FT_UInt)( strlen( gname ) );
if (len >= buffer_max)

View File

@ -420,7 +420,7 @@
if (token->start[0] == '/')
token->start++;
len = token->limit - token->start;
len = (FT_Int)( token->limit - token->start );
if ( len <= 0 )
{
error = T1_Err_Invalid_File_Format;
@ -838,7 +838,7 @@
while ( cur2 < limit && is_alpha( *cur2 ) )
cur2++;
len = cur2 - cur;
len = (FT_Int)( cur2 - cur );
if ( len > 0 )
{
if ( ALLOC( face->type1.font_name, len + 1 ) )
@ -1039,7 +1039,7 @@
while ( cur2 < limit && is_alpha( *cur2 ) )
cur2++;
len = cur2 - cur - 1;
len = (FT_Int)( cur2 - cur - 1 );
parser->root.error = T1_Add_Table( char_table, charcode,
cur + 1, len + 1 );
@ -1244,7 +1244,7 @@
while ( cur2 < limit && is_alpha( *cur2 ) )
cur2++;
len = cur2 - cur - 1;
len = (FT_Int)( cur2 - cur - 1 );
error = T1_Add_Table( name_table, n, cur + 1, len + 1 );
if ( error )
@ -1467,7 +1467,7 @@
while ( cur2 < limit && is_alpha( *cur2 ) )
cur2++;
len = cur2 - cur;
len = (FT_Int)( cur2 - cur );
if ( len > 0 && len < 22 )
{
{

View File

@ -377,7 +377,7 @@
/* dictionary. We overwrite the base dictionary for disk-based */
/* resources and allocate a new block otherwise */
size = parser->base_len - ( cur - parser->base_dict);
size = (FT_Long)( parser->base_len - ( cur - parser->base_dict ) );
if ( parser->in_memory )
{
@ -440,7 +440,7 @@
}
/* put a safeguard */
parser->private_len = write - parser->private_dict;
parser->private_len = (FT_Int)( write - parser->private_dict );
*write++ = 0;
}
}

View File

@ -242,7 +242,8 @@
if ( type_id == 0x8008 )
{
font_count = count;
font_offset = FILE_Pos() + 4 + ( stream->cursor - stream->limit );
font_offset = (FT_ULong)( FILE_Pos() + 4 +
( stream->cursor - stream->limit ) );
break;
}