diff options
author | Werner Lemberg <wl@gnu.org> | 2002-02-22 00:58:04 +0000 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2002-02-22 00:58:04 +0000 |
commit | af8df8503fdd0b3ee91cbd462a97636d8cf49c81 (patch) | |
tree | 918f7b950d7d7108f62d8bb49b67709684de8737 /include/freetype | |
parent | 222cec8c201dfb93aae9e167ead620ea5065cd7b (diff) | |
download | freetype2-af8df8503fdd0b3ee91cbd462a97636d8cf49c81.tar.gz |
* include/freetype/internal/ftdebug.h (FT_Trace): Remove comma in
enum to avoid compiler warnings.
Diffstat (limited to 'include/freetype')
-rw-r--r-- | include/freetype/fterrors.h | 5 | ||||
-rw-r--r-- | include/freetype/internal/ftdebug.h | 34 | ||||
-rw-r--r-- | include/freetype/internal/ftobjs.h | 165 |
3 files changed, 16 insertions, 188 deletions
diff --git a/include/freetype/fterrors.h b/include/freetype/fterrors.h index 85dd658ca..9c8ad41e0 100644 --- a/include/freetype/fterrors.h +++ b/include/freetype/fterrors.h @@ -196,11 +196,6 @@ "invalid argument" ) FT_ERRORDEF_( Unimplemented_Feature, 0x07, \ "unimplemented feature" ) - FT_ERRORDEF_( Invalid_Table, 0x08, \ - "broken table" ) - FT_ERRORDEF_( Invalid_Offset, 0x09, \ - "broken offset within table" ) - /* glyph/character errors */ diff --git a/include/freetype/internal/ftdebug.h b/include/freetype/internal/ftdebug.h index b13aa78ce..3d1100abd 100644 --- a/include/freetype/internal/ftdebug.h +++ b/include/freetype/internal/ftdebug.h @@ -28,11 +28,11 @@ FT_BEGIN_HEADER /* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */ -/* is already defined.. this simplifies the following #ifdefs.. */ +/* is already defined; this simplifies the following #ifdefs */ /* */ #ifdef FT_DEBUG_LEVEL_TRACE -# undef FT_DEBUG_LEVEL_ERROR -# define FT_DEBUG_LEVEL_ERROR +#undef FT_DEBUG_LEVEL_ERROR +#define FT_DEBUG_LEVEL_ERROR #endif @@ -45,26 +45,25 @@ FT_BEGIN_HEADER #ifdef FT_DEBUG_LEVEL_TRACE -# define FT_TRACE_DEF(x) trace_ ## x , +#define FT_TRACE_DEF( x ) trace_ ## x , - /* defining the enums */ + /* defining the enums */ typedef enum { -# include FT_INTERNAL_TRACE_H - trace_count, +#include FT_INTERNAL_TRACE_H + trace_count } FT_Trace; - /* defining the array of trace levels, provided by 'src/base/ftdebug.c' */ - extern int ft_trace_levels [ trace_count ]; + /* defining the array of trace levels, provided by `src/base/ftdebug.c' */ + extern int ft_trace_levels[trace_count]; -# undef FT_TRACE_DEF +#undef FT_TRACE_DEF #endif /* FT_DEBUG_LEVEL_TRACE */ - /*************************************************************************/ /* */ /* Define the FT_TRACE macro */ @@ -78,7 +77,7 @@ FT_BEGIN_HEADER #ifdef FT_DEBUG_LEVEL_TRACE -# define FT_TRACE( level, varformat ) \ +#define FT_TRACE( level, varformat ) \ do \ { \ if ( ft_trace_levels[FT_COMPONENT] >= level ) \ @@ -87,10 +86,11 @@ FT_BEGIN_HEADER #else /* !FT_DEBUG_LEVEL_TRACE */ -# define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */ +#define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */ #endif /* !FT_DEBUG_LEVEL_TRACE */ + /*************************************************************************/ /* */ /* You need two opening resp. closing parentheses! */ @@ -109,7 +109,6 @@ FT_BEGIN_HEADER #define FT_TRACE7( varformat ) FT_TRACE( 7, varformat ) - /*************************************************************************/ /* */ /* Define the FT_ERROR macro */ @@ -118,11 +117,11 @@ FT_BEGIN_HEADER #ifdef FT_DEBUG_LEVEL_ERROR -# define FT_ERROR( varformat ) FT_Message varformat +#define FT_ERROR( varformat ) FT_Message varformat #else /* !FT_DEBUG_LEVEL_ERROR */ -# define FT_ERROR( varformat ) do ; while ( 0 ) /* nothing */ +#define FT_ERROR( varformat ) do ; while ( 0 ) /* nothing */ #endif /* !FT_DEBUG_LEVEL_ERROR */ @@ -145,7 +144,7 @@ FT_BEGIN_HEADER #else /* !FT_DEBUG_LEVEL_ERROR */ -# define FT_ASSERT( condition ) do ; while ( 0 ) +#define FT_ASSERT( condition ) do ; while ( 0 ) #endif /* !FT_DEBUG_LEVEL_ERROR */ @@ -171,7 +170,6 @@ FT_BEGIN_HEADER #endif /* FT_DEBUG_LEVEL_ERROR */ - FT_BASE( void ) ft_debug_init( void ); diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index 43a44d0c7..60eb598f9 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -450,171 +450,6 @@ FT_BEGIN_HEADER /*************************************************************************/ /**** ****/ /**** ****/ - /**** V A L I D A T O R ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - typedef struct FT_ValidatorRec_* FT_Validator; - -/********************************************************************* - * - * there are three distinct validation levels here: - * - * DEFAULT :: - * used to perform normal checks. A table validated with this setting - * is sufficiently correct to be used reliably by FreeType - * - * TIGHT :: - * this is more strict than default. A table validated with this setting - * is sufficiently correct to be used reliablity by FreeType and to not - * contain invalid data (that will not crash FreeType or produce bogus - * warnings). This is used to spot font converter/generation tool - * bugs.. - * - * for example, a CharMap table could map a given character code to - * a glyph index that is larger than the number of available glyphs - * in the font. Such a table would not pass the "TIGHT" validation - * even though it can be used safely with FreeType (which will later - * report errors when trying to load the glyph, for example..) - * - * - * PARANOID :: - * in this mode, everything is checked to the maximum, and according - * to the specification(s) defining the tables being checked. Really - * useful for font fascists and to spot really weird font artefacts. - * - * Beware that most fonts will simply not pass this validation level - * though !! - */ - typedef enum - { - FT_VALIDATE_DEFAULT = 0, - FT_VALIDATE_TIGHT, - FT_VALIDATE_PARANOID - - } FT_ValidationLevel; - - -/********************************************************************** - * - * to use it, you need something like: - * - * valid->error = 0; - * - * if ( setjmp( valid->jump_buffer ) == 0 ) - * validate_table( table_data, .... ); - * - * return valid->error; - * - */ - typedef struct FT_ValidatorRec_ - { - FT_Byte* base; /* address of table in memory */ - FT_Byte* limit; /* base + size of table in bytes */ - - FT_Error error; /* error code. 0 in case of success */ - FT_ValidationLevel level; /* validation level.. */ - FT_UInt num_glyphs; /* if level >= FT_VALIDATE_TIGHT only */ - - jmp_buf jump_buffer; - - } FT_ValidatorRec; - - - /* call this function when an error is detected during validation. this */ - /* will set the error and call 'longjmp' to return to the top-level */ - /* caller of the validation routine.. */ - /* */ - FT_BASE( void ) - ft_validator_error( FT_Validator valid, - FT_Error error ); - - /* this macro assumes that the local variable 'valid' points to the */ - /* current validator structure.. */ -#define FT_INVALID(e) ft_validator_error( valid, e ) - - /* a few "common" errors in font tables */ -#define FT_INVALID_TOO_SHORT FT_INVALID( FT_Err_Invalid_Table ) -#define FT_INVALID_OFFSET FT_INVALID( FT_Err_Invalid_Offset ) -#define FT_INVALID_GLYPH_ID FT_INVALID( FT_Err_Invalid_Table ) - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ - /**** C H A R M A P S ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - /* handle to internal charmap object */ - typedef struct FT_CMapRec_* FT_CMap; - - /* handle to charmap class structure */ - typedef const struct FT_CMap_ClassRec_* FT_CMap_Class; - - - /* internal charmap object structure, sub-class of 'FT_CharMapRec' */ - typedef struct FT_CMapRec_ - { - FT_CharMapRec charmap; - FT_CMap_Class clazz; - FT_Pointer data; /* passed to validate/index/next methods */ - - } FT_CMapRec; - - /* useful macros */ -#define FT_CMAP(x) ((FT_CMap)(x)) -#define FT_CMAP_FACE(x) (FT_CMAP(x)->charmap.face) -#define FT_CMAP_PLATFORM_ID(x) (FT_CMAP(x)->charmap.platform_id) -#define FT_CMAP_ENCODING_ID(x) (FT_CMAP(x)->charmap.encoding_id) -#define FT_CMAP_ENCODING(x) (FT_CMAP(x)->charmap.encoding) - - - /* charmap initializer */ - typedef FT_Error (*FT_CMap_InitFunc)( FT_CMap cmap ); - - /* charmap finalizer */ - typedef void (*FT_CMap_DoneFunc)( FT_CMap cmap ); - - /* charmap validation routine */ - typedef FT_Error (*FT_CMap_ValidateFunc)( FT_Pointer cmap_data, - FT_Validator valid ); - - /* charmap charcode to glyph index mapping function */ - typedef FT_UInt (*FT_CMap_CharIndexFunc)( FT_Pointer cmap_data, - FT_ULong char_code ); - - /* charmap charcode increment function */ - typedef FT_ULong (*FT_CMap_CharNextFunc)( FT_Pointer cmap_data, - FT_ULong char_code, - FT_UInt *agindex ); - - /* charmap class */ - typedef struct FT_CMap_ClassRec_ - { - FT_ULong size; /* size in bytes */ - FT_CMap_InitFunc init; - FT_CMap_DoneFunc done; - FT_CMap_ValidateFunc validate; - FT_CMap_CharIndexFunc char_index; - FT_CMap_CharNextFunc char_next; - - } FT_CMap_ClassRec; - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ /**** R E N D E R E R S ****/ /**** ****/ /**** ****/ |