various clean-ups:

- using FT_UNUSED instead of UNUSED
- using FT_LONG64 and FT_INT64 instead of LONG64 & INT64
- using FT_SIZEOF_INT & FT_SIZEOF_LONG instead of...

- removed the #ifdefs that used SIZEOF_INT, instead we now
  use FT_Int32 and FT_UInt32 when needed to support
  32-bits quantity correctly on 64-bits systems..
This commit is contained in:
David Turner 2000-07-04 18:12:13 +00:00
parent aa8c7da0bf
commit c6a92202c2
29 changed files with 181 additions and 195 deletions

View File

@ -59,10 +59,10 @@
#undef STDC_HEADERS #undef STDC_HEADERS
/* the number of bytes in an `int' type. */ /* the number of bytes in an `int' type. */
#define SIZEOF_INT 4 #define FT_SIZEOF_INT 4
/* the number of bytes in a `long' type. */ /* the number of bytes in a `long' type. */
#define SIZEOF_LONG 4 #define FT_SIZEOF_LONG 4
/* Define if you have the memcpy function. */ /* Define if you have the memcpy function. */
#undef HAVE_MEMCPY #undef HAVE_MEMCPY
@ -99,12 +99,12 @@
typedef signed short FT_Int16; typedef signed short FT_Int16;
typedef unsigned short FT_Word16; typedef unsigned short FT_Word16;
#if SIZEOF_INT == 4 #if FT_SIZEOF_INT == 4
typedef signed int FT_Int32; typedef signed int FT_Int32;
typedef unsigned int FT_Word32; typedef unsigned int FT_Word32;
#elif SIZEOF_LONG == 4 #elif FT_SIZEOF_LONG == 4
typedef signed long FT_Int32; typedef signed long FT_Int32;
typedef unsigned long FT_Word32; typedef unsigned long FT_Word32;
@ -113,11 +113,11 @@
#error "no 32bit type found - please check your configuration files" #error "no 32bit type found - please check your configuration files"
#endif #endif
#if SIZEOF_LONG == 8 #if FT_SIZEOF_LONG == 8
/* LONG64 must be defined when a 64-bit type is available */ /* LONG64 must be defined when a 64-bit type is available */
#define LONG64 #define FT_LONG64
#define INT64 long #define FT_INT64 long
#else #else
@ -132,8 +132,8 @@
/* */ /* */
#ifdef FTCALC_USE_LONG_LONG #ifdef FTCALC_USE_LONG_LONG
#define LONG64 #define FT_LONG64
#define INT64 long long #define FT_INT64 long long
#endif /* FTCALC_USE_LONG_LONG */ #endif /* FTCALC_USE_LONG_LONG */
#endif #endif

View File

@ -63,20 +63,20 @@
/* The number of bytes in an `int' type. */ /* The number of bytes in an `int' type. */
#if UINT_MAX == 0xFFFFFFFF #if UINT_MAX == 0xFFFFFFFF
#define SIZEOF_INT 4 #define FT_SIZEOF_INT 4
#elif UINT_MAX == 0xFFFF #elif UINT_MAX == 0xFFFF
#define SIZEOF_INT 2 #define FT_SIZEOF_INT 2
#elif UINT_MAX > 0xFFFFFFFF && UINT_MAX == 0xFFFFFFFFFFFFFFFF #elif UINT_MAX > 0xFFFFFFFF && UINT_MAX == 0xFFFFFFFFFFFFFFFF
#define SIZEOF_INT 8 #define FT_SIZEOF_INT 8
#else #else
#error "Unsupported number of bytes in `int' type!" #error "Unsupported number of bytes in `int' type!"
#endif #endif
/* The number of bytes in a `long' type. */ /* The number of bytes in a `long' type. */
#if ULONG_MAX == 0xFFFFFFFF #if ULONG_MAX == 0xFFFFFFFF
#define SIZEOF_LONG 4 #define FT_SIZEOF_LONG 4
#elif ULONG_MAX > 0xFFFFFFFF && ULONG_MAX == 0xFFFFFFFFFFFFFFFF #elif ULONG_MAX > 0xFFFFFFFF && ULONG_MAX == 0xFFFFFFFFFFFFFFFF
#define SIZEOF_LONG 8 #define FT_SIZEOF_LONG 8
#else #else
#error "Unsupported number of bytes in `long' type!" #error "Unsupported number of bytes in `long' type!"
#endif #endif
@ -97,8 +97,8 @@
/* UNUSED is a macro used to indicate that a given parameter is not used */ /* UNUSED is a macro used to indicate that a given parameter is not used */
/* this is only used to get rid of unpleasant compiler warnings.. */ /* this is only used to get rid of unpleasant compiler warnings.. */
#ifndef UNUSED #ifndef FT_UNUSED
#define UNUSED( arg ) ( (arg)=(arg) ) #define FT_UNUSED( arg ) ( (arg)=(arg) )
#endif #endif
@ -123,12 +123,12 @@
typedef signed short FT_Int16; typedef signed short FT_Int16;
typedef unsigned short FT_Word16; typedef unsigned short FT_Word16;
#if SIZEOF_INT == 4 #if FT_SIZEOF_INT == 4
typedef signed int FT_Int32; typedef signed int FT_Int32;
typedef unsigned int FT_Word32; typedef unsigned int FT_Word32;
#elif SIZEOF_LONG == 4 #elif FT_SIZEOF_LONG == 4
typedef signed long FT_Int32; typedef signed long FT_Int32;
typedef unsigned long FT_Word32; typedef unsigned long FT_Word32;
@ -137,11 +137,11 @@
#error "no 32bit type found - please check your configuration files" #error "no 32bit type found - please check your configuration files"
#endif #endif
#if SIZEOF_LONG == 8 #if FT_SIZEOF_LONG == 8
/* LONG64 must be defined when a 64-bit type is available */ /* FT_LONG64 must be defined when a 64-bit type is available */
#define LONG64 #define FT_LONG64
#define INT64 long #define FT_INT64 long
#else #else
@ -156,8 +156,8 @@
/* */ /* */
#ifdef FTCALC_USE_LONG_LONG #ifdef FTCALC_USE_LONG_LONG
#define LONG64 #define FT_LONG64
#define INT64 long long #define FT_INT64 long long
#endif /* FTCALC_USE_LONG_LONG */ #endif /* FTCALC_USE_LONG_LONG */
#endif #endif

View File

@ -47,7 +47,8 @@ typedef enum FT_Frame_Op_
ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ), ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ), ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ) ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
} FT_Frame_Op; } FT_Frame_Op;
@ -96,6 +97,8 @@ typedef struct FT_Frame_Field_
count, \ count, \
(FT_UShort)(char*)&FT_FIELD_REF(struct_type,field) } (FT_UShort)(char*)&FT_FIELD_REF(struct_type,field) }
#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
/*************************************************************************/ /*************************************************************************/

View File

@ -111,7 +111,7 @@
#endif /* FT_CONFIG_OPTION_OLD_CALCS */ #endif /* FT_CONFIG_OPTION_OLD_CALCS */
#ifdef LONG64 #ifdef FT_LONG64
/*************************************************************************/ /*************************************************************************/
/* */ /* */
@ -252,7 +252,7 @@
while ( z ) while ( z )
{ {
z = (unsigned INT64)z >> 1; z = (unsigned FT_INT64)z >> 1;
j++; j++;
} }
return j - 1; return j - 1;
@ -298,7 +298,7 @@
#endif /* FT_CONFIG_OPTION_OLD_CALCS */ #endif /* FT_CONFIG_OPTION_OLD_CALCS */
#else /* LONG64 */ #else /* FT_LONG64 */
/*************************************************************************/ /*************************************************************************/
@ -767,7 +767,7 @@
#endif /* FT_CONFIG_OPTION_OLD_CALCS */ #endif /* FT_CONFIG_OPTION_OLD_CALCS */
#endif /* LONG64 */ #endif /* FT_LONG64 */
/* END */ /* END */

View File

@ -1084,7 +1084,7 @@
FT_Pos distance; FT_Pos distance;
int c, n, first, orientation; int c, n, first, orientation;
UNUSED( advance ); FT_UNUSED( advance );
/* compute control distance */ /* compute control distance */

View File

@ -540,20 +540,28 @@
continue; /* loop! */ continue; /* loop! */
case ft_frame_bytes: /* read a byte sequence */ case ft_frame_bytes: /* read a byte sequence */
case ft_frame_skip: /* skip some bytes */
{ {
FT_Int len = stream->limit - stream->cursor; FT_Int len = fields->size;
if (stream->cursor + len > stream->limit)
if ( len > fields->size ) {
len = fields->size; error = FT_Err_Invalid_Stream_Operation;
goto Exit;
p = (FT_Byte*)structure + fields->offset; }
MEM_Copy( p, stream->cursor, len );
stream->cursor += len; if (fields->value == ft_frame_bytes)
{
p = (FT_Byte*)structure + fields->offset;
MEM_Copy( p, stream->cursor, len );
}
stream->cursor += len;
fields++; fields++;
continue; continue;
} }
case ft_frame_byte: case ft_frame_byte:
case ft_frame_schar: /* read a single byte */ case ft_frame_schar: /* read a single byte */
value = GET_Byte(); value = GET_Byte();
@ -644,7 +652,7 @@
/* now, compute the signed value is necessary */ /* now, compute the signed value is necessary */
if ( fields->value & FT_FRAME_OP_SIGNED ) if ( fields->value & FT_FRAME_OP_SIGNED )
value = (FT_ULong)( (FT_Long)( value << sign_shift ) >> sign_shift ); value = (FT_ULong)( (FT_Int32)( value << sign_shift ) >> sign_shift );
/* finally, store the value in the object */ /* finally, store the value in the object */
@ -659,23 +667,11 @@
*(FT_UShort*)p = (FT_UShort)value; *(FT_UShort*)p = (FT_UShort)value;
break; break;
/* SIZEOF_INT is defined in <freetype/config/ftconfig.h> */
/* and gives the size in bytes of the `int' type on the */
/* current platform. */
/* */
/* Only on 16-bit systems the value of SIZEOF_INT can be */
/* less than 4. In this case SIZEOF_LONG is always 4. */
/* */
/* On a 64-bit system, SIZEOF_LONG can be 8, which is */
/* handled by the default case. */
/* */
#if SIZEOF_INT == 4
case 4: case 4:
*(FT_UInt*)p = (FT_UInt)value; *(FT_UInt32*)p = (FT_UInt32)value;
break; break;
#endif
default: default: /* for 64-bits systems */
*(FT_ULong*)p = (FT_ULong)value; *(FT_ULong*)p = (FT_ULong)value;
} }

View File

@ -70,7 +70,7 @@
void* ft_alloc( FT_Memory memory, void* ft_alloc( FT_Memory memory,
long size ) long size )
{ {
UNUSED( memory ); FT_UNUSED( memory );
return malloc( size ); return malloc( size );
} }
@ -102,8 +102,8 @@
long new_size, long new_size,
void* block ) void* block )
{ {
UNUSED( memory ); FT_UNUSED( memory );
UNUSED( cur_size ); FT_UNUSED( cur_size );
return realloc( block, new_size ); return realloc( block, new_size );
} }
@ -126,7 +126,7 @@
void ft_free( FT_Memory memory, void ft_free( FT_Memory memory,
void* block ) void* block )
{ {
UNUSED( memory ); FT_UNUSED( memory );
free( block ); free( block );
} }

View File

@ -627,10 +627,10 @@
{ {
if ( ip + 3 >= limit ) if ( ip + 3 >= limit )
goto Syntax_Error; goto Syntax_Error;
val = ( (FT_Long)ip[0] << 24 ) | val = ( (FT_Int32)ip[0] << 24 ) |
( (FT_Long)ip[1] << 16 ) | ( (FT_Int32)ip[1] << 16 ) |
( (FT_Long)ip[2] << 8 ) | ( (FT_Int32)ip[2] << 8 ) |
ip[3]; ip[3];
ip += 4; ip += 4;
shift = 0; shift = 0;
} }

View File

@ -203,7 +203,7 @@
#else #else
UNUSED( driver ); FT_UNUSED( driver );
return T2_Err_Ok; return T2_Err_Ok;
@ -233,7 +233,7 @@
#else #else
UNUSED( driver ); FT_UNUSED( driver );
#endif #endif
} }

View File

@ -519,16 +519,6 @@
case t2_kind_fixed: case t2_kind_fixed:
val = t2_parse_fixed( parser->stack ); val = t2_parse_fixed( parser->stack );
/* SIZEOF_INT is defined in <freetype/config/ftconfig.h> */
/* and gives the size in bytes of the `int' type on the */
/* current platform. */
/* */
/* Only on 16-bit systems the value of SIZEOF_INT can be */
/* less than 4. In this case SIZEOF_LONG is always 4. */
/* */
/* On a 64-bit system, SIZEOF_LONG can be 8, which is */
/* handled by the default case. */
/* */
Store_Number: Store_Number:
switch ( field->size ) switch ( field->size )
{ {
@ -540,13 +530,11 @@
*(FT_Short*)q = (FT_Short)val; *(FT_Short*)q = (FT_Short)val;
break; break;
#if SIZEOF_INT == 4
case 4: case 4:
*(FT_Int*)q = (FT_Int)val; *(FT_Int32*)q = (FT_Int)val;
break; break;
#endif
default: default: /* for 64-bit systems where long is 8 bytes */
*(FT_Long*)q = val; *(FT_Long*)q = val;
} }
break; break;
@ -578,12 +566,12 @@
case 2: case 2:
*(FT_Short*)q = (FT_Short)val; *(FT_Short*)q = (FT_Short)val;
break; break;
#if SIZEOF_INT == 4
case 4: case 4:
*(FT_Int*)q = (FT_Int)val; *(FT_Int32*)q = (FT_Int)val;
break; break;
#endif
default: default: /* for 64-bit systems */
*(FT_Long*)q = val; *(FT_Long*)q = val;
} }

View File

@ -466,7 +466,7 @@
void t1_init_loader( CID_Loader* loader, void t1_init_loader( CID_Loader* loader,
CID_Face face ) CID_Face face )
{ {
UNUSED( face ); FT_UNUSED( face );
MEM_Set( loader, 0, sizeof ( *loader ) ); MEM_Set( loader, 0, sizeof ( *loader ) );
} }

View File

@ -121,10 +121,10 @@
FT_Error error; FT_Error error;
PSNames_Interface* psnames; PSNames_Interface* psnames;
UNUSED( num_params ); FT_UNUSED( num_params );
UNUSED( params ); FT_UNUSED( params );
UNUSED( face_index ); FT_UNUSED( face_index );
UNUSED( stream ); FT_UNUSED( stream );
face->root.num_faces = 1; face->root.num_faces = 1;
@ -341,7 +341,7 @@
LOCAL_FUNC LOCAL_FUNC
FT_Error CID_Init_Driver( CID_Driver driver ) FT_Error CID_Init_Driver( CID_Driver driver )
{ {
UNUSED( driver ); FT_UNUSED( driver );
return T1_Err_Ok; return T1_Err_Ok;
} }
@ -361,7 +361,7 @@
LOCAL_DEF LOCAL_DEF
void CID_Done_Driver( CID_Driver driver ) void CID_Done_Driver( CID_Driver driver )
{ {
UNUSED( driver ); FT_UNUSED( driver );
} }

View File

@ -761,13 +761,11 @@
*(FT_UShort*)q = (FT_UShort)val; *(FT_UShort*)q = (FT_UShort)val;
break; break;
#if SIZEOF_INT == 4
case 4: case 4:
*(FT_Int*)q = (FT_Int)val; *(FT_Int32*)q = (FT_Int)val;
break; break;
#endif
default: default: /* for 64-bit systems */
*(FT_Long*)q = val; *(FT_Long*)q = val;
} }
break; break;

View File

@ -40,8 +40,8 @@
FT_Module_Interface CID_Get_Interface( FT_Driver driver, FT_Module_Interface CID_Get_Interface( FT_Driver driver,
const FT_String* interface ) const FT_String* interface )
{ {
UNUSED( driver ); FT_UNUSED( driver );
UNUSED( interface ); FT_UNUSED( interface );
return 0; return 0;
} }

View File

@ -146,7 +146,7 @@
/* Its purpose is simply to reduce compiler warnings. Note also that */ /* Its purpose is simply to reduce compiler warnings. Note also that */
/* simply defining it as `(void)x' doesn't avoid warnings with certain */ /* simply defining it as `(void)x' doesn't avoid warnings with certain */
/* ANSI compilers (e.g. LCC). */ /* ANSI compilers (e.g. LCC). */
#define UNUSED( x ) (x) = (x) #define FT_UNUSED( x ) (x) = (x)
/* Disable the tracing mechanism for simplicity -- developers can */ /* Disable the tracing mechanism for simplicity -- developers can */
/* activate it easily by redefining these two macros. */ /* activate it easily by redefining these two macros. */
@ -311,7 +311,7 @@
#define RAS_VARS /* void */ #define RAS_VARS /* void */
#define RAS_VAR /* void */ #define RAS_VAR /* void */
#define UNUSED_RASTER do ; while ( 0 ) #define FT_UNUSED_RASTER do ; while ( 0 )
#else /* TT_STATIC_RASTER */ #else /* TT_STATIC_RASTER */
@ -323,7 +323,7 @@
#define RAS_VARS raster, #define RAS_VARS raster,
#define RAS_VAR raster #define RAS_VAR raster
#define UNUSED_RASTER UNUSED( raster ) #define FT_UNUSED_RASTER FT_UNUSED( raster )
#endif /* TT_STATIC_RASTER */ #endif /* TT_STATIC_RASTER */
@ -2028,7 +2028,7 @@
{ {
Long pitch = ras.target.pitch; Long pitch = ras.target.pitch;
UNUSED( max ); FT_UNUSED( max );
ras.traceIncr = (Short)-pitch; ras.traceIncr = (Short)-pitch;
@ -2053,9 +2053,9 @@
Byte f1, f2; Byte f1, f2;
Byte* target; Byte* target;
UNUSED( y ); FT_UNUSED( y );
UNUSED( left ); FT_UNUSED( left );
UNUSED( right ); FT_UNUSED( right );
/* Drop-out control */ /* Drop-out control */
@ -2239,9 +2239,9 @@
Short* max ) Short* max )
{ {
/* nothing, really */ /* nothing, really */
UNUSED( raster ); FT_UNUSED( raster );
UNUSED( min ); FT_UNUSED( min );
UNUSED( max ); FT_UNUSED( max );
} }
@ -2256,8 +2256,8 @@
PByte bits; PByte bits;
Byte f1; Byte f1;
UNUSED( left ); FT_UNUSED( left );
UNUSED( right ); FT_UNUSED( right );
if ( x2 - x1 < ras.precision ) if ( x2 - x1 < ras.precision )
@ -2388,7 +2388,7 @@
void Horizontal_Sweep_Step( RAS_ARG ) void Horizontal_Sweep_Step( RAS_ARG )
{ {
/* Nothing, really */ /* Nothing, really */
UNUSED( raster ); FT_UNUSED( raster );
} }
@ -2535,12 +2535,12 @@
PProfile right ) PProfile right )
{ {
/* nothing, really */ /* nothing, really */
UNUSED( raster ); FT_UNUSED( raster );
UNUSED( y ); FT_UNUSED( y );
UNUSED( x1 ); FT_UNUSED( x1 );
UNUSED( x2 ); FT_UNUSED( x2 );
UNUSED( left ); FT_UNUSED( left );
UNUSED( right ); FT_UNUSED( right );
} }
@ -3097,7 +3097,7 @@
LOCAL_FUNC LOCAL_FUNC
FT_Error Render_Gray_Glyph( RAS_ARG ) FT_Error Render_Gray_Glyph( RAS_ARG )
{ {
UNUSED_RASTER; FT_UNUSED_RASTER;
return FT_Err_Cannot_Render_Glyph; return FT_Err_Cannot_Render_Glyph;
} }
@ -3235,9 +3235,9 @@
#else #else
UNUSED( raster ); FT_UNUSED( raster );
UNUSED( mode ); FT_UNUSED( mode );
UNUSED( palette ); FT_UNUSED( palette );
#endif #endif
} }

View File

@ -77,7 +77,7 @@
FT_Module_Interface SFNT_Get_Interface( FT_Module module, FT_Module_Interface SFNT_Get_Interface( FT_Module module,
const char* interface ) const char* interface )
{ {
UNUSED( module ); FT_UNUSED( module );
if ( strcmp( interface, "get_sfnt" ) == 0 ) if ( strcmp( interface, "get_sfnt" ) == 0 )
return (FT_Module_Interface)get_sfnt_table; return (FT_Module_Interface)get_sfnt_table;

View File

@ -186,8 +186,8 @@
SFNT_Header sfnt_header; SFNT_Header sfnt_header;
/* for now, parameters are unused */ /* for now, parameters are unused */
UNUSED( num_params ); FT_UNUSED( num_params );
UNUSED( params ); FT_UNUSED( params );
sfnt = (SFNT_Interface*)face->sfnt; sfnt = (SFNT_Interface*)face->sfnt;
if ( !sfnt ) if ( !sfnt )
@ -246,9 +246,9 @@
FT_Error error; FT_Error error;
SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt; SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt;
UNUSED( face_index ); FT_UNUSED( face_index );
UNUSED( num_params ); FT_UNUSED( num_params );
UNUSED( params ); FT_UNUSED( params );
/* Load tables */ /* Load tables */

View File

@ -108,7 +108,7 @@
/* Its purpose is simply to reduce compiler warnings. Note also that */ /* Its purpose is simply to reduce compiler warnings. Note also that */
/* simply defining it as `(void)x' doesn't avoid warnings with certain */ /* simply defining it as `(void)x' doesn't avoid warnings with certain */
/* ANSI compilers (e.g. LCC). */ /* ANSI compilers (e.g. LCC). */
#define UNUSED( x ) (x) = (x) #define FT_UNUSED( x ) (x) = (x)
/* Disable the tracing mechanism for simplicity -- developers can */ /* Disable the tracing mechanism for simplicity -- developers can */
/* activate it easily by redefining these two macros. */ /* activate it easily by redefining these two macros. */
@ -125,7 +125,7 @@
#include "ftgrays.h" #include "ftgrays.h"
#include <freetype/internal/ftobjs.h> /* for UNUSED() */ #include <freetype/internal/ftobjs.h> /* for FT_UNUSED() */
#include <freetype/internal/ftdebug.h> /* for FT_TRACE() and FT_ERROR() */ #include <freetype/internal/ftdebug.h> /* for FT_TRACE() and FT_ERROR() */
#include <freetype/ftoutln.h> /* for FT_Outline_Decompose() */ #include <freetype/ftoutln.h> /* for FT_Outline_Decompose() */
@ -1356,7 +1356,7 @@
TScan x, y, cover, area; TScan x, y, cover, area;
PCell start, cur, limit; PCell start, cur, limit;
UNUSED( target ); FT_UNUSED( target );
cur = ras.cells; cur = ras.cells;
@ -1879,7 +1879,7 @@
{ {
static TRaster the_raster; static TRaster the_raster;
UNUSED( memory ); FT_UNUSED( memory );
*araster = (FT_Raster)&the_raster; *araster = (FT_Raster)&the_raster;
@ -1893,7 +1893,7 @@
void grays_raster_done( FT_Raster raster ) void grays_raster_done( FT_Raster raster )
{ {
/* nothing */ /* nothing */
UNUSED( raster ); FT_UNUSED( raster );
} }
#else /* _STANDALONE_ */ #else /* _STANDALONE_ */

View File

@ -245,8 +245,8 @@
FT_UInt pixel_width, FT_UInt pixel_width,
FT_UInt pixel_height ) FT_UInt pixel_height )
{ {
UNUSED( pixel_width ); FT_UNUSED( pixel_width );
UNUSED( pixel_height ); FT_UNUSED( pixel_height );
/* many things have been pre-computed by the base layer */ /* many things have been pre-computed by the base layer */

View File

@ -813,7 +813,7 @@
{ {
TT_GlyphSlot glyph = (TT_GlyphSlot)loader->glyph; TT_GlyphSlot glyph = (TT_GlyphSlot)loader->glyph;
FT_UInt start_point, start_contour; FT_UInt start_point, start_contour;
FT_ULong ins_pos; /* position of composite instructions, if any */
/* for each subglyph, read composite header */ /* for each subglyph, read composite header */
start_point = gloader->base.outline.n_points; start_point = gloader->base.outline.n_points;
@ -823,6 +823,7 @@
if ( error ) if ( error )
goto Fail; goto Fail;
ins_pos = loader->ins_pos;
face->forget_glyph_frame( loader ); face->forget_glyph_frame( loader );
opened_frame = 0; opened_frame = 0;
@ -973,7 +974,7 @@
if ( num_subglyphs > 0 && if ( num_subglyphs > 0 &&
loader->exec && loader->exec &&
loader->ins_pos > 0 && ins_pos > 0 &&
subglyph->flags & WE_HAVE_INSTR ) subglyph->flags & WE_HAVE_INSTR )
{ {
FT_UShort n_ins; FT_UShort n_ins;
@ -984,8 +985,8 @@
/* read size of instructions */ /* read size of instructions */
if ( FILE_Seek( loader->ins_pos ) || if ( FILE_Seek( ins_pos ) ||
READ_UShort( n_ins ) ) READ_UShort( n_ins ) )
goto Fail; goto Fail;
FT_TRACE5(( " Instructions size = %d\n", n_ins )); FT_TRACE5(( " Instructions size = %d\n", n_ins ));

View File

@ -31,7 +31,7 @@
#define TT_MULFIX FT_MulFix #define TT_MULFIX FT_MulFix
#define TT_MULDIV FT_MulDiv #define TT_MULDIV FT_MulDiv
#define TT_INT64 FT_Int64 #define TT_FT_INT64 FT_Int64
/*************************************************************************/ /*************************************************************************/
@ -122,7 +122,7 @@
/* This macro is used whenever `exec' is unused in a function, to avoid */ /* This macro is used whenever `exec' is unused in a function, to avoid */
/* stupid warnings from pedantic compilers. */ /* stupid warnings from pedantic compilers. */
/* */ /* */
#define UNUSED_EXEC UNUSED( CUR ) #define FT_UNUSED_EXEC FT_UNUSED( CUR )
/*************************************************************************/ /*************************************************************************/
@ -130,7 +130,7 @@
/* This macro is used whenever `args' is unused in a function, to avoid */ /* This macro is used whenever `args' is unused in a function, to avoid */
/* stupid warnings from pedantic compilers. */ /* stupid warnings from pedantic compilers. */
/* */ /* */
#define UNUSED_ARG UNUSED_EXEC; UNUSED( args ) #define FT_UNUSED_ARG FT_UNUSED_EXEC; FT_UNUSED( args )
/*************************************************************************/ /*************************************************************************/
@ -731,7 +731,7 @@
exec->callTop = 0; exec->callTop = 0;
#if 1 #if 1
UNUSED( debug ); FT_UNUSED( debug );
return exec->face->interpreter( exec ); return exec->face->interpreter( exec );
#else #else
@ -839,7 +839,7 @@
FT_Error TT_Done_Context( TT_ExecContext exec ) FT_Error TT_Done_Context( TT_ExecContext exec )
{ {
/* Nothing at all for now */ /* Nothing at all for now */
UNUSED( exec ); FT_UNUSED( exec );
return TT_Err_Ok; return TT_Err_Ok;
} }
@ -850,7 +850,7 @@
static FT_F26Dot6 Norm( FT_F26Dot6 X, static FT_F26Dot6 Norm( FT_F26Dot6 X,
FT_F26Dot6 Y ) FT_F26Dot6 Y )
{ {
TT_INT64 T1, T2; TT_FT_INT64 T1, T2;
MUL_64( X, X, T1 ); MUL_64( X, X, T1 );
@ -1479,7 +1479,7 @@
FT_UShort point, FT_UShort point,
FT_F26Dot6 distance ) FT_F26Dot6 distance )
{ {
UNUSED_EXEC; FT_UNUSED_EXEC;
zone->cur[point].x += distance; zone->cur[point].x += distance;
zone->tags[point] |= FT_Curve_Tag_Touch_X; zone->tags[point] |= FT_Curve_Tag_Touch_X;
@ -1491,7 +1491,7 @@
FT_UShort point, FT_UShort point,
FT_F26Dot6 distance ) FT_F26Dot6 distance )
{ {
UNUSED_EXEC; FT_UNUSED_EXEC;
zone->cur[point].y += distance; zone->cur[point].y += distance;
zone->tags[point] |= FT_Curve_Tag_Touch_Y; zone->tags[point] |= FT_Curve_Tag_Touch_Y;
@ -1526,7 +1526,7 @@
{ {
FT_F26Dot6 val; FT_F26Dot6 val;
UNUSED_EXEC; FT_UNUSED_EXEC;
if ( distance >= 0 ) if ( distance >= 0 )
@ -1566,7 +1566,7 @@
{ {
FT_F26Dot6 val; FT_F26Dot6 val;
UNUSED_EXEC; FT_UNUSED_EXEC;
if ( distance >= 0 ) if ( distance >= 0 )
@ -1610,7 +1610,7 @@
{ {
FT_F26Dot6 val; FT_F26Dot6 val;
UNUSED_EXEC; FT_UNUSED_EXEC;
if ( distance >= 0 ) if ( distance >= 0 )
@ -1652,7 +1652,7 @@
{ {
FT_F26Dot6 val; FT_F26Dot6 val;
UNUSED_EXEC; FT_UNUSED_EXEC;
if ( distance >= 0 ) if ( distance >= 0 )
@ -1697,7 +1697,7 @@
FT_F26Dot6 val; FT_F26Dot6 val;
UNUSED_EXEC; FT_UNUSED_EXEC;
if ( distance >= 0 ) if ( distance >= 0 )
{ {
@ -1740,7 +1740,7 @@
{ {
FT_F26Dot6 val; FT_F26Dot6 val;
UNUSED_EXEC; FT_UNUSED_EXEC;
if ( distance >= 0 ) if ( distance >= 0 )
@ -2073,7 +2073,7 @@
FT_F26Dot6 Project_x( EXEC_OP_ FT_Vector* v1, FT_F26Dot6 Project_x( EXEC_OP_ FT_Vector* v1,
FT_Vector* v2 ) FT_Vector* v2 )
{ {
UNUSED_EXEC; FT_UNUSED_EXEC;
return ( v1->x - v2->x ); return ( v1->x - v2->x );
} }
@ -2099,7 +2099,7 @@
FT_F26Dot6 Project_y( EXEC_OP_ FT_Vector* v1, FT_F26Dot6 Project_y( EXEC_OP_ FT_Vector* v1,
FT_Vector* v2 ) FT_Vector* v2 )
{ {
UNUSED_EXEC; FT_UNUSED_EXEC;
return ( v1->y - v2->y ); return ( v1->y - v2->y );
} }
@ -2214,7 +2214,7 @@
FT_F26Dot6 W; FT_F26Dot6 W;
FT_Bool S1, S2; FT_Bool S1, S2;
UNUSED_EXEC; FT_UNUSED_EXEC;
if ( ABS( Vx ) < 0x10000L && ABS( Vy ) < 0x10000L ) if ( ABS( Vx ) < 0x10000L && ABS( Vy ) < 0x10000L )
@ -3986,7 +3986,7 @@
{ {
FT_Long A, B, C; FT_Long A, B, C;
UNUSED_EXEC; FT_UNUSED_EXEC;
A = args[2]; A = args[2];
@ -4089,7 +4089,7 @@
{ {
FT_Int nIfs; FT_Int nIfs;
UNUSED_ARG; FT_UNUSED_ARG;
nIfs = 1; nIfs = 1;
@ -4198,7 +4198,7 @@
{ {
TT_CallRec* pRec; TT_CallRec* pRec;
UNUSED_ARG; FT_UNUSED_ARG;
if ( CUR.callTop <= 0 ) /* We encountered an ENDF without a call */ if ( CUR.callTop <= 0 ) /* We encountered an ENDF without a call */
@ -5010,7 +5010,7 @@
{ {
FT_UShort point; FT_UShort point;
UNUSED_ARG; FT_UNUSED_ARG;
if ( CUR.top < CUR.GS.loop ) if ( CUR.top < CUR.GS.loop )
@ -5192,7 +5192,7 @@
dy; dy;
FT_UShort point; FT_UShort point;
UNUSED_ARG; FT_UNUSED_ARG;
if ( CUR.top < CUR.GS.loop ) if ( CUR.top < CUR.GS.loop )
@ -5757,7 +5757,7 @@
FT_UShort point; FT_UShort point;
FT_F26Dot6 distance; FT_F26Dot6 distance;
UNUSED_ARG; FT_UNUSED_ARG;
if ( CUR.top < CUR.GS.loop || if ( CUR.top < CUR.GS.loop ||
@ -5926,7 +5926,7 @@
distance; distance;
FT_UShort point; FT_UShort point;
UNUSED_ARG; FT_UNUSED_ARG;
if ( CUR.top < CUR.GS.loop ) if ( CUR.top < CUR.GS.loop )
@ -6165,7 +6165,7 @@
FT_UInt point; /* current point */ FT_UInt point; /* current point */
FT_Short contour; /* current contour */ FT_Short contour; /* current contour */
UNUSED_ARG; FT_UNUSED_ARG;
if ( CUR.opcode & 1 ) if ( CUR.opcode & 1 )
@ -6433,7 +6433,7 @@
TT_DefRecord* def = CUR.IDefs; TT_DefRecord* def = CUR.IDefs;
TT_DefRecord* limit = def + CUR.numIDefs; TT_DefRecord* limit = def + CUR.numIDefs;
UNUSED_ARG; FT_UNUSED_ARG;
for ( ; def < limit; def++ ) for ( ; def < limit; def++ )

View File

@ -128,10 +128,10 @@
FT_UInt horz_resolution, FT_UInt horz_resolution,
FT_UInt vert_resolution ) FT_UInt vert_resolution )
{ {
UNUSED( char_width ); FT_UNUSED( char_width );
UNUSED( char_height ); FT_UNUSED( char_height );
UNUSED( horz_resolution ); FT_UNUSED( horz_resolution );
UNUSED( vert_resolution ); FT_UNUSED( vert_resolution );
size->valid = FALSE; size->valid = FALSE;
@ -164,8 +164,8 @@
FT_Int pixel_width, FT_Int pixel_width,
FT_Int pixel_height ) FT_Int pixel_height )
{ {
UNUSED( pixel_width ); FT_UNUSED( pixel_width );
UNUSED( pixel_height ); FT_UNUSED( pixel_height );
size->valid = FALSE; size->valid = FALSE;

View File

@ -408,9 +408,9 @@
FT_Vector* flex = decoder->flex_vectors; FT_Vector* flex = decoder->flex_vectors;
FT_Int n; FT_Int n;
UNUSED( threshold ); FT_UNUSED( threshold );
UNUSED( end_x ); FT_UNUSED( end_x );
UNUSED( end_y ); FT_UNUSED( end_y );
/* we don't even try to test the threshold in the non-hinting */ /* we don't even try to test the threshold in the non-hinting */
@ -1080,9 +1080,9 @@
FT_Pos wx, FT_Pos wx,
FT_Pos wy ) FT_Pos wy )
{ {
UNUSED( sbx ); FT_UNUSED( sbx );
UNUSED( sby ); FT_UNUSED( sby );
UNUSED( wy ); FT_UNUSED( wy );
if ( wx > decoder->builder.advance.x ) if ( wx > decoder->builder.advance.x )
decoder->builder.advance.x = wx; decoder->builder.advance.x = wx;

View File

@ -592,7 +592,7 @@
static static
FT_Error Do_Def_Ignore( T1_Parser* parser ) FT_Error Do_Def_Ignore( T1_Parser* parser )
{ {
UNUSED( parser ); FT_UNUSED( parser );
return T1_Err_Ok; return T1_Err_Ok;
} }

View File

@ -103,7 +103,7 @@
return error; return error;
#else #else
UNUSED( error ); FT_UNUSED( error );
return T1_Err_Ok; return T1_Err_Ok;
@ -262,10 +262,10 @@
FT_Error error; FT_Error error;
PSNames_Interface* psnames; PSNames_Interface* psnames;
UNUSED( num_params ); FT_UNUSED( num_params );
UNUSED( params ); FT_UNUSED( params );
UNUSED( face_index ); FT_UNUSED( face_index );
UNUSED( face ); FT_UNUSED( face );
face->root.num_faces = 1; face->root.num_faces = 1;
@ -486,7 +486,7 @@
#else #else
UNUSED( glyph ); FT_UNUSED( glyph );
#endif #endif
} }
@ -515,7 +515,7 @@
#else #else
UNUSED( glyph ); FT_UNUSED( glyph );
#endif #endif

View File

@ -58,8 +58,8 @@
FT_Module_Interface Get_Interface( FT_Driver driver, FT_Module_Interface Get_Interface( FT_Driver driver,
const FT_String* interface ) const FT_String* interface )
{ {
UNUSED(driver); FT_UNUSED(driver);
UNUSED(interface); FT_UNUSED(interface);
#ifndef Z1_CONFIG_OPTION_NO_MM_SUPPORT #ifndef Z1_CONFIG_OPTION_NO_MM_SUPPORT
if ( strcmp( (const char*)interface, "get_mm" ) == 0 ) if ( strcmp( (const char*)interface, "get_mm" ) == 0 )

View File

@ -573,7 +573,7 @@
{ {
Z1_Parser* parser = &loader->parser; Z1_Parser* parser = &loader->parser;
UNUSED(face); FT_UNUSED(face);
parser->cursor = parser->limit; parser->cursor = parser->limit;
parser->error = 0; parser->error = 0;
@ -1334,7 +1334,7 @@
static static
void t1_init_loader( Z1_Loader* loader, T1_Face face ) void t1_init_loader( Z1_Loader* loader, T1_Face face )
{ {
UNUSED(face); FT_UNUSED(face);
MEM_Set( loader, 0, sizeof(*loader) ); MEM_Set( loader, 0, sizeof(*loader) );
loader->num_glyphs = 0; loader->num_glyphs = 0;

View File

@ -132,10 +132,10 @@
FT_Error error; FT_Error error;
PSNames_Interface* psnames; PSNames_Interface* psnames;
UNUSED(num_params); FT_UNUSED(num_params);
UNUSED(params); FT_UNUSED(params);
UNUSED(face_index); FT_UNUSED(face_index);
UNUSED(stream); FT_UNUSED(stream);
face->root.num_faces = 1; face->root.num_faces = 1;
@ -333,7 +333,7 @@
LOCAL_FUNC LOCAL_FUNC
FT_Error Z1_Init_Driver( Z1_Driver driver ) FT_Error Z1_Init_Driver( Z1_Driver driver )
{ {
UNUSED(driver); FT_UNUSED(driver);
return T1_Err_Ok; return T1_Err_Ok;
} }
@ -354,7 +354,7 @@
LOCAL_DEF LOCAL_DEF
void Z1_Done_Driver( Z1_Driver driver ) void Z1_Done_Driver( Z1_Driver driver )
{ {
UNUSED(driver); FT_UNUSED(driver);
} }

View File

@ -771,12 +771,12 @@
case 2: case 2:
*(FT_UShort*)q = (FT_UShort)val; *(FT_UShort*)q = (FT_UShort)val;
break; break;
#if SIZEOF_INT == 4
case 4: case 4:
*(FT_Int*)q = (FT_Int)val; *(FT_UInt32*)q = (FT_UInt32)val;
break; break;
#endif
default: default: /* for 64-bit systems */
*(FT_Long*)q = val; *(FT_Long*)q = val;
} }
} }