* include/freetype/internal/ftdriver.h,

include/freetype/internal/ftobjs.h,
include/freetype/internal/psaux.h, src/cid/cidgload.c,
src/psaux/psobjs.c, src/psaux/t1decode.c, src/psaux/psobjs.h,
src/pshinter/pshrec.c, src/pshinter/pshalgo.c,
src/psnames/psmodule.c, src/raster/ftraster.c, src/sfnt/sfobjs.c,
src/smooth/ftgrays.c, src/smooth/ftsmooth.c, src/truetype/ttobjs.c,
src/truetype/ttdriver.c, src/truetype/ttgload.c, src/type1/t1afm.c,
src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1load.c,
src/type1/t1objs.c, src/type42/t42parse.c, src/type42/t42parse.h:
Many casts and slight argument type changes to make it work with
a 16bit compiler.
This commit is contained in:
Werner Lemberg 2003-06-05 04:31:05 +00:00
parent 3229b88005
commit 7386197677
26 changed files with 114 additions and 89 deletions

View File

@ -1,3 +1,25 @@
2003-06-04 Wolfgang Domröse <porthos.domroese@harz.de>
* include/freetype/internal/ftdriver.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/psaux.h, src/cid/cidgload.c,
src/psaux/psobjs.c, src/psaux/t1decode.c, src/psaux/psobjs.h,
src/pshinter/pshrec.c, src/pshinter/pshalgo.c,
src/psnames/psmodule.c, src/raster/ftraster.c, src/sfnt/sfobjs.c,
src/smooth/ftgrays.c, src/smooth/ftsmooth.c, src/truetype/ttobjs.c,
src/truetype/ttdriver.c, src/truetype/ttgload.c, src/type1/t1afm.c,
src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1load.c,
src/type1/t1objs.c, src/type42/t42parse.c, src/type42/t42parse.h:
Many casts and slight argument type changes to make it work with
a 16bit compiler.
2003-06-04 Werner Lemberg <wl@gnu.org>
* include/freetype/config/ftoption.h: Defining
TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING by default is a bad idea
since some fonts (e.g. Arial) produce worse results than without
hinting. Reverted.
2003-06-04 Werner Lemberg <wl@gnu.org>
* src/truetype/ttgload.c (load_truetype_glyph)

View File

@ -4,7 +4,7 @@
/* */
/* FreeType Image cache (specification). */
/* */
/* Copyright 2000-2001, 2002 by */
/* Copyright 2000-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -208,12 +208,12 @@ FT_BEGIN_HEADER
/* FTC_Image_Desc */
/* */
/* <Description> */
/* THIS TYPE IS DEPRECATED. Use @FTC_ImageDesc instead. */
/* THIS TYPE IS DEPRECATED. Use @FTC_ImageDescRec instead. */
/* */
/* A simple structure used to describe a given glyph image category. */
/* */
/* <Fields> */
/* size :: An @FTC_SizeRec used to describe the glyph's face */
/* font :: An @FTC_FontRec used to describe the glyph's face */
/* and size. */
/* */
/* image_type :: The glyph image's type. */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType font driver interface (specification). */
/* */
/* Copyright 1996-2001, 2002 by */
/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -169,9 +169,9 @@ FT_BEGIN_HEADER
{
FT_Module_Class root;
FT_Int face_object_size;
FT_Int size_object_size;
FT_Int slot_object_size;
FT_Long face_object_size;
FT_Long size_object_size;
FT_Long slot_object_size;
FT_Face_InitFunc init_face;
FT_Face_DoneFunc done_face;

View File

@ -239,7 +239,7 @@ FT_BEGIN_HEADER
typedef struct FT_CMap_ClassRec_
{
FT_UInt size;
FT_ULong size;
FT_CMap_InitFunc init;
FT_CMap_DoneFunc done;
FT_CMap_CharIndexFunc char_index;

View File

@ -70,10 +70,10 @@ FT_BEGIN_HEADER
(*done)( PS_Table table );
FT_Error
(*add)( PS_Table table,
FT_Int index,
void* object,
FT_Int length );
(*add)( PS_Table table,
FT_Int index,
void* object,
FT_PtrDist length );
void
(*release)( PS_Table table );

View File

@ -48,7 +48,7 @@
FT_Error error = 0;
FT_Byte* charstring = 0;
FT_Memory memory = face->root.memory;
FT_UInt glyph_length = 0;
FT_ULong glyph_length = 0;
#ifdef FT_CONFIG_OPTION_INCREMENTAL
@ -107,8 +107,7 @@
fd_select = (FT_UInt) cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
off1 = (FT_ULong)cid_get_offset( &p, (FT_Byte)cid->gd_bytes );
p += cid->fd_bytes;
glyph_length = (FT_UInt) cid_get_offset(
&p, (FT_Byte)cid->gd_bytes ) - off1;
glyph_length = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ) - off1;
FT_FRAME_EXIT();
if ( glyph_length == 0 )
@ -148,9 +147,9 @@
if ( decoder->lenIV >= 0 )
cid_decrypt( charstring, glyph_length, 4330 );
error = decoder->funcs.parse_charstrings( decoder,
charstring + cs_offset,
glyph_length - cs_offset );
error = decoder->funcs.parse_charstrings(
decoder, charstring + cs_offset,
(FT_Int)glyph_length - cs_offset );
}
FT_FREE( charstring );

View File

@ -153,10 +153,10 @@
/* reallocation fails. */
/* */
FT_LOCAL_DEF( FT_Error )
ps_table_add( PS_Table table,
FT_Int idx,
void* object,
FT_Int length )
ps_table_add( PS_Table table,
FT_Int idx,
void* object,
FT_PtrDist length )
{
if ( idx < 0 || idx > table->max_elems )
{

View File

@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (specification). */
/* */
/* Copyright 1996-2001, 2002 by */
/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -52,10 +52,10 @@ FT_BEGIN_HEADER
FT_Memory memory );
FT_LOCAL( FT_Error )
ps_table_add( PS_Table table,
FT_Int idx,
void* object,
FT_Int length );
ps_table_add( PS_Table table,
FT_Int idx,
void* object,
FT_PtrDist length );
FT_LOCAL( void )
ps_table_done( PS_Table table );

View File

@ -241,8 +241,8 @@
/* subglyph 1 = accent character */
subg->index = achar_index;
subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES;
subg->arg1 = adx - asb;
subg->arg2 = ady;
subg->arg1 = (FT_Int)( adx - asb );
subg->arg2 = (FT_Int)ady;
/* set up remaining glyph fields */
glyph->num_subglyphs = 2;
@ -565,7 +565,7 @@
goto Stack_Underflow;
top -= 2;
switch ( top[1] )
switch ( (FT_Int)top[1] )
{
case 1: /* start flex feature */
if ( top[0] != 0 )
@ -706,7 +706,7 @@
values = top;
for ( nn = 0; nn < num_points; nn++ )
{
FT_Int tmp = values[0];
FT_Long tmp = values[0];
for ( mm = 1; mm < blend->num_designs; mm++ )
@ -785,8 +785,8 @@
case op_seac:
/* return immediately after the processing */
return t1operator_seac( decoder, top[0], top[1],
top[2], top[3], top[4] );
return t1operator_seac( decoder, top[0], top[1], top[2],
(FT_Int)top[3], (FT_Int)top[4] );
case op_sbw:
FT_TRACE4(( " sbw" ));
@ -945,7 +945,7 @@
FT_TRACE4(( " callsubr" ));
idx = top[0];
idx = (FT_Int)top[0];
if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
{
FT_ERROR(( "t1_decoder_parse_charstrings: "

View File

@ -1168,8 +1168,8 @@
for ( n = 0; n < glyph->num_points; n++, point++ )
{
FT_Int n_prev = point->prev - points;
FT_Int n_next = point->next - points;
FT_Int n_prev = (FT_Int)( point->prev - points );
FT_Int n_next = (FT_Int)( point->next - points );
FT_Pos dxi, dyi, dxo, dyo;
@ -1448,7 +1448,8 @@
for ( ; num_hints > 0; num_hints--, sort++ )
{
PSH_Hint hint = sort[0];
FT_Pos d, flag;
FT_Pos d;
FT_Int flag;
if ( point->flags2 & min_flag )

View File

@ -861,8 +861,9 @@
FT_Memory memory = hints->memory;
error = ps_dimension_add_t1stem( dim, stems[0], stems[1],
memory, NULL );
error = ps_dimension_add_t1stem(
dim, (FT_Int)stems[0], (FT_Int)stems[1],
memory, NULL );
if ( error )
{
FT_ERROR(( "ps_hints_stem: could not add stem"
@ -917,8 +918,9 @@
/* add the three stems to our hints/masks table */
for ( count = 0; count < 3; count++, stems += 2 )
{
error = ps_dimension_add_t1stem( dim, stems[0], stems[1],
memory, &idx[count] );
error = ps_dimension_add_t1stem(
dim, (FT_Int)stems[0], (FT_Int)stems[1],
memory, &idx[count] );
if ( error )
goto Fail;
}
@ -1164,7 +1166,8 @@
FT_Int count,
FT_Fixed* coords )
{
FT_Pos stems[32], y, n, total = count;
FT_Pos stems[32], y, n;
FT_Int total = count;
y = 0;

View File

@ -4,7 +4,7 @@
/* */
/* PSNames module implementation (body). */
/* */
/* Copyright 1996-2001, 2002 by */
/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -172,7 +172,7 @@
if ( uni_char != 0 && uni_char != 0xFFFF )
{
map->unicode = uni_char;
map->unicode = (FT_UInt)uni_char;
map->glyph_index = n;
map++;
}

View File

@ -917,7 +917,7 @@
/* Take care: miny-y1 can be a very large value; we use */
/* a slow MulDiv function to avoid clipping bugs */
x1 += SMulDiv( Dx, miny - y1, Dy );
e1 = TRUNC( miny );
e1 = (Int)TRUNC( miny );
f1 = 0;
}
else

View File

@ -633,7 +633,7 @@
root->face_flags |= FT_FACE_FLAG_VERTICAL;
}
#endif
root->num_fixed_sizes = face->num_sbit_strikes;
root->num_fixed_sizes = (FT_Int)face->num_sbit_strikes;
if ( FT_NEW_ARRAY( root->available_sizes, face->num_sbit_strikes ) )
goto Exit;

View File

@ -340,7 +340,7 @@
long byte_size )
{
ras.cells = (PCell)buffer;
ras.max_cells = byte_size / sizeof ( TCell );
ras.max_cells = (int)( byte_size / sizeof ( TCell ) );
ras.num_cells = 0;
ras.area = 0;
ras.cover = 0;
@ -567,16 +567,16 @@
if ( ex1 != ex2 )
{
p = ONE_PIXEL * ( y2 - y1 + delta );
lift = (TCoord)( p / dx );
rem = (TCoord)( p % dx );
p = ONE_PIXEL * ( y2 - y1 + delta );
lift = (TCoord)( p / dx );
rem = (TCoord)( p % dx );
if ( rem < 0 )
{
lift--;
rem += (TCoord)dx;
}
mod -= dx;
mod -= (int)dx;
while ( ex1 != ex2 )
{

View File

@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (body). */
/* */
/* Copyright 2000-2001, 2002 by */
/* Copyright 2000-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -137,8 +137,8 @@
cbox.xMax = ( cbox.xMax + 63 ) & -64;
cbox.yMax = ( cbox.yMax + 63 ) & -64;
width = ( cbox.xMax - cbox.xMin ) >> 6;
height = ( cbox.yMax - cbox.yMin ) >> 6;
width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
bitmap = &slot->bitmap;
memory = render->root.memory;

View File

@ -115,7 +115,7 @@
while ( left <= right )
{
FT_Int middle = left + ( ( right - left ) >> 1 );
FT_Long middle = left + ( ( right - left ) >> 1 );
FT_ULong cur_pair;

View File

@ -886,7 +886,7 @@
count = 0;
if ( glyph_index < (FT_UInt)face->num_locations - 1 )
count = face->glyph_locations[glyph_index + 1] - offset;
count = (FT_UInt)( face->glyph_locations[glyph_index + 1] - offset );
}
if ( count == 0 )
@ -1184,16 +1184,16 @@
/* */
/* This algorithm is a guess and works much better than the above. */
/* */
int mac_xscale = FT_SqrtFixed(
FT_MulFix( subglyph->transform.xx,
subglyph->transform.xx ) +
FT_MulFix( subglyph->transform.xy,
subglyph->transform.xy) );
int mac_yscale = FT_SqrtFixed(
FT_MulFix( subglyph->transform.yy,
subglyph->transform.yy ) +
FT_MulFix( subglyph->transform.yx,
subglyph->transform.yx ) );
FT_Fixed mac_xscale = FT_SqrtFixed(
FT_MulFix( subglyph->transform.xx,
subglyph->transform.xx ) +
FT_MulFix( subglyph->transform.xy,
subglyph->transform.xy) );
FT_Fixed mac_yscale = FT_SqrtFixed(
FT_MulFix( subglyph->transform.yy,
subglyph->transform.yy ) +
FT_MulFix( subglyph->transform.yx,
subglyph->transform.yx ) );
x = FT_MulFix( x, mac_xscale );
@ -1647,9 +1647,9 @@
error = sfnt->load_sbit_image( face,
size->strike_index,
glyph_index,
load_flags,
(FT_ULong)size->strike_index,
(FT_UInt)glyph_index,
(FT_Int)load_flags,
stream,
&glyph->bitmap,
&metrics );

View File

@ -760,7 +760,7 @@
strike->hori.max_width +
strike->hori.min_advance_SB ) << 6;
size->strike_index = strike_index;
size->strike_index = (FT_UInt)strike_index;
}
else
{

View File

@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (body). */
/* */
/* Copyright 1996-2001, 2002 by */
/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -148,7 +148,7 @@
FT_ULong index2 = KERN_INDEX( pair2->glyph1, pair2->glyph2 );
return ( index1 - index2 );
return (int)( index1 - index2 );
}

View File

@ -143,7 +143,7 @@
FT_LOCAL_DEF( FT_Error )
T1_Compute_Max_Advance( T1_Face face,
FT_Int* max_advance )
FT_Pos* max_advance )
{
FT_Error error;
T1_DecoderRec decoder;
@ -185,7 +185,7 @@
if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance )
*max_advance = decoder.builder.advance.x;
/* ignore the error if one occured - skip to next glyph */
/* ignore the error if one occurred - skip to next glyph */
}
return T1_Err_Ok;

View File

@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph Loader (specification). */
/* */
/* Copyright 1996-2001, 2002 by */
/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -29,7 +29,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
T1_Compute_Max_Advance( T1_Face face,
FT_Int* max_advance );
FT_Pos* max_advance );
FT_LOCAL( FT_Error )
T1_Load_Glyph( T1_GlyphSlot glyph,

View File

@ -1213,12 +1213,12 @@
FT_MEM_COPY( temp, base, size );
psaux->t1_decrypt( temp, size, 4330 );
size -= face->type1.private_dict.lenIV;
error = T1_Add_Table( table, idx,
error = T1_Add_Table( table, (FT_Int)idx,
temp + face->type1.private_dict.lenIV, size );
FT_FREE( temp );
}
else
error = T1_Add_Table( table, idx, base, size );
error = T1_Add_Table( table, (FT_Int)idx, base, size );
if ( error )
goto Fail;
}

View File

@ -424,7 +424,7 @@
root->max_advance_width =
(FT_Short)( root->bbox.xMax );
{
FT_Int max_advance;
FT_Pos max_advance;
error = T1_Compute_Max_Advance( face, &max_advance );

View File

@ -383,7 +383,7 @@
/* 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;
@ -451,7 +451,7 @@
parser->root.cursor = cur;
charcode = T1_ToInt( parser );
charcode = (FT_Int)T1_ToInt( parser );
cur = parser->root.cursor;
/* skip whitespace */
@ -715,7 +715,7 @@
FT_Int n;
loader->num_glyphs = T1_ToInt( parser );
loader->num_glyphs = (FT_Int)T1_ToInt( parser );
if ( parser->root.error )
return;
@ -864,11 +864,11 @@
FT_Byte* base,
FT_Long size )
{
T42_Parser parser = &loader->parser;
FT_Byte* cur = base;
FT_Byte* limit = cur + size;
FT_UInt n_keywords = sizeof ( t42_keywords ) /
sizeof ( t42_keywords[0] );
T42_Parser parser = &loader->parser;
FT_Byte* cur = base;
FT_Byte* limit = cur + size;
FT_UInt n_keywords = (FT_UInt)( sizeof ( t42_keywords ) /
sizeof ( t42_keywords[0] ) );
parser->root.cursor = base;

View File

@ -4,7 +4,7 @@
/* */
/* Type 42 font parser (specification). */
/* */
/* Copyright 2002 by Roberto Alameda. */
/* Copyright 2002, 2003 by Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@ -31,7 +31,7 @@ FT_BEGIN_HEADER
FT_Stream stream;
FT_Byte* base_dict;
FT_Int base_len;
FT_Long base_len;
FT_Byte in_memory;