From be3c9814a4dabb718f89ec8edb2249f8ae4ba9ff Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Fri, 27 Jan 2006 14:16:16 +0000 Subject: [PATCH] Formatting, copyright years. --- ChangeLog | 83 +++++++++++++------ Jamfile | 2 +- builds/freetype.mk | 8 +- include/freetype/config/ftheader.h | 15 ++-- include/freetype/config/ftoption.h | 24 +++--- include/freetype/internal/ftmemory.h | 119 +++++++++++++++------------ src/base/ftbitmap.c | 2 +- src/base/ftobjs.c | 20 ++--- src/base/ftrfork.c | 2 +- src/base/ftutil.c | 22 +++-- src/cache/ftccache.c | 2 +- src/cff/cffload.c | 4 +- src/gzip/ftgzip.c | 2 +- src/otvalid/otvcommn.c | 2 +- src/otvalid/otvgpos.c | 2 +- src/pfr/pfrobjs.c | 2 +- src/psaux/afmparse.c | 22 ++--- src/psaux/psconv.c | 6 +- src/sfnt/sfobjs.c | 8 +- src/sfnt/ttsbit0.c | 12 +-- 20 files changed, 210 insertions(+), 149 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c50dc3c2..a20e8b1b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,35 +1,66 @@ 2006-01-27 David Turner - * src/autofit/afwarp.c: simple #ifdef to prevent compilation when - the warp hinter isn't active (it shouldn't, still experimental) + * src/autofit/afwarp.c: Simple #ifdef to prevent compilation when + the warp hinter isn't active (it shouldn't, still experimental). - * Jamfile, include/freetype/config/ftmodule.h: removed "gxvalid" - and "otvalid" from the list of modules that are linked statically - to a given FreeType library. Functionality has been moved to the - "ftvalid" CVS module. - - note also that current Make-based build system still compiles the - modules though... + * Jamfile, include/freetype/config/ftmodule.h: Removed `gxvalid' + and `otvalid' from the list of modules that are linked statically + to a given FreeType library. Functionality has been moved to the + `ftvalid' CVS module. - * include/freetype/config/ftoption.h: added FT_STRICT_ALIASING, - which controls the definitions of the memory management functions - to avoid warnings with recent versions of GCC. this macro is - only here to be disabled, in case we detect problems with the - new scheme. - - NOTE: disable macro to use the memory debugger. this will be fixed - later !! + Note also that current Make-based build system still compiles the + modules though. - * builds/win32/visualc/freetype.dsp: updating project file to - define FT2_BUILD_LIBRARY, and remove gxvalid+otvalid from - compilation + * include/freetype/config/ftoption.h (FT_STRICT_ALIASING): New macro + which controls the definitions of the memory management functions to + avoid warnings with recent versions of GCC. This macro is only here + to be disabled, in case we detect problems with the new scheme. - * builds/freetype.mk, Jamfile: define the macro FT2_BUILD_LIBRARY - when compiling the library. - - * include/freetype/config/ftheader.h: remove inclusions of - internal headers, except if the macro FT2_BUILD_LIBRARY is defined. - + NOTE: Disable macro to use the memory debugger -- this will be fixed + later! + + * include/freetype/internal/ftmemory.h, src/base/ftutil.c (FT_Alloc, + FT_QAlloc, FT_Realloc, FT_QRealloc, FT_Free) [FT_STRICT_ALIASING]: + New versions. + + + * builds/win32/visualc/freetype.dsp: Updating project file to + define FT2_BUILD_LIBRARY, and remove gxvalid + otvalid modules from + compilation. + + + * builds/freetype.mk (FT_CFLAGS), Jamfile (DEFINES): Define the + macro FT2_BUILD_LIBRARY when compiling the library. + + * include/freetype/config/ftheader.h: Remove inclusions of internal + headers except if the macro FT2_BUILD_LIBRARY is defined. + + + * include/freetype/internal/psaux.h (AFM_KernPair, AFM_TrackKern, + AFM_FontInfo): Move structure declarations to... + * include/freetype/internal/t1types.h: This file. + + + * (many files): Fix compiler warnings. + Various minor reorganizations. + + + * src/cff/cffload.c (cff_font_done): Don't free static array + `subfonts'. + + * src/otvalid/otvcommn.c (otv_ClassDef_validate), + src/otvalid/otvgpos.c (otv_x_sxy): Fix debugging information. + + * src/psaux/afmparse.c: Include ft2build.h and FT_FREETYPE_H. + (AFM_MAX_ARGUMENTS): Define... + * src/psaux/afmparse.h: Here. + * src/psaux/Jamfile (_sources): Add afmparse. + + * src/psaux/psconv.c: Include psconv.h. + + * src/type1/t1afm.c: Don't include FT_INTERNAL_TYPE1_TYPES_H but + FT_INTERNAL_POSTSCRIPT_AUX_H. + * src/type1/t1afm.h: Include FT_INTERNAL_TYPE1_TYPES_H. 2006-01-23 Chia-I Wu diff --git a/Jamfile b/Jamfile index 471c29854..d75c666bd 100644 --- a/Jamfile +++ b/Jamfile @@ -1,6 +1,6 @@ # FreeType 2 top Jamfile. # -# Copyright 2001, 2002, 2003, 2004, 2005 by +# Copyright 2001, 2002, 2003, 2004, 2005, 2006 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/builds/freetype.mk b/builds/freetype.mk index 6f7abd405..a87f7fec2 100644 --- a/builds/freetype.mk +++ b/builds/freetype.mk @@ -3,7 +3,7 @@ # -# Copyright 1996-2000, 2001, 2002, 2003, 2004, 2005 by +# Copyright 1996-2000, 2001, 2002, 2003, 2004, 2005, 2006 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -133,9 +133,9 @@ INCLUDE_FLAGS = $(INCLUDES:%=$I%) # $(INCLUDE_FLAGS) should come before $(CFLAGS) to avoid problems with # old FreeType versions. # -# note what we also define the macro FT2_BUILD_LIBRARY when building -# FreeType. this is required to let our sources include the internal -# headers (something forbidden by clients) +# Note what we also define the macro FT2_BUILD_LIBRARY when building +# FreeType. This is required to let our sources include the internal +# headers (something forbidden by clients). # FT_CFLAGS = $(CPPFLAGS) $(INCLUDE_FLAGS) $(CFLAGS) $DFT2_BUILD_LIBRARY FT_CC = $(CC) $(FT_CFLAGS) diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h index 2b08b5315..4062fdb4a 100644 --- a/include/freetype/config/ftheader.h +++ b/include/freetype/config/ftheader.h @@ -4,7 +4,7 @@ /* */ /* Build macros of the FreeType 2 library. */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -626,14 +626,17 @@ #define FT_TRUETYPE_UNPATENTED_H -/* now include internal headers definitions from - * only when we're building the library !! - */ + + /* + * Include internal headers definitions from + * only when building the library. + */ #ifdef FT2_BUILD_LIBRARY -# define FT_INTERNAL_INTERNAL_H -# include FT_INTERNAL_INTERNAL_H +#define FT_INTERNAL_INTERNAL_H +#include FT_INTERNAL_INTERNAL_H #endif /* FT2_BUILD_LIBRARY */ + #endif /* __FT2_BUILD_H__ */ diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h index ab5d1564b..2bc615147 100644 --- a/include/freetype/config/ftoption.h +++ b/include/freetype/config/ftoption.h @@ -4,7 +4,7 @@ /* */ /* User-selectable configuration macros (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -556,20 +556,22 @@ FT_BEGIN_HEADER /* */ -/* - * This temporary macro is used to control various optimizations for - * reducing the heap footprint of memory-mapped TrueType files. - * - */ + /* + * This temporary macro is used to control various optimizations for + * reducing the heap footprint of memory-mapped TrueType files. + */ #define FT_OPTIMIZE_MEMORY -/* this temporary macro is used to control wether we're going to - * compile certain functions like FT_Alloc in a way that prevent recent - * GCC releases from spouting horrible "strict aliasing" warning - * messages each time a memory-management function is called - */ + + /* + * This temporary macro is used to control whether we are going to + * compile certain functions like FT_Alloc in a way that prevents recent + * GCC releases from emitting zillions of `strict aliasing' warning + * messages each time a memory-management function is called. + */ #define FT_STRICT_ALIASING + FT_END_HEADER diff --git a/include/freetype/internal/ftmemory.h b/include/freetype/internal/ftmemory.h index 30e77e363..854364207 100644 --- a/include/freetype/internal/ftmemory.h +++ b/include/freetype/internal/ftmemory.h @@ -4,7 +4,7 @@ /* */ /* The FreeType memory management macros (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2004, 2005 by */ +/* Copyright 1996-2001, 2002, 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -56,11 +56,15 @@ FT_BEGIN_HEADER /*************************************************************************/ /*************************************************************************/ + #ifdef FT_STRICT_ALIASING - /* the allocation functions return a pointer, and the error code - * is written to through the 'p_error' parameter - */ + + /* + * The allocation functions return a pointer, and the error code + * is written to through the `p_error' parameter. See below for + * for documentation. + */ FT_BASE( FT_Pointer ) FT_Alloc( FT_Memory memory, @@ -91,7 +95,8 @@ FT_BEGIN_HEADER const void* P ); -# ifdef FT_DEBUG_MEMORY +#ifdef FT_DEBUG_MEMORY + FT_BASE( FT_Pointer ) FT_Alloc_Debug( FT_Memory memory, @@ -132,64 +137,71 @@ FT_BEGIN_HEADER const char* file_name, FT_Long line_no ); -# define FT_MEM_ALLOC( _pointer_, _size_ ) \ +#define FT_MEM_ALLOC( _pointer_, _size_ ) \ (_pointer_) = FT_Alloc_Debug( memory, _size_, &error, \ - __FILE__, __LINE__ ) + __FILE__, __LINE__ ) -# define FT_MEM_REALLOC( _pointer_, _current_, _size_ ) \ - (_pointer_) = FT_Realloc_Debug( memory, _current_, _size_, \ - (_pointer_), &error, \ - __FILE__, __LINE__ ) +#define FT_MEM_REALLOC( _pointer_, _current_, _size_ ) \ + (_pointer_) = FT_Realloc_Debug( memory, _current_, _size_, \ + (_pointer_), &error, \ + __FILE__, __LINE__ ) -# define FT_MEM_QALLOC( _pointer_, _size_ ) \ +#define FT_MEM_QALLOC( _pointer_, _size_ ) \ (_pointer_) = FT_QAlloc_Debug( memory, _size_, &error, \ - __FILE__, __LINE__ ) + __FILE__, __LINE__ ) -# define FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) \ - (_pointer_) = FT_QRealloc_Debug( memory, _current_, _size_, \ - (_pointer_), &error, \ - __FILE__, __LINE__ ) +#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) \ + (_pointer_) = FT_QRealloc_Debug( memory, _current_, _size_, \ + (_pointer_), &error, \ + __FILE__, __LINE__ ) -# define FT_MEM_FREE( _pointer_ ) \ - FT_BEGIN_STMNT \ - if ( _pointer_ ) { \ - FT_Free_Debug( memory, (_pointer_), __FILE__, __LINE__ ); \ - (_pointer_) = NULL; \ - } \ - FT_END_STMNT +#define FT_MEM_FREE( _pointer_ ) \ + FT_BEGIN_STMNT \ + if ( _pointer_ ) \ + { \ + FT_Free_Debug( memory, (_pointer_), __FILE__, __LINE__ ); \ + (_pointer_) = NULL; \ + } \ + FT_END_STMNT -# else /* !FT_DEBUG_MEMORY */ +#else /* !FT_DEBUG_MEMORY */ -# define FT_MEM_ALLOC( _pointer_, _size_ ) \ + +#define FT_MEM_ALLOC( _pointer_, _size_ ) \ (_pointer_) = FT_Alloc( memory, _size_, &error ) -# define FT_MEM_FREE( _pointer_ ) \ - FT_BEGIN_STMNT \ - if ( (_pointer_) ) { \ - FT_Free( memory, (_pointer_) ); \ - (_pointer_) = NULL; \ - } \ - FT_END_STMNT +#define FT_MEM_FREE( _pointer_ ) \ + FT_BEGIN_STMNT \ + if ( (_pointer_) ) \ + { \ + FT_Free( memory, (_pointer_) ); \ + (_pointer_) = NULL; \ + } \ + FT_END_STMNT -# define FT_MEM_REALLOC( _pointer_, _current_, _size_ ) \ - (_pointer_) = FT_Realloc( memory, _current_, _size_, \ +#define FT_MEM_REALLOC( _pointer_, _current_, _size_ ) \ + (_pointer_) = FT_Realloc( memory, _current_, _size_, \ (_pointer_), &error ) -# define FT_MEM_QALLOC( _pointer_, _size_ ) \ +#define FT_MEM_QALLOC( _pointer_, _size_ ) \ (_pointer_) = FT_QAlloc( memory, _size_, &error ) -# define FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) \ - (_pointer_) = FT_QRealloc( memory, _current_, _size_, \ +#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) \ + (_pointer_) = FT_QRealloc( memory, _current_, _size_, \ (_pointer_), &error ) -# endif /* !FT_DEBUG_MEMORY */ +#endif /* !FT_DEBUG_MEMORY */ + + +#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 ) -# define FT_MEM_SET_ERROR(cond) ( (cond), error != 0 ) #else /* !FT_STRICT_ALIASING */ -# ifdef FT_DEBUG_MEMORY + +#ifdef FT_DEBUG_MEMORY + FT_BASE( FT_Error ) FT_Alloc_Debug( FT_Memory memory, @@ -227,8 +239,8 @@ FT_BEGIN_HEADER const char* file_name, FT_Long line_no ); -# endif /* FT_DEBUG_MEMORY */ +#endif /* FT_DEBUG_MEMORY */ /*************************************************************************/ @@ -383,8 +395,10 @@ FT_BEGIN_HEADER FT_Free( FT_Memory memory, void* *P ); + #ifdef FT_DEBUG_MEMORY + #define FT_MEM_ALLOC( _pointer_, _size_ ) \ FT_Alloc_Debug( memory, _size_, \ (void**)(void*)&(_pointer_), \ @@ -410,7 +424,7 @@ FT_BEGIN_HEADER __FILE__, __LINE__ ) -#else /* !FT_DEBUG_MEMORY */ +#else /* !FT_DEBUG_MEMORY */ #define FT_MEM_ALLOC( _pointer_, _size_ ) \ @@ -433,14 +447,16 @@ FT_BEGIN_HEADER FT_QRealloc( memory, _current_, _size_, \ (void**)(void*)&(_pointer_) ) + #endif /* !FT_DEBUG_MEMORY */ -# define FT_MEM_SET_ERROR(cond) ( (error = (cond)) != 0 ) + +#define FT_MEM_SET_ERROR( cond ) ( ( error = (cond) ) != 0 ) + #endif /* !FT_STRICT_ALIASING */ - #define FT_MEM_SET( dest, byte, count ) ft_memset( dest, byte, count ) #define FT_MEM_COPY( dest, source, count ) ft_memcpy( dest, source, count ) @@ -472,7 +488,6 @@ FT_BEGIN_HEADER #define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) ) - /*************************************************************************/ /* */ /* The following functions macros expect that their pointer argument is */ @@ -517,21 +532,19 @@ FT_BEGIN_HEADER /* */ /* The following macros are variants of their FT_MEM_XXXX equivalents; */ /* they are used to set an _implicit_ `error' variable and return TRUE */ - /* if an error occured (i.e. if 'error != 0'). */ + /* if an error occured (i.e., if 'error != 0'). */ /* */ - - -#define FT_ALLOC( _pointer_, _size_ ) \ +#define FT_ALLOC( _pointer_, _size_ ) \ FT_MEM_SET_ERROR( FT_MEM_ALLOC( _pointer_, _size_ ) ) -#define FT_REALLOC( _pointer_, _current_, _size_ ) \ +#define FT_REALLOC( _pointer_, _current_, _size_ ) \ FT_MEM_SET_ERROR( FT_MEM_REALLOC( _pointer_, _current_, _size_ ) ) -#define FT_QALLOC( _pointer_, _size_ ) \ +#define FT_QALLOC( _pointer_, _size_ ) \ FT_MEM_SET_ERROR( FT_MEM_QALLOC( _pointer_, _size_ ) ) -#define FT_QREALLOC( _pointer_, _current_, _size_ ) \ +#define FT_QREALLOC( _pointer_, _current_, _size_ ) \ FT_MEM_SET_ERROR( FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) ) diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c index f856de1d0..7a8829438 100644 --- a/src/base/ftbitmap.c +++ b/src/base/ftbitmap.c @@ -5,7 +5,7 @@ /* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */ /* bitmaps into 8bpp format (body). */ /* */ -/* Copyright 2004, 2005 by */ +/* Copyright 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 4ba53c703..7afd63013 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -267,8 +267,8 @@ ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot, FT_ULong size ) { - FT_Memory memory = FT_FACE_MEMORY( slot->face ); - FT_Error error; + FT_Memory memory = FT_FACE_MEMORY( slot->face ); + FT_Error error; if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) @@ -1724,10 +1724,10 @@ if ( FT_IS_SCALABLE( face ) ) { if ( face->height < 0 ) - face->height = (short)-face->height; + face->height = (FT_Short)-face->height; if ( !FT_HAS_VERTICAL( face ) ) - face->max_advance_height = (short)face->height; + face->max_advance_height = (FT_Short)face->height; } if ( FT_HAS_FIXED_SIZES( face ) ) @@ -1741,9 +1741,9 @@ if ( bsize->height < 0 ) - bsize->height = (FT_Short) -bsize->height; + bsize->height = (FT_Short)-bsize->height; if ( bsize->x_ppem < 0 ) - bsize->x_ppem = (FT_Short) -bsize->x_ppem; + bsize->x_ppem = (FT_Short)-bsize->x_ppem; if ( bsize->y_ppem < 0 ) bsize->y_ppem = -bsize->y_ppem; } @@ -2087,8 +2087,8 @@ metrics = &face->size->metrics; bsize = face->available_sizes + strike_index; - metrics->x_ppem = (FT_UShort)(( bsize->x_ppem + 32 ) >> 6); - metrics->y_ppem = (FT_UShort)(( bsize->y_ppem + 32 ) >> 6); + metrics->x_ppem = (FT_UShort)( ( bsize->x_ppem + 32 ) >> 6 ); + metrics->y_ppem = (FT_UShort)( ( bsize->y_ppem + 32 ) >> 6 ); if ( FT_IS_SCALABLE( face ) ) { @@ -2199,8 +2199,8 @@ scaled_h = FT_MulFix( face->units_per_EM, metrics->y_scale ); } - metrics->x_ppem = (FT_UShort)(( scaled_w + 32 ) >> 6); - metrics->y_ppem = (FT_UShort)(( scaled_h + 32 ) >> 6); + metrics->x_ppem = (FT_UShort)( ( scaled_w + 32 ) >> 6 ); + metrics->y_ppem = (FT_UShort)( ( scaled_h + 32 ) >> 6 ); ft_recompute_scaled_metrics( face, metrics ); } diff --git a/src/base/ftrfork.c b/src/base/ftrfork.c index 3b92247ea..5d44ca456 100644 --- a/src/base/ftrfork.c +++ b/src/base/ftrfork.c @@ -4,7 +4,7 @@ /* */ /* Embedded resource forks accessor (body). */ /* */ -/* Copyright 2004, 2005 by */ +/* Copyright 2004, 2005, 2006 by */ /* Masatake YAMATO and Redhat K.K. */ /* */ /* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */ diff --git a/src/base/ftutil.c b/src/base/ftutil.c index 6ed1db2ce..cb99f88e7 100644 --- a/src/base/ftutil.c +++ b/src/base/ftutil.c @@ -45,6 +45,7 @@ /*************************************************************************/ /*************************************************************************/ + #ifdef FT_STRICT_ALIASING @@ -53,9 +54,10 @@ FT_Long size, FT_Error *p_error ) { - FT_Error error = 0; + FT_Error error = FT_Err_Ok; FT_Pointer block = NULL; + if ( size > 0 ) { block = memory->alloc( memory, size ); @@ -64,6 +66,7 @@ else FT_MEM_ZERO( block, size ); } + *p_error = error; return block; } @@ -74,15 +77,17 @@ FT_Long size, FT_Error *p_error ) { - FT_Error error = 0; + FT_Error error = FT_Err_Ok; FT_Pointer block = NULL; + if ( size > 0 ) { block = memory->alloc( memory, size ); if ( block == NULL ) error = FT_Err_Out_Of_Memory; } + *p_error = error; return block; } @@ -95,8 +100,9 @@ void* block, FT_Error *p_error ) { - FT_Error error = 0; + FT_Error error = FT_Err_Ok; + if ( size <= 0 ) { FT_Free( memory, block ); @@ -112,6 +118,7 @@ { FT_Pointer block2; + block2 = memory->realloc( memory, current, size, block ); if ( block2 == NULL ) error = FT_Err_Out_Of_Memory; @@ -122,6 +129,7 @@ FT_MEM_ZERO( (char*)block + current, size-current ); } } + *p_error = error; return block; } @@ -134,8 +142,9 @@ void* block, FT_Error *p_error ) { - FT_Error error = 0; + FT_Error error = FT_Err_Ok; + if ( size <= 0 ) { FT_Free( memory, block ); @@ -151,15 +160,16 @@ { FT_Pointer block2; + block2 = memory->realloc( memory, current, size, block ); if ( block2 == NULL ) error = FT_Err_Out_Of_Memory; else block = block2; } + *p_error = error; return block; - } FT_BASE_DEF( void ) @@ -170,8 +180,10 @@ memory->free( memory, (void*)P ); } + #else /* !FT_STRICT_ALIASING */ + /* documentation is in ftmemory.h */ FT_BASE_DEF( FT_Error ) diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c index a4e6b1d54..22ec06cb8 100644 --- a/src/cache/ftccache.c +++ b/src/cache/ftccache.c @@ -4,7 +4,7 @@ /* */ /* The FreeType internal cache interface (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/cff/cffload.c b/src/cff/cffload.c index 5556565db..6d73e985d 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -4,7 +4,7 @@ /* */ /* OpenType and CFF data/program tables loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -2293,8 +2293,6 @@ { for ( idx = 0; idx < font->num_subfonts; idx++ ) cff_subfont_done( memory, font->subfonts[idx] ); - - /* FT_FREE( font->subfonts ); -- bug this is a static array !! */ } cff_encoding_done( &font->encoding ); diff --git a/src/gzip/ftgzip.c b/src/gzip/ftgzip.c index bfbcbf9e1..ff0753f78 100644 --- a/src/gzip/ftgzip.c +++ b/src/gzip/ftgzip.c @@ -8,7 +8,7 @@ /* parse compressed PCF fonts, as found with many X11 server */ /* distributions. */ /* */ -/* Copyright 2002, 2003, 2004, 2005 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/otvalid/otvcommn.c b/src/otvalid/otvcommn.c index 293960f34..d94e4f3cb 100644 --- a/src/otvalid/otvcommn.c +++ b/src/otvalid/otvcommn.c @@ -4,7 +4,7 @@ /* */ /* OpenType common tables validation (body). */ /* */ -/* Copyright 2004, 2005 by */ +/* Copyright 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/otvalid/otvgpos.c b/src/otvalid/otvgpos.c index d21d8eae5..ed347053d 100644 --- a/src/otvalid/otvgpos.c +++ b/src/otvalid/otvgpos.c @@ -4,7 +4,7 @@ /* */ /* OpenType GPOS table validation (body). */ /* */ -/* Copyright 2002, 2004, 2005 by */ +/* Copyright 2002, 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c index 127040073..60191e8aa 100644 --- a/src/pfr/pfrobjs.c +++ b/src/pfr/pfrobjs.c @@ -480,7 +480,7 @@ FT_UInt probe = power * size; FT_UInt extra = count - power; FT_Byte* base = stream->cursor; - FT_Bool twobytes = FT_BOOL(item->flags & 1); + FT_Bool twobytes = FT_BOOL( item->flags & 1 ); FT_Byte* p; FT_UInt32 cpair; diff --git a/src/psaux/afmparse.c b/src/psaux/afmparse.c index 27d0c131b..33fbded0e 100644 --- a/src/psaux/afmparse.c +++ b/src/psaux/afmparse.c @@ -397,16 +397,17 @@ { case AFM_VALUE_TYPE_STRING: case AFM_VALUE_TYPE_NAME: - { - FT_Memory memory = parser->memory; - FT_Error error; - - if ( !FT_QALLOC( val->u.s, len + 1 ) ) - { - ft_memcpy( val->u.s, str, len ); - val->u.s[len] = '\0'; - } - } + { + FT_Memory memory = parser->memory; + FT_Error error; + + + if ( !FT_QALLOC( val->u.s, len + 1 ) ) + { + ft_memcpy( val->u.s, str, len ); + val->u.s[len] = '\0'; + } + } break; case AFM_VALUE_TYPE_FIXED: @@ -880,6 +881,7 @@ { AFM_ValueRec shared_vals[1]; + shared_vals[0].type = AFM_VALUE_TYPE_BOOL; if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 ) goto Fail; diff --git a/src/psaux/psconv.c b/src/psaux/psconv.c index 0fb19ee82..90d8e3efe 100644 --- a/src/psaux/psconv.c +++ b/src/psaux/psconv.c @@ -352,10 +352,10 @@ break; if ( r % 2 ) - { + { *buffer = (FT_Byte)(*buffer + c); - buffer++; - } + buffer++; + } else *buffer = (FT_Byte)(c << 4); diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 2d5f79a4b..66196dadf 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -4,7 +4,7 @@ /* */ /* SFNT object management (base). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -51,7 +51,7 @@ FT_String* string; FT_UInt len, code, n; FT_Byte* read = (FT_Byte*)entry->string; - FT_Error error; + FT_Error error; len = (FT_UInt)entry->stringLength / 2; @@ -82,7 +82,7 @@ FT_String* string; FT_UInt len, code, n; FT_Byte* read = (FT_Byte*)entry->string; - FT_Error error; + FT_Error error; len = (FT_UInt)entry->stringLength / 4; @@ -113,7 +113,7 @@ FT_String* string; FT_UInt len, code, n; FT_Byte* read = (FT_Byte*)entry->string; - FT_Error error; + FT_Error error; len = (FT_UInt)entry->stringLength; diff --git a/src/sfnt/ttsbit0.c b/src/sfnt/ttsbit0.c index d1e8b961b..0a8d98b3d 100644 --- a/src/sfnt/ttsbit0.c +++ b/src/sfnt/ttsbit0.c @@ -168,11 +168,11 @@ x_ppem = p[44]; y_ppem = p[45]; - bsize->x_ppem = (FT_Pos)(x_ppem << 6); - bsize->y_ppem = (FT_Pos)(y_ppem << 6); + bsize->x_ppem = (FT_Pos)( x_ppem << 6 ); + bsize->y_ppem = (FT_Pos)( y_ppem << 6 ); /* XXX: Is this correct? */ - bsize->height = (FT_Short)(ascender - descender); + bsize->height = (FT_Short)( ascender - descender ); bsize->width = (FT_Short)( ( avgwidth * y_ppem + em_size / 2 ) / em_size ); @@ -232,9 +232,9 @@ bsize = ( (FT_Face)face )->available_sizes + strike_index; strike = face->sbit_table + 8 + strike_index * 48; - metrics->x_ppem = (FT_UShort)(bsize->x_ppem >> 6); - metrics->y_ppem = (FT_UShort)(bsize->y_ppem >> 6); - metrics->height = (FT_UShort)(bsize->height << 6); + metrics->x_ppem = (FT_UShort)( bsize->x_ppem >> 6 ); + metrics->y_ppem = (FT_UShort)( bsize->y_ppem >> 6 ); + metrics->height = (FT_UShort)( bsize->height << 6 ); metrics->ascender = (FT_Char)strike[16] << 6; /* hori.ascender */ metrics->descender = (FT_Char)strike[17] << 6; /* hori.descender */