*/*: Use module specific error names where appropriate.

This commit is contained in:
Werner Lemberg 2010-06-24 10:34:29 +02:00
parent 8b1c34da4c
commit f765e4403c
30 changed files with 130 additions and 112 deletions

View File

@ -1,3 +1,7 @@
2010-06-24 Werner Lemberg <wl@gnu.org>
*/*: Use module specific error names where appropriate.
2010-06-24 Werner Lemberg <wl@gnu.org> 2010-06-24 Werner Lemberg <wl@gnu.org>
Fix Savannah bug #30236. Fix Savannah bug #30236.

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for autofit module. */ /* The FreeType position independent code services for autofit module. */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009, 2010 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -45,19 +45,21 @@
} }
} }
FT_Error FT_Error
autofit_module_class_pic_init( FT_Library library ) autofit_module_class_pic_init( FT_Library library )
{ {
FT_PIC_Container* pic_container = &library->pic_container; FT_PIC_Container* pic_container = &library->pic_container;
FT_UInt ss; FT_UInt ss;
FT_Error error = FT_Err_Ok; FT_Error error = AF_Err_Ok;
AFModulePIC* container; AFModulePIC* container;
FT_Memory memory = library->memory; FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */ /* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) ) if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error; return error;
FT_MEM_SET( container, 0, sizeof(*container) ); FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->autofit = container; pic_container->autofit = container;
/* initialize pointer table - this is how the module usually expects this data */ /* initialize pointer table - this is how the module usually expects this data */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType basic cache interface (body). */ /* The FreeType basic cache interface (body). */
/* */ /* */
/* Copyright 2003, 2004, 2005, 2006, 2007, 2009 by */ /* Copyright 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -834,7 +834,7 @@
if ( !desc ) if ( !desc )
return FT_Err_Invalid_Argument; return FTC_Err_Invalid_Argument;
ftc_image_type_from_old_desc( &type0, desc ); ftc_image_type_from_old_desc( &type0, desc );

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType internal cache interface (body). */ /* The FreeType internal cache interface (body). */
/* */ /* */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ /* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -485,13 +485,13 @@
FTC_Node* bucket; FTC_Node* bucket;
FTC_Node* pnode; FTC_Node* pnode;
FTC_Node node; FTC_Node node;
FT_Error error = 0; FT_Error error = FTC_Err_Ok;
FTC_Node_CompareFunc compare = cache->clazz.node_compare; FTC_Node_CompareFunc compare = cache->clazz.node_compare;
if ( cache == NULL || anode == NULL ) if ( cache == NULL || anode == NULL )
return FT_Err_Invalid_Argument; return FTC_Err_Invalid_Argument;
idx = hash & cache->mask; idx = hash & cache->mask;
if ( idx < cache->p ) if ( idx < cache->p )

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType internal cache interface (specification). */ /* FreeType internal cache interface (specification). */
/* */ /* */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ /* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -205,7 +205,7 @@ FT_BEGIN_HEADER
FT_UFast _idx; \ FT_UFast _idx; \
\ \
\ \
error = 0; \ error = FTC_Err_Ok; \
node = NULL; \ node = NULL; \
_idx = _hash & _cache->mask; \ _idx = _hash & _cache->mask; \
if ( _idx < _cache->p ) \ if ( _idx < _cache->p ) \
@ -288,7 +288,7 @@ FT_BEGIN_HEADER
#define FTC_CACHE_TRYLOOP_END() \ #define FTC_CACHE_TRYLOOP_END() \
if ( !error || error != FT_Err_Out_Of_Memory ) \ if ( !error || error != FTC_Err_Out_Of_Memory ) \
break; \ break; \
\ \
_try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \ _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \

4
src/cache/ftcmru.h vendored
View File

@ -4,7 +4,7 @@
/* */ /* */
/* Simple MRU list-cache (specification). */ /* Simple MRU list-cache (specification). */
/* */ /* */
/* Copyright 2000-2001, 2003, 2004, 2005, 2006 by */ /* Copyright 2000-2001, 2003, 2004, 2005, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -166,7 +166,7 @@ FT_BEGIN_HEADER
FTC_MruNode _first, _node; \ FTC_MruNode _first, _node; \
\ \
\ \
error = 0; \ error = FTC_Err_Ok; \
_first = *(_pfirst); \ _first = *(_pfirst); \
_node = NULL; \ _node = NULL; \
\ \

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType sbits manager (body). */ /* FreeType sbits manager (body). */
/* */ /* */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */ /* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -191,7 +191,7 @@
sbit->width = 255; sbit->width = 255;
sbit->height = 0; sbit->height = 0;
sbit->buffer = NULL; sbit->buffer = NULL;
error = 0; error = FTC_Err_Ok;
if ( asize ) if ( asize )
*asize = 0; *asize = 0;
} }
@ -218,7 +218,7 @@
total = clazz->family_get_count( family, cache->manager ); total = clazz->family_get_count( family, cache->manager );
if ( total == 0 || gindex >= total ) if ( total == 0 || gindex >= total )
{ {
error = FT_Err_Invalid_Argument; error = FTC_Err_Invalid_Argument;
goto Exit; goto Exit;
} }

View File

@ -322,7 +322,7 @@
PS_FontInfoRec* afont_info ) PS_FontInfoRec* afont_info )
{ {
CFF_Font cff = (CFF_Font)face->extra.data; CFF_Font cff = (CFF_Font)face->extra.data;
FT_Error error = FT_Err_Ok; FT_Error error = CFF_Err_Ok;
if ( cff && cff->font_info == NULL ) if ( cff && cff->font_info == NULL )

View File

@ -251,7 +251,7 @@
if ( offsize < 1 || offsize > 4 ) if ( offsize < 1 || offsize > 4 )
{ {
error = FT_Err_Invalid_Table; error = CFF_Err_Invalid_Table;
goto Exit; goto Exit;
} }
@ -760,7 +760,7 @@
FT_UInt num_glyphs, FT_UInt num_glyphs,
FT_Memory memory ) FT_Memory memory )
{ {
FT_Error error = FT_Err_Ok; FT_Error error = CFF_Err_Ok;
FT_UInt i; FT_UInt i;
FT_Long j; FT_Long j;
FT_UShort max_cid = 0; FT_UShort max_cid = 0;

View File

@ -707,7 +707,7 @@
clazz[i].count_offset = 0; clazz[i].count_offset = 0;
*output_class = clazz; *output_class = clazz;
return FT_Err_Ok; return CFF_Err_Ok;
} }

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for cff module. */ /* The FreeType position independent code services for cff module. */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009, 2010 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -59,18 +59,20 @@
} }
} }
FT_Error FT_Error
cff_driver_class_pic_init( FT_Library library ) cff_driver_class_pic_init( FT_Library library )
{ {
FT_PIC_Container* pic_container = &library->pic_container; FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok; FT_Error error = CFF_Err_Ok;
CffModulePIC* container; CffModulePIC* container;
FT_Memory memory = library->memory; FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */ /* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) ) if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error; return error;
FT_MEM_SET( container, 0, sizeof(*container) ); FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->cff = container; pic_container->cff = container;
/* initialize pointer table - this is how the module usually expects this data */ /* initialize pointer table - this is how the module usually expects this data */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* CID objects manager (body). */ /* CID objects manager (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -131,7 +131,7 @@
cid_size_init( FT_Size cidsize ) /* CID_Size */ cid_size_init( FT_Size cidsize ) /* CID_Size */
{ {
CID_Size size = (CID_Size)cidsize; CID_Size size = (CID_Size)cidsize;
FT_Error error = 0; FT_Error error = CID_Err_Ok;
PSH_Globals_Funcs funcs = cid_size_get_globals_funcs( size ); PSH_Globals_Funcs funcs = cid_size_get_globals_funcs( size );

View File

@ -4,7 +4,7 @@
/* */ /* */
/* TrueTypeGX/AAT common tables validation (body). */ /* TrueTypeGX/AAT common tables validation (body). */
/* */ /* */
/* Copyright 2004, 2005, 2009 */ /* Copyright 2004, 2005, 2009, 2010 */
/* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ /* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
@ -908,7 +908,7 @@
nnames = FT_Get_Sfnt_Name_Count( valid->face ); nnames = FT_Get_Sfnt_Name_Count( valid->face );
for ( i = 0; i < nnames; i++ ) for ( i = 0; i < nnames; i++ )
{ {
if ( FT_Get_Sfnt_Name( valid->face, i, &name ) != FT_Err_Ok ) if ( FT_Get_Sfnt_Name( valid->face, i, &name ) != GXV_Err_Ok )
continue ; continue ;
if ( name.name_id == name_index ) if ( name.name_id == name_index )

View File

@ -8,7 +8,7 @@
/* parse compressed PCF fonts, as found with many X11 server */ /* parse compressed PCF fonts, as found with many X11 server */
/* distributions. */ /* distributions. */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2009 by */ /* Copyright 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -390,7 +390,7 @@
ft_gzip_file_fill_output( FT_GZipFile zip ) ft_gzip_file_fill_output( FT_GZipFile zip )
{ {
z_stream* zstream = &zip->zstream; z_stream* zstream = &zip->zstream;
FT_Error error = 0; FT_Error error = Gzip_Err_Ok;
zip->cursor = zip->buffer; zip->cursor = zip->buffer;
@ -656,7 +656,7 @@
ft_gzip_file_io( zip, 0, NULL, 0 ); ft_gzip_file_io( zip, 0, NULL, 0 );
FT_FREE( zip_buff ); FT_FREE( zip_buff );
} }
error = 0; error = Gzip_Err_Ok;
} }
} }

View File

@ -171,7 +171,7 @@
{ {
FT_LzwState lzw = &zip->lzw; FT_LzwState lzw = &zip->lzw;
FT_ULong count; FT_ULong count;
FT_Error error = 0; FT_Error error = LZW_Err_Ok;
zip->cursor = zip->buffer; zip->cursor = zip->buffer;

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType PFR driver interface (body). */ /* FreeType PFR driver interface (body). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2006, 2008 by */ /* Copyright 2002, 2003, 2004, 2006, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -84,7 +84,7 @@
if ( gindex < phys->num_chars ) if ( gindex < phys->num_chars )
{ {
*anadvance = phys->chars[gindex].advance; *anadvance = phys->chars[gindex].advance;
error = 0; error = PFR_Err_Ok;
} }
} }

View File

@ -248,7 +248,7 @@
FT_Byte* p, FT_Byte* p,
FT_Byte* limit ) FT_Byte* limit )
{ {
FT_Error error = 0; FT_Error error = PFR_Err_Ok;
FT_Memory memory = glyph->loader->memory; FT_Memory memory = glyph->loader->memory;
FT_UInt flags, x_count, y_count, i, count, mask; FT_UInt flags, x_count, y_count, i, count, mask;
FT_Int x; FT_Int x;
@ -558,7 +558,7 @@
FT_Byte* p, FT_Byte* p,
FT_Byte* limit ) FT_Byte* limit )
{ {
FT_Error error = 0; FT_Error error = PFR_Err_Ok;
FT_GlyphLoader loader = glyph->loader; FT_GlyphLoader loader = glyph->loader;
FT_Memory memory = loader->memory; FT_Memory memory = loader->memory;
PFR_SubGlyph subglyph; PFR_SubGlyph subglyph;

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType PFR loader (body). */ /* FreeType PFR loader (body). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2005, 2007, 2009 by */ /* Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -49,7 +49,7 @@
PFR_ExtraItem item_list, PFR_ExtraItem item_list,
FT_Pointer item_data ) FT_Pointer item_data )
{ {
FT_Error error = 0; FT_Error error = PFR_Err_Ok;
FT_Byte* p = *pp; FT_Byte* p = *pp;
FT_UInt num_items, item_type, item_size; FT_UInt num_items, item_type, item_size;
@ -353,7 +353,7 @@
PFR_Strike strike; PFR_Strike strike;
FT_UInt flags0; FT_UInt flags0;
FT_UInt n, count, size1; FT_UInt n, count, size1;
FT_Error error = 0; FT_Error error = PFR_Err_Ok;
PFR_CHECK( 5 ); PFR_CHECK( 5 );
@ -449,7 +449,7 @@
FT_Byte* limit, FT_Byte* limit,
PFR_PhyFont phy_font ) PFR_PhyFont phy_font )
{ {
FT_Error error = 0; FT_Error error = PFR_Err_Ok;
FT_Memory memory = phy_font->memory; FT_Memory memory = phy_font->memory;
FT_PtrDist len = limit - p; FT_PtrDist len = limit - p;
@ -477,7 +477,7 @@
{ {
FT_UInt count, num_vert, num_horz; FT_UInt count, num_vert, num_horz;
FT_Int* snaps; FT_Int* snaps;
FT_Error error = 0; FT_Error error = PFR_Err_Ok;
FT_Memory memory = phy_font->memory; FT_Memory memory = phy_font->memory;
@ -521,7 +521,7 @@
PFR_PhyFont phy_font ) PFR_PhyFont phy_font )
{ {
PFR_KernItem item; PFR_KernItem item;
FT_Error error = 0; FT_Error error = PFR_Err_Ok;
FT_Memory memory = phy_font->memory; FT_Memory memory = phy_font->memory;
@ -631,7 +631,7 @@
FT_Memory memory, FT_Memory memory,
FT_String* *astring ) FT_String* *astring )
{ {
FT_Error error = 0; FT_Error error = PFR_Err_Ok;
FT_String* result = NULL; FT_String* result = NULL;
FT_UInt n, ok; FT_UInt n, ok;

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType PFR bitmap loader (body). */ /* FreeType PFR bitmap loader (body). */
/* */ /* */
/* Copyright 2002, 2003, 2006, 2009 by */ /* Copyright 2002, 2003, 2006, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -353,7 +353,7 @@
FT_Long *aadvance, FT_Long *aadvance,
FT_UInt *aformat ) FT_UInt *aformat )
{ {
FT_Error error = 0; FT_Error error = PFR_Err_Ok;
FT_Byte flags; FT_Byte flags;
FT_Char b; FT_Char b;
FT_Byte* p = *pdata; FT_Byte* p = *pdata;
@ -484,7 +484,7 @@
FT_Bool decreasing, FT_Bool decreasing,
FT_Bitmap* target ) FT_Bitmap* target )
{ {
FT_Error error = 0; FT_Error error = PFR_Err_Ok;
PFR_BitWriterRec writer; PFR_BitWriterRec writer;

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for pshinter module. */ /* The FreeType position independent code services for pshinter module. */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009, 2010 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -38,18 +38,20 @@
} }
} }
FT_Error FT_Error
pshinter_module_class_pic_init( FT_Library library ) pshinter_module_class_pic_init( FT_Library library )
{ {
FT_PIC_Container* pic_container = &library->pic_container; FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok; FT_Error error = PSH_Err_Ok;
PSHinterPIC* container; PSHinterPIC* container;
FT_Memory memory = library->memory; FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */ /* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) ) if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error; return error;
FT_MEM_SET( container, 0, sizeof(*container) ); FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->pshinter = container; pic_container->pshinter = container;
/* add call to initialization function when you add new scripts */ /* add call to initialization function when you add new scripts */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for psnames module. */ /* The FreeType position independent code services for psnames module. */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009, 2010 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -44,13 +44,15 @@
} }
} }
FT_Error FT_Error
psnames_module_class_pic_init( FT_Library library ) psnames_module_class_pic_init( FT_Library library )
{ {
FT_PIC_Container* pic_container = &library->pic_container; FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok; FT_Error error = PSnames_Err_Ok;
PSModulePIC* container; PSModulePIC* container;
FT_Memory memory = library->memory; FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */ /* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) ) if ( FT_ALLOC ( container, sizeof ( *container ) ) )

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for raster module. */ /* The FreeType position independent code services for raster module. */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009, 2010 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -43,16 +43,17 @@
FT_Error FT_Error
ft_raster1_renderer_class_pic_init( FT_Library library ) ft_raster1_renderer_class_pic_init( FT_Library library )
{ {
FT_PIC_Container* pic_container = &library->pic_container; FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok; FT_Error error = Raster_Err_Ok;
RasterPIC* container; RasterPIC* container;
FT_Memory memory = library->memory; FT_Memory memory = library->memory;
/* since this function also serve raster5 renderer, /* since this function also serve raster5 renderer,
it implements reference counting */ it implements reference counting */
if(pic_container->raster) if ( pic_container->raster )
{ {
((RasterPIC*)pic_container->raster)->ref_count++; ((RasterPIC*)pic_container->raster)->ref_count++;
return error; return error;

View File

@ -4,7 +4,7 @@
/* */ /* */
/* High-level SFNT driver interface (body). */ /* High-level SFNT driver interface (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -362,7 +362,7 @@
*acharset_registry = registry.u.atom; *acharset_registry = registry.u.atom;
} }
else else
error = FT_Err_Invalid_Argument; error = SFNT_Err_Invalid_Argument;
} }
} }
@ -436,7 +436,7 @@
FT_UNUSED( face_index ); FT_UNUSED( face_index );
FT_UNUSED( header ); FT_UNUSED( header );
return FT_Err_Unimplemented_Feature; return SFNT_Err_Unimplemented_Feature;
} }
@ -449,7 +449,7 @@
FT_UNUSED( stream ); FT_UNUSED( stream );
FT_UNUSED( header ); FT_UNUSED( header );
return FT_Err_Unimplemented_Feature; return SFNT_Err_Unimplemented_Feature;
} }
@ -460,7 +460,7 @@
FT_UNUSED( face ); FT_UNUSED( face );
FT_UNUSED( stream ); FT_UNUSED( stream );
return FT_Err_Unimplemented_Feature; return SFNT_Err_Unimplemented_Feature;
} }
@ -513,7 +513,7 @@
* is only there for some rogue clients which would want to call it * is only there for some rogue clients which would want to call it
* directly (which doesn't make much sense). * directly (which doesn't make much sense).
*/ */
return FT_Err_Unimplemented_Feature; return SFNT_Err_Unimplemented_Feature;
} }
@ -534,7 +534,7 @@
FT_UNUSED( cmap ); FT_UNUSED( cmap );
FT_UNUSED( input ); FT_UNUSED( input );
return FT_Err_Unimplemented_Feature; return SFNT_Err_Unimplemented_Feature;
} }
@ -545,7 +545,7 @@
FT_UNUSED( face ); FT_UNUSED( face );
FT_UNUSED( cmap ); FT_UNUSED( cmap );
return 0; return SFNT_Err_Ok;
} }
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for sfnt module. */ /* The FreeType position independent code services for sfnt module. */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009, 2010 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -60,15 +60,16 @@
FT_Error FT_Error
sfnt_module_class_pic_init( FT_Library library ) sfnt_module_class_pic_init( FT_Library library )
{ {
FT_PIC_Container* pic_container = &library->pic_container; FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok; FT_Error error = SFNT_Err_Ok;
sfntModulePIC* container; sfntModulePIC* container;
FT_Memory memory = library->memory; FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */ /* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) ) if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error; return error;
FT_MEM_SET( container, 0, sizeof(*container) ); FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->sfnt = container; pic_container->sfnt = container;
/* initialize pointer table - this is how the module usually expects this data */ /* initialize pointer table - this is how the module usually expects this data */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* TrueType and OpenType embedded BDF properties (body). */ /* TrueType and OpenType embedded BDF properties (body). */
/* */ /* */
/* Copyright 2005, 2006 by */ /* Copyright 2005, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -74,7 +74,7 @@
length < 8 || length < 8 ||
FT_FRAME_EXTRACT( length, bdf->table ) ) FT_FRAME_EXTRACT( length, bdf->table ) )
{ {
error = FT_Err_Invalid_Table; error = SFNT_Err_Invalid_Table;
goto Exit; goto Exit;
} }
@ -131,7 +131,7 @@
BadTable: BadTable:
FT_FRAME_RELEASE( bdf->table ); FT_FRAME_RELEASE( bdf->table );
FT_ZERO( bdf ); FT_ZERO( bdf );
error = FT_Err_Invalid_Table; error = SFNT_Err_Invalid_Table;
goto Exit; goto Exit;
} }
@ -143,7 +143,7 @@
{ {
TT_BDF bdf = &face->bdf; TT_BDF bdf = &face->bdf;
FT_Size size = FT_FACE(face)->size; FT_Size size = FT_FACE(face)->size;
FT_Error error = 0; FT_Error error = SFNT_Err_Ok;
FT_Byte* p; FT_Byte* p;
FT_UInt count; FT_UInt count;
FT_Byte* strike; FT_Byte* strike;
@ -163,7 +163,7 @@
p = bdf->table + 8; p = bdf->table + 8;
strike = p + 4 * count; strike = p + 4 * count;
error = FT_Err_Invalid_Argument; error = SFNT_Err_Invalid_Argument;
if ( size == NULL || property_name == NULL ) if ( size == NULL || property_name == NULL )
goto Exit; goto Exit;
@ -215,7 +215,7 @@
{ {
aprop->type = BDF_PROPERTY_TYPE_ATOM; aprop->type = BDF_PROPERTY_TYPE_ATOM;
aprop->u.atom = (const char*)bdf->strings + value; aprop->u.atom = (const char*)bdf->strings + value;
error = 0; error = SFNT_Err_Ok;
goto Exit; goto Exit;
} }
break; break;
@ -223,13 +223,13 @@
case 0x02: case 0x02:
aprop->type = BDF_PROPERTY_TYPE_INTEGER; aprop->type = BDF_PROPERTY_TYPE_INTEGER;
aprop->u.integer = (FT_Int32)value; aprop->u.integer = (FT_Int32)value;
error = 0; error = SFNT_Err_Ok;
goto Exit; goto Exit;
case 0x03: case 0x03:
aprop->type = BDF_PROPERTY_TYPE_CARDINAL; aprop->type = BDF_PROPERTY_TYPE_CARDINAL;
aprop->u.cardinal = value; aprop->u.cardinal = value;
error = 0; error = SFNT_Err_Ok;
goto Exit; goto Exit;
default: default:

View File

@ -2689,7 +2689,7 @@
FT_Memory memory ) FT_Memory memory )
{ {
FT_UInt32 old_max = cmap->max_results; FT_UInt32 old_max = cmap->max_results;
FT_Error error = 0; FT_Error error = SFNT_Err_Ok;
if ( num_results > cmap->max_results ) if ( num_results > cmap->max_results )
@ -3376,7 +3376,7 @@
clazz[i] = NULL; clazz[i] = NULL;
*output_class = clazz; *output_class = clazz;
return FT_Err_Ok; return SFNT_Err_Ok;
} }
#endif /*FT_CONFIG_OPTION_PIC*/ #endif /*FT_CONFIG_OPTION_PIC*/

View File

@ -4,7 +4,8 @@
/* */ /* */
/* TrueType and OpenType embedded bitmap support (body). */ /* TrueType and OpenType embedded bitmap support (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -417,7 +418,7 @@
tt_face_load_eblc( TT_Face face, tt_face_load_eblc( TT_Face face,
FT_Stream stream ) FT_Stream stream )
{ {
FT_Error error = 0; FT_Error error = SFNT_Err_Ok;
FT_Memory memory = stream->memory; FT_Memory memory = stream->memory;
FT_Fixed version; FT_Fixed version;
FT_ULong num_strikes; FT_ULong num_strikes;

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for smooth module. */ /* The FreeType position independent code services for smooth module. */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009, 2010 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -43,12 +43,13 @@
FT_Error FT_Error
ft_smooth_renderer_class_pic_init( FT_Library library ) ft_smooth_renderer_class_pic_init( FT_Library library )
{ {
FT_PIC_Container* pic_container = &library->pic_container; FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok; FT_Error error = Smooth_Err_Ok;
SmoothPIC* container; SmoothPIC* container;
FT_Memory memory = library->memory; FT_Memory memory = library->memory;
/* since this function also serve smooth_lcd and smooth_lcdv renderers, /* since this function also serve smooth_lcd and smooth_lcdv renderers,
it implements reference counting */ it implements reference counting */

View File

@ -390,7 +390,7 @@
if ( cont[0] <= prev_cont ) if ( cont[0] <= prev_cont )
{ {
/* unordered contours: this is invalid */ /* unordered contours: this is invalid */
error = FT_Err_Invalid_Table; error = TT_Err_Invalid_Table;
goto Fail; goto Fail;
} }
prev_cont = cont[0]; prev_cont = cont[0];

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType position independent code services for truetype module. */ /* The FreeType position independent code services for truetype module. */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009, 2010 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -45,13 +45,15 @@
} }
} }
FT_Error FT_Error
tt_driver_class_pic_init( FT_Library library ) tt_driver_class_pic_init( FT_Library library )
{ {
FT_PIC_Container* pic_container = &library->pic_container; FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok; FT_Error error = TT_Err_Ok;
TTModulePIC* container; TTModulePIC* container;
FT_Memory memory = library->memory; FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */ /* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) ) if ( FT_ALLOC ( container, sizeof ( *container ) ) )