From c6a92202c23b916536903921401e6289f8b66ca2 Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 4 Jul 2000 18:12:13 +0000 Subject: [PATCH] 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.. --- config/unix/ftconfig.in | 18 +++++----- include/freetype/config/ftconfig.h | 30 ++++++++-------- include/freetype/internal/ftstream.h | 5 ++- src/base/ftcalc.c | 8 ++--- src/base/ftglyph.c | 2 +- src/base/ftstream.c | 44 +++++++++++------------ src/base/ftsystem.c | 8 ++--- src/cff/t2gload.c | 8 ++--- src/cff/t2objs.c | 4 +-- src/cff/t2parse.c | 24 ++++--------- src/cid/cidload.c | 2 +- src/cid/cidobjs.c | 12 +++---- src/cid/cidparse.c | 6 ++-- src/cid/cidriver.c | 4 +-- src/raster1/ftraster.c | 46 ++++++++++++------------ src/sfnt/sfdriver.c | 2 +- src/sfnt/sfobjs.c | 10 +++--- src/smooth/ftgrays.c | 10 +++--- src/truetype/ttdriver.c | 4 +-- src/truetype/ttgload.c | 9 ++--- src/truetype/ttinterp.c | 52 ++++++++++++++-------------- src/type1/t1driver.c | 12 +++---- src/type1/t1gload.c | 12 +++---- src/type1/t1load.c | 2 +- src/type1/t1objs.c | 14 ++++---- src/type1z/z1driver.c | 4 +-- src/type1z/z1load.c | 4 +-- src/type1z/z1objs.c | 12 +++---- src/type1z/z1parse.c | 8 ++--- 29 files changed, 181 insertions(+), 195 deletions(-) diff --git a/config/unix/ftconfig.in b/config/unix/ftconfig.in index de0980522..c61ab2617 100644 --- a/config/unix/ftconfig.in +++ b/config/unix/ftconfig.in @@ -59,10 +59,10 @@ #undef STDC_HEADERS /* 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. */ -#define SIZEOF_LONG 4 +#define FT_SIZEOF_LONG 4 /* Define if you have the memcpy function. */ #undef HAVE_MEMCPY @@ -99,12 +99,12 @@ typedef signed short FT_Int16; typedef unsigned short FT_Word16; -#if SIZEOF_INT == 4 +#if FT_SIZEOF_INT == 4 typedef signed int FT_Int32; typedef unsigned int FT_Word32; -#elif SIZEOF_LONG == 4 +#elif FT_SIZEOF_LONG == 4 typedef signed long FT_Int32; typedef unsigned long FT_Word32; @@ -113,11 +113,11 @@ #error "no 32bit type found - please check your configuration files" #endif -#if SIZEOF_LONG == 8 +#if FT_SIZEOF_LONG == 8 /* LONG64 must be defined when a 64-bit type is available */ -#define LONG64 -#define INT64 long +#define FT_LONG64 +#define FT_INT64 long #else @@ -132,8 +132,8 @@ /* */ #ifdef FTCALC_USE_LONG_LONG -#define LONG64 -#define INT64 long long +#define FT_LONG64 +#define FT_INT64 long long #endif /* FTCALC_USE_LONG_LONG */ #endif diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h index cd598d817..64506fccd 100644 --- a/include/freetype/config/ftconfig.h +++ b/include/freetype/config/ftconfig.h @@ -63,20 +63,20 @@ /* The number of bytes in an `int' type. */ #if UINT_MAX == 0xFFFFFFFF -#define SIZEOF_INT 4 +#define FT_SIZEOF_INT 4 #elif UINT_MAX == 0xFFFF -#define SIZEOF_INT 2 +#define FT_SIZEOF_INT 2 #elif UINT_MAX > 0xFFFFFFFF && UINT_MAX == 0xFFFFFFFFFFFFFFFF -#define SIZEOF_INT 8 +#define FT_SIZEOF_INT 8 #else #error "Unsupported number of bytes in `int' type!" #endif /* The number of bytes in a `long' type. */ #if ULONG_MAX == 0xFFFFFFFF -#define SIZEOF_LONG 4 +#define FT_SIZEOF_LONG 4 #elif ULONG_MAX > 0xFFFFFFFF && ULONG_MAX == 0xFFFFFFFFFFFFFFFF -#define SIZEOF_LONG 8 +#define FT_SIZEOF_LONG 8 #else #error "Unsupported number of bytes in `long' type!" #endif @@ -97,8 +97,8 @@ /* 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.. */ -#ifndef UNUSED -#define UNUSED( arg ) ( (arg)=(arg) ) +#ifndef FT_UNUSED +#define FT_UNUSED( arg ) ( (arg)=(arg) ) #endif @@ -123,12 +123,12 @@ typedef signed short FT_Int16; typedef unsigned short FT_Word16; -#if SIZEOF_INT == 4 +#if FT_SIZEOF_INT == 4 typedef signed int FT_Int32; typedef unsigned int FT_Word32; -#elif SIZEOF_LONG == 4 +#elif FT_SIZEOF_LONG == 4 typedef signed long FT_Int32; typedef unsigned long FT_Word32; @@ -137,11 +137,11 @@ #error "no 32bit type found - please check your configuration files" #endif -#if SIZEOF_LONG == 8 +#if FT_SIZEOF_LONG == 8 - /* LONG64 must be defined when a 64-bit type is available */ -#define LONG64 -#define INT64 long + /* FT_LONG64 must be defined when a 64-bit type is available */ +#define FT_LONG64 +#define FT_INT64 long #else @@ -156,8 +156,8 @@ /* */ #ifdef FTCALC_USE_LONG_LONG -#define LONG64 -#define INT64 long long +#define FT_LONG64 +#define FT_INT64 long long #endif /* FTCALC_USE_LONG_LONG */ #endif diff --git a/include/freetype/internal/ftstream.h b/include/freetype/internal/ftstream.h index 82e1bf26c..c8e320f8c 100644 --- a/include/freetype/internal/ftstream.h +++ b/include/freetype/internal/ftstream.h @@ -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_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; @@ -96,6 +97,8 @@ typedef struct FT_Frame_Field_ count, \ (FT_UShort)(char*)&FT_FIELD_REF(struct_type,field) } +#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 } + /*************************************************************************/ diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c index 4d8bae64b..55df20c6a 100644 --- a/src/base/ftcalc.c +++ b/src/base/ftcalc.c @@ -111,7 +111,7 @@ #endif /* FT_CONFIG_OPTION_OLD_CALCS */ -#ifdef LONG64 +#ifdef FT_LONG64 /*************************************************************************/ /* */ @@ -252,7 +252,7 @@ while ( z ) { - z = (unsigned INT64)z >> 1; + z = (unsigned FT_INT64)z >> 1; j++; } return j - 1; @@ -298,7 +298,7 @@ #endif /* FT_CONFIG_OPTION_OLD_CALCS */ -#else /* LONG64 */ +#else /* FT_LONG64 */ /*************************************************************************/ @@ -767,7 +767,7 @@ #endif /* FT_CONFIG_OPTION_OLD_CALCS */ -#endif /* LONG64 */ +#endif /* FT_LONG64 */ /* END */ diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c index ddeda7d32..3bbc73aa9 100644 --- a/src/base/ftglyph.c +++ b/src/base/ftglyph.c @@ -1084,7 +1084,7 @@ FT_Pos distance; int c, n, first, orientation; - UNUSED( advance ); + FT_UNUSED( advance ); /* compute control distance */ diff --git a/src/base/ftstream.c b/src/base/ftstream.c index 1ab657fe9..1d8b8b2f3 100644 --- a/src/base/ftstream.c +++ b/src/base/ftstream.c @@ -540,20 +540,28 @@ continue; /* loop! */ case ft_frame_bytes: /* read a byte sequence */ + case ft_frame_skip: /* skip some bytes */ { - FT_Int len = stream->limit - stream->cursor; - - - if ( len > fields->size ) - len = fields->size; - - p = (FT_Byte*)structure + fields->offset; - MEM_Copy( p, stream->cursor, len ); - stream->cursor += len; + FT_Int len = fields->size; + + if (stream->cursor + len > stream->limit) + { + error = FT_Err_Invalid_Stream_Operation; + goto Exit; + } + + if (fields->value == ft_frame_bytes) + { + p = (FT_Byte*)structure + fields->offset; + MEM_Copy( p, stream->cursor, len ); + } + stream->cursor += len; fields++; continue; } + + case ft_frame_byte: case ft_frame_schar: /* read a single byte */ value = GET_Byte(); @@ -644,7 +652,7 @@ /* now, compute the signed value is necessary */ 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 */ @@ -659,23 +667,11 @@ *(FT_UShort*)p = (FT_UShort)value; break; - /* SIZEOF_INT is defined in */ - /* 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: - *(FT_UInt*)p = (FT_UInt)value; + *(FT_UInt32*)p = (FT_UInt32)value; break; -#endif - default: + default: /* for 64-bits systems */ *(FT_ULong*)p = (FT_ULong)value; } diff --git a/src/base/ftsystem.c b/src/base/ftsystem.c index 12494028c..1132152fc 100644 --- a/src/base/ftsystem.c +++ b/src/base/ftsystem.c @@ -70,7 +70,7 @@ void* ft_alloc( FT_Memory memory, long size ) { - UNUSED( memory ); + FT_UNUSED( memory ); return malloc( size ); } @@ -102,8 +102,8 @@ long new_size, void* block ) { - UNUSED( memory ); - UNUSED( cur_size ); + FT_UNUSED( memory ); + FT_UNUSED( cur_size ); return realloc( block, new_size ); } @@ -126,7 +126,7 @@ void ft_free( FT_Memory memory, void* block ) { - UNUSED( memory ); + FT_UNUSED( memory ); free( block ); } diff --git a/src/cff/t2gload.c b/src/cff/t2gload.c index a0d5dc56c..03bace5d9 100644 --- a/src/cff/t2gload.c +++ b/src/cff/t2gload.c @@ -627,10 +627,10 @@ { if ( ip + 3 >= limit ) goto Syntax_Error; - val = ( (FT_Long)ip[0] << 24 ) | - ( (FT_Long)ip[1] << 16 ) | - ( (FT_Long)ip[2] << 8 ) | - ip[3]; + val = ( (FT_Int32)ip[0] << 24 ) | + ( (FT_Int32)ip[1] << 16 ) | + ( (FT_Int32)ip[2] << 8 ) | + ip[3]; ip += 4; shift = 0; } diff --git a/src/cff/t2objs.c b/src/cff/t2objs.c index 6eaea28a8..e274f8ce6 100644 --- a/src/cff/t2objs.c +++ b/src/cff/t2objs.c @@ -203,7 +203,7 @@ #else - UNUSED( driver ); + FT_UNUSED( driver ); return T2_Err_Ok; @@ -233,7 +233,7 @@ #else - UNUSED( driver ); + FT_UNUSED( driver ); #endif } diff --git a/src/cff/t2parse.c b/src/cff/t2parse.c index 1af97957b..9565765e7 100644 --- a/src/cff/t2parse.c +++ b/src/cff/t2parse.c @@ -519,16 +519,6 @@ case t2_kind_fixed: val = t2_parse_fixed( parser->stack ); - /* SIZEOF_INT is defined in */ - /* 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: switch ( field->size ) { @@ -540,13 +530,11 @@ *(FT_Short*)q = (FT_Short)val; break; -#if SIZEOF_INT == 4 case 4: - *(FT_Int*)q = (FT_Int)val; + *(FT_Int32*)q = (FT_Int)val; break; -#endif - default: + default: /* for 64-bit systems where long is 8 bytes */ *(FT_Long*)q = val; } break; @@ -578,12 +566,12 @@ case 2: *(FT_Short*)q = (FT_Short)val; break; -#if SIZEOF_INT == 4 + case 4: - *(FT_Int*)q = (FT_Int)val; + *(FT_Int32*)q = (FT_Int)val; break; -#endif - default: + + default: /* for 64-bit systems */ *(FT_Long*)q = val; } diff --git a/src/cid/cidload.c b/src/cid/cidload.c index c66496d3f..b9a94f52e 100644 --- a/src/cid/cidload.c +++ b/src/cid/cidload.c @@ -466,7 +466,7 @@ void t1_init_loader( CID_Loader* loader, CID_Face face ) { - UNUSED( face ); + FT_UNUSED( face ); MEM_Set( loader, 0, sizeof ( *loader ) ); } diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c index 5b0af145d..d0b241b00 100644 --- a/src/cid/cidobjs.c +++ b/src/cid/cidobjs.c @@ -121,10 +121,10 @@ FT_Error error; PSNames_Interface* psnames; - UNUSED( num_params ); - UNUSED( params ); - UNUSED( face_index ); - UNUSED( stream ); + FT_UNUSED( num_params ); + FT_UNUSED( params ); + FT_UNUSED( face_index ); + FT_UNUSED( stream ); face->root.num_faces = 1; @@ -341,7 +341,7 @@ LOCAL_FUNC FT_Error CID_Init_Driver( CID_Driver driver ) { - UNUSED( driver ); + FT_UNUSED( driver ); return T1_Err_Ok; } @@ -361,7 +361,7 @@ LOCAL_DEF void CID_Done_Driver( CID_Driver driver ) { - UNUSED( driver ); + FT_UNUSED( driver ); } diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c index 279d4b967..f272bde7a 100644 --- a/src/cid/cidparse.c +++ b/src/cid/cidparse.c @@ -761,13 +761,11 @@ *(FT_UShort*)q = (FT_UShort)val; break; -#if SIZEOF_INT == 4 case 4: - *(FT_Int*)q = (FT_Int)val; + *(FT_Int32*)q = (FT_Int)val; break; -#endif - default: + default: /* for 64-bit systems */ *(FT_Long*)q = val; } break; diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c index 47195540b..651dcb1c8 100644 --- a/src/cid/cidriver.c +++ b/src/cid/cidriver.c @@ -40,8 +40,8 @@ FT_Module_Interface CID_Get_Interface( FT_Driver driver, const FT_String* interface ) { - UNUSED( driver ); - UNUSED( interface ); + FT_UNUSED( driver ); + FT_UNUSED( interface ); return 0; } diff --git a/src/raster1/ftraster.c b/src/raster1/ftraster.c index 19ca5aaeb..08acf39cc 100644 --- a/src/raster1/ftraster.c +++ b/src/raster1/ftraster.c @@ -146,7 +146,7 @@ /* Its purpose is simply to reduce compiler warnings. Note also that */ /* simply defining it as `(void)x' doesn't avoid warnings with certain */ /* ANSI compilers (e.g. LCC). */ -#define UNUSED( x ) (x) = (x) +#define FT_UNUSED( x ) (x) = (x) /* Disable the tracing mechanism for simplicity -- developers can */ /* activate it easily by redefining these two macros. */ @@ -311,7 +311,7 @@ #define RAS_VARS /* void */ #define RAS_VAR /* void */ -#define UNUSED_RASTER do ; while ( 0 ) +#define FT_UNUSED_RASTER do ; while ( 0 ) #else /* TT_STATIC_RASTER */ @@ -323,7 +323,7 @@ #define RAS_VARS raster, #define RAS_VAR raster -#define UNUSED_RASTER UNUSED( raster ) +#define FT_UNUSED_RASTER FT_UNUSED( raster ) #endif /* TT_STATIC_RASTER */ @@ -2028,7 +2028,7 @@ { Long pitch = ras.target.pitch; - UNUSED( max ); + FT_UNUSED( max ); ras.traceIncr = (Short)-pitch; @@ -2053,9 +2053,9 @@ Byte f1, f2; Byte* target; - UNUSED( y ); - UNUSED( left ); - UNUSED( right ); + FT_UNUSED( y ); + FT_UNUSED( left ); + FT_UNUSED( right ); /* Drop-out control */ @@ -2239,9 +2239,9 @@ Short* max ) { /* nothing, really */ - UNUSED( raster ); - UNUSED( min ); - UNUSED( max ); + FT_UNUSED( raster ); + FT_UNUSED( min ); + FT_UNUSED( max ); } @@ -2256,8 +2256,8 @@ PByte bits; Byte f1; - UNUSED( left ); - UNUSED( right ); + FT_UNUSED( left ); + FT_UNUSED( right ); if ( x2 - x1 < ras.precision ) @@ -2388,7 +2388,7 @@ void Horizontal_Sweep_Step( RAS_ARG ) { /* Nothing, really */ - UNUSED( raster ); + FT_UNUSED( raster ); } @@ -2535,12 +2535,12 @@ PProfile right ) { /* nothing, really */ - UNUSED( raster ); - UNUSED( y ); - UNUSED( x1 ); - UNUSED( x2 ); - UNUSED( left ); - UNUSED( right ); + FT_UNUSED( raster ); + FT_UNUSED( y ); + FT_UNUSED( x1 ); + FT_UNUSED( x2 ); + FT_UNUSED( left ); + FT_UNUSED( right ); } @@ -3097,7 +3097,7 @@ LOCAL_FUNC FT_Error Render_Gray_Glyph( RAS_ARG ) { - UNUSED_RASTER; + FT_UNUSED_RASTER; return FT_Err_Cannot_Render_Glyph; } @@ -3235,9 +3235,9 @@ #else - UNUSED( raster ); - UNUSED( mode ); - UNUSED( palette ); + FT_UNUSED( raster ); + FT_UNUSED( mode ); + FT_UNUSED( palette ); #endif } diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c index ccc67b5c5..fe0a271ae 100644 --- a/src/sfnt/sfdriver.c +++ b/src/sfnt/sfdriver.c @@ -77,7 +77,7 @@ FT_Module_Interface SFNT_Get_Interface( FT_Module module, const char* interface ) { - UNUSED( module ); + FT_UNUSED( module ); if ( strcmp( interface, "get_sfnt" ) == 0 ) return (FT_Module_Interface)get_sfnt_table; diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 8e4e448a8..cb3e0f056 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -186,8 +186,8 @@ SFNT_Header sfnt_header; /* for now, parameters are unused */ - UNUSED( num_params ); - UNUSED( params ); + FT_UNUSED( num_params ); + FT_UNUSED( params ); sfnt = (SFNT_Interface*)face->sfnt; if ( !sfnt ) @@ -246,9 +246,9 @@ FT_Error error; SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt; - UNUSED( face_index ); - UNUSED( num_params ); - UNUSED( params ); + FT_UNUSED( face_index ); + FT_UNUSED( num_params ); + FT_UNUSED( params ); /* Load tables */ diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index 61cc12fa8..7e3fab30f 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -108,7 +108,7 @@ /* Its purpose is simply to reduce compiler warnings. Note also that */ /* simply defining it as `(void)x' doesn't avoid warnings with certain */ /* ANSI compilers (e.g. LCC). */ -#define UNUSED( x ) (x) = (x) +#define FT_UNUSED( x ) (x) = (x) /* Disable the tracing mechanism for simplicity -- developers can */ /* activate it easily by redefining these two macros. */ @@ -125,7 +125,7 @@ #include "ftgrays.h" -#include /* for UNUSED() */ +#include /* for FT_UNUSED() */ #include /* for FT_TRACE() and FT_ERROR() */ #include /* for FT_Outline_Decompose() */ @@ -1356,7 +1356,7 @@ TScan x, y, cover, area; PCell start, cur, limit; - UNUSED( target ); + FT_UNUSED( target ); cur = ras.cells; @@ -1879,7 +1879,7 @@ { static TRaster the_raster; - UNUSED( memory ); + FT_UNUSED( memory ); *araster = (FT_Raster)&the_raster; @@ -1893,7 +1893,7 @@ void grays_raster_done( FT_Raster raster ) { /* nothing */ - UNUSED( raster ); + FT_UNUSED( raster ); } #else /* _STANDALONE_ */ diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c index d43220d92..8921349fe 100644 --- a/src/truetype/ttdriver.c +++ b/src/truetype/ttdriver.c @@ -245,8 +245,8 @@ FT_UInt pixel_width, FT_UInt pixel_height ) { - UNUSED( pixel_width ); - UNUSED( pixel_height ); + FT_UNUSED( pixel_width ); + FT_UNUSED( pixel_height ); /* many things have been pre-computed by the base layer */ diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index df6c1ef96..ad7c726a4 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -813,7 +813,7 @@ { TT_GlyphSlot glyph = (TT_GlyphSlot)loader->glyph; FT_UInt start_point, start_contour; - + FT_ULong ins_pos; /* position of composite instructions, if any */ /* for each subglyph, read composite header */ start_point = gloader->base.outline.n_points; @@ -823,6 +823,7 @@ if ( error ) goto Fail; + ins_pos = loader->ins_pos; face->forget_glyph_frame( loader ); opened_frame = 0; @@ -973,7 +974,7 @@ if ( num_subglyphs > 0 && loader->exec && - loader->ins_pos > 0 && + ins_pos > 0 && subglyph->flags & WE_HAVE_INSTR ) { FT_UShort n_ins; @@ -984,8 +985,8 @@ /* read size of instructions */ - if ( FILE_Seek( loader->ins_pos ) || - READ_UShort( n_ins ) ) + if ( FILE_Seek( ins_pos ) || + READ_UShort( n_ins ) ) goto Fail; FT_TRACE5(( " Instructions size = %d\n", n_ins )); diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c index b890b64b2..d6fd2ed89 100644 --- a/src/truetype/ttinterp.c +++ b/src/truetype/ttinterp.c @@ -31,7 +31,7 @@ #define TT_MULFIX FT_MulFix #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 */ /* 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 */ /* 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; #if 1 - UNUSED( debug ); + FT_UNUSED( debug ); return exec->face->interpreter( exec ); #else @@ -839,7 +839,7 @@ FT_Error TT_Done_Context( TT_ExecContext exec ) { /* Nothing at all for now */ - UNUSED( exec ); + FT_UNUSED( exec ); return TT_Err_Ok; } @@ -850,7 +850,7 @@ static FT_F26Dot6 Norm( FT_F26Dot6 X, FT_F26Dot6 Y ) { - TT_INT64 T1, T2; + TT_FT_INT64 T1, T2; MUL_64( X, X, T1 ); @@ -1479,7 +1479,7 @@ FT_UShort point, FT_F26Dot6 distance ) { - UNUSED_EXEC; + FT_UNUSED_EXEC; zone->cur[point].x += distance; zone->tags[point] |= FT_Curve_Tag_Touch_X; @@ -1491,7 +1491,7 @@ FT_UShort point, FT_F26Dot6 distance ) { - UNUSED_EXEC; + FT_UNUSED_EXEC; zone->cur[point].y += distance; zone->tags[point] |= FT_Curve_Tag_Touch_Y; @@ -1526,7 +1526,7 @@ { FT_F26Dot6 val; - UNUSED_EXEC; + FT_UNUSED_EXEC; if ( distance >= 0 ) @@ -1566,7 +1566,7 @@ { FT_F26Dot6 val; - UNUSED_EXEC; + FT_UNUSED_EXEC; if ( distance >= 0 ) @@ -1610,7 +1610,7 @@ { FT_F26Dot6 val; - UNUSED_EXEC; + FT_UNUSED_EXEC; if ( distance >= 0 ) @@ -1652,7 +1652,7 @@ { FT_F26Dot6 val; - UNUSED_EXEC; + FT_UNUSED_EXEC; if ( distance >= 0 ) @@ -1697,7 +1697,7 @@ FT_F26Dot6 val; - UNUSED_EXEC; + FT_UNUSED_EXEC; if ( distance >= 0 ) { @@ -1740,7 +1740,7 @@ { FT_F26Dot6 val; - UNUSED_EXEC; + FT_UNUSED_EXEC; if ( distance >= 0 ) @@ -2073,7 +2073,7 @@ FT_F26Dot6 Project_x( EXEC_OP_ FT_Vector* v1, FT_Vector* v2 ) { - UNUSED_EXEC; + FT_UNUSED_EXEC; return ( v1->x - v2->x ); } @@ -2099,7 +2099,7 @@ FT_F26Dot6 Project_y( EXEC_OP_ FT_Vector* v1, FT_Vector* v2 ) { - UNUSED_EXEC; + FT_UNUSED_EXEC; return ( v1->y - v2->y ); } @@ -2214,7 +2214,7 @@ FT_F26Dot6 W; FT_Bool S1, S2; - UNUSED_EXEC; + FT_UNUSED_EXEC; if ( ABS( Vx ) < 0x10000L && ABS( Vy ) < 0x10000L ) @@ -3986,7 +3986,7 @@ { FT_Long A, B, C; - UNUSED_EXEC; + FT_UNUSED_EXEC; A = args[2]; @@ -4089,7 +4089,7 @@ { FT_Int nIfs; - UNUSED_ARG; + FT_UNUSED_ARG; nIfs = 1; @@ -4198,7 +4198,7 @@ { TT_CallRec* pRec; - UNUSED_ARG; + FT_UNUSED_ARG; if ( CUR.callTop <= 0 ) /* We encountered an ENDF without a call */ @@ -5010,7 +5010,7 @@ { FT_UShort point; - UNUSED_ARG; + FT_UNUSED_ARG; if ( CUR.top < CUR.GS.loop ) @@ -5192,7 +5192,7 @@ dy; FT_UShort point; - UNUSED_ARG; + FT_UNUSED_ARG; if ( CUR.top < CUR.GS.loop ) @@ -5757,7 +5757,7 @@ FT_UShort point; FT_F26Dot6 distance; - UNUSED_ARG; + FT_UNUSED_ARG; if ( CUR.top < CUR.GS.loop || @@ -5926,7 +5926,7 @@ distance; FT_UShort point; - UNUSED_ARG; + FT_UNUSED_ARG; if ( CUR.top < CUR.GS.loop ) @@ -6165,7 +6165,7 @@ FT_UInt point; /* current point */ FT_Short contour; /* current contour */ - UNUSED_ARG; + FT_UNUSED_ARG; if ( CUR.opcode & 1 ) @@ -6433,7 +6433,7 @@ TT_DefRecord* def = CUR.IDefs; TT_DefRecord* limit = def + CUR.numIDefs; - UNUSED_ARG; + FT_UNUSED_ARG; for ( ; def < limit; def++ ) diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c index 76ab375b5..5dc9949c1 100644 --- a/src/type1/t1driver.c +++ b/src/type1/t1driver.c @@ -128,10 +128,10 @@ FT_UInt horz_resolution, FT_UInt vert_resolution ) { - UNUSED( char_width ); - UNUSED( char_height ); - UNUSED( horz_resolution ); - UNUSED( vert_resolution ); + FT_UNUSED( char_width ); + FT_UNUSED( char_height ); + FT_UNUSED( horz_resolution ); + FT_UNUSED( vert_resolution ); size->valid = FALSE; @@ -164,8 +164,8 @@ FT_Int pixel_width, FT_Int pixel_height ) { - UNUSED( pixel_width ); - UNUSED( pixel_height ); + FT_UNUSED( pixel_width ); + FT_UNUSED( pixel_height ); size->valid = FALSE; diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c index 82f454b00..2a5bd6a30 100644 --- a/src/type1/t1gload.c +++ b/src/type1/t1gload.c @@ -408,9 +408,9 @@ FT_Vector* flex = decoder->flex_vectors; FT_Int n; - UNUSED( threshold ); - UNUSED( end_x ); - UNUSED( end_y ); + FT_UNUSED( threshold ); + FT_UNUSED( end_x ); + FT_UNUSED( end_y ); /* we don't even try to test the threshold in the non-hinting */ @@ -1080,9 +1080,9 @@ FT_Pos wx, FT_Pos wy ) { - UNUSED( sbx ); - UNUSED( sby ); - UNUSED( wy ); + FT_UNUSED( sbx ); + FT_UNUSED( sby ); + FT_UNUSED( wy ); if ( wx > decoder->builder.advance.x ) decoder->builder.advance.x = wx; diff --git a/src/type1/t1load.c b/src/type1/t1load.c index aed196b6b..d646c8ac9 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -592,7 +592,7 @@ static FT_Error Do_Def_Ignore( T1_Parser* parser ) { - UNUSED( parser ); + FT_UNUSED( parser ); return T1_Err_Ok; } diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c index 5b14d4b08..fe866ac5e 100644 --- a/src/type1/t1objs.c +++ b/src/type1/t1objs.c @@ -103,7 +103,7 @@ return error; #else - UNUSED( error ); + FT_UNUSED( error ); return T1_Err_Ok; @@ -262,10 +262,10 @@ FT_Error error; PSNames_Interface* psnames; - UNUSED( num_params ); - UNUSED( params ); - UNUSED( face_index ); - UNUSED( face ); + FT_UNUSED( num_params ); + FT_UNUSED( params ); + FT_UNUSED( face_index ); + FT_UNUSED( face ); face->root.num_faces = 1; @@ -486,7 +486,7 @@ #else - UNUSED( glyph ); + FT_UNUSED( glyph ); #endif } @@ -515,7 +515,7 @@ #else - UNUSED( glyph ); + FT_UNUSED( glyph ); #endif diff --git a/src/type1z/z1driver.c b/src/type1z/z1driver.c index a262f275e..286d9bd8b 100644 --- a/src/type1z/z1driver.c +++ b/src/type1z/z1driver.c @@ -58,8 +58,8 @@ FT_Module_Interface Get_Interface( FT_Driver driver, const FT_String* interface ) { - UNUSED(driver); - UNUSED(interface); + FT_UNUSED(driver); + FT_UNUSED(interface); #ifndef Z1_CONFIG_OPTION_NO_MM_SUPPORT if ( strcmp( (const char*)interface, "get_mm" ) == 0 ) diff --git a/src/type1z/z1load.c b/src/type1z/z1load.c index 3083b5f0e..11e8893eb 100644 --- a/src/type1z/z1load.c +++ b/src/type1z/z1load.c @@ -573,7 +573,7 @@ { Z1_Parser* parser = &loader->parser; - UNUSED(face); + FT_UNUSED(face); parser->cursor = parser->limit; parser->error = 0; @@ -1334,7 +1334,7 @@ static void t1_init_loader( Z1_Loader* loader, T1_Face face ) { - UNUSED(face); + FT_UNUSED(face); MEM_Set( loader, 0, sizeof(*loader) ); loader->num_glyphs = 0; diff --git a/src/type1z/z1objs.c b/src/type1z/z1objs.c index 27e022ce3..5acaadbef 100644 --- a/src/type1z/z1objs.c +++ b/src/type1z/z1objs.c @@ -132,10 +132,10 @@ FT_Error error; PSNames_Interface* psnames; - UNUSED(num_params); - UNUSED(params); - UNUSED(face_index); - UNUSED(stream); + FT_UNUSED(num_params); + FT_UNUSED(params); + FT_UNUSED(face_index); + FT_UNUSED(stream); face->root.num_faces = 1; @@ -333,7 +333,7 @@ LOCAL_FUNC FT_Error Z1_Init_Driver( Z1_Driver driver ) { - UNUSED(driver); + FT_UNUSED(driver); return T1_Err_Ok; } @@ -354,7 +354,7 @@ LOCAL_DEF void Z1_Done_Driver( Z1_Driver driver ) { - UNUSED(driver); + FT_UNUSED(driver); } diff --git a/src/type1z/z1parse.c b/src/type1z/z1parse.c index 55c013f24..ed24458f2 100644 --- a/src/type1z/z1parse.c +++ b/src/type1z/z1parse.c @@ -771,12 +771,12 @@ case 2: *(FT_UShort*)q = (FT_UShort)val; break; -#if SIZEOF_INT == 4 + case 4: - *(FT_Int*)q = (FT_Int)val; + *(FT_UInt32*)q = (FT_UInt32)val; break; -#endif - default: + + default: /* for 64-bit systems */ *(FT_Long*)q = val; } }