From f765e4403cae51d2b0f5e603eb3993c05fcb4fda Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 24 Jun 2010 10:34:29 +0200 Subject: [PATCH] */*: Use module specific error names where appropriate. --- ChangeLog | 4 ++++ src/autofit/afpic.c | 18 ++++++++++-------- src/cache/ftcbasic.c | 4 ++-- src/cache/ftccache.c | 6 +++--- src/cache/ftccache.h | 6 +++--- src/cache/ftcmru.h | 4 ++-- src/cache/ftcsbits.c | 6 +++--- src/cff/cffdrivr.c | 2 +- src/cff/cffload.c | 4 ++-- src/cff/cffparse.c | 2 +- src/cff/cffpic.c | 16 +++++++++------- src/cid/cidobjs.c | 4 ++-- src/gxvalid/gxvcommn.c | 4 ++-- src/gzip/ftgzip.c | 6 +++--- src/lzw/ftlzw.c | 2 +- src/pfr/pfrdrivr.c | 4 ++-- src/pfr/pfrgload.c | 4 ++-- src/pfr/pfrload.c | 14 +++++++------- src/pfr/pfrsbit.c | 6 +++--- src/pshinter/pshpic.c | 16 +++++++++------- src/psnames/pspic.c | 14 ++++++++------ src/raster/rastpic.c | 13 +++++++------ src/sfnt/sfdriver.c | 16 ++++++++-------- src/sfnt/sfntpic.c | 13 +++++++------ src/sfnt/ttbdf.c | 16 ++++++++-------- src/sfnt/ttcmap.c | 4 ++-- src/sfnt/ttsbit.c | 5 +++-- src/smooth/ftspic.c | 13 +++++++------ src/truetype/ttgload.c | 2 +- src/truetype/ttpic.c | 14 ++++++++------ 30 files changed, 130 insertions(+), 112 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d320b449..0b62594bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-06-24 Werner Lemberg + + */*: Use module specific error names where appropriate. + 2010-06-24 Werner Lemberg Fix Savannah bug #30236. diff --git a/src/autofit/afpic.c b/src/autofit/afpic.c index 76822c301..5b9aba691 100644 --- a/src/autofit/afpic.c +++ b/src/autofit/afpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for autofit module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,19 +45,21 @@ } } + 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_UInt ss; - FT_Error error = FT_Err_Ok; - AFModulePIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_UInt ss; + FT_Error error = AF_Err_Ok; + AFModulePIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) return error; - FT_MEM_SET( container, 0, sizeof(*container) ); + FT_MEM_SET( container, 0, sizeof ( *container ) ); pic_container->autofit = container; /* initialize pointer table - this is how the module usually expects this data */ diff --git a/src/cache/ftcbasic.c b/src/cache/ftcbasic.c index ebc8871cc..9fb6ddb1e 100644 --- a/src/cache/ftcbasic.c +++ b/src/cache/ftcbasic.c @@ -4,7 +4,7 @@ /* */ /* 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. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -834,7 +834,7 @@ if ( !desc ) - return FT_Err_Invalid_Argument; + return FTC_Err_Invalid_Argument; ftc_image_type_from_old_desc( &type0, desc ); diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c index 463addd99..67affeacb 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, 2006, 2007, 2009 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -485,13 +485,13 @@ FTC_Node* bucket; FTC_Node* pnode; FTC_Node node; - FT_Error error = 0; + FT_Error error = FTC_Err_Ok; FTC_Node_CompareFunc compare = cache->clazz.node_compare; if ( cache == NULL || anode == NULL ) - return FT_Err_Invalid_Argument; + return FTC_Err_Invalid_Argument; idx = hash & cache->mask; if ( idx < cache->p ) diff --git a/src/cache/ftccache.h b/src/cache/ftccache.h index 2082bc4f4..1b695849c 100644 --- a/src/cache/ftccache.h +++ b/src/cache/ftccache.h @@ -4,7 +4,7 @@ /* */ /* 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. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -205,7 +205,7 @@ FT_BEGIN_HEADER FT_UFast _idx; \ \ \ - error = 0; \ + error = FTC_Err_Ok; \ node = NULL; \ _idx = _hash & _cache->mask; \ if ( _idx < _cache->p ) \ @@ -288,7 +288,7 @@ FT_BEGIN_HEADER #define FTC_CACHE_TRYLOOP_END() \ - if ( !error || error != FT_Err_Out_Of_Memory ) \ + if ( !error || error != FTC_Err_Out_Of_Memory ) \ break; \ \ _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \ diff --git a/src/cache/ftcmru.h b/src/cache/ftcmru.h index 5739439f4..8c3797fb0 100644 --- a/src/cache/ftcmru.h +++ b/src/cache/ftcmru.h @@ -4,7 +4,7 @@ /* */ /* 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. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -166,7 +166,7 @@ FT_BEGIN_HEADER FTC_MruNode _first, _node; \ \ \ - error = 0; \ + error = FTC_Err_Ok; \ _first = *(_pfirst); \ _node = NULL; \ \ diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c index 60d46aa7a..07a4641a8 100644 --- a/src/cache/ftcsbits.c +++ b/src/cache/ftcsbits.c @@ -4,7 +4,7 @@ /* */ /* 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. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -191,7 +191,7 @@ sbit->width = 255; sbit->height = 0; sbit->buffer = NULL; - error = 0; + error = FTC_Err_Ok; if ( asize ) *asize = 0; } @@ -218,7 +218,7 @@ total = clazz->family_get_count( family, cache->manager ); if ( total == 0 || gindex >= total ) { - error = FT_Err_Invalid_Argument; + error = FTC_Err_Invalid_Argument; goto Exit; } diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c index 3885eea06..39f04ee1b 100644 --- a/src/cff/cffdrivr.c +++ b/src/cff/cffdrivr.c @@ -322,7 +322,7 @@ PS_FontInfoRec* afont_info ) { 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 ) diff --git a/src/cff/cffload.c b/src/cff/cffload.c index d93a3313b..111fb1ae9 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -251,7 +251,7 @@ if ( offsize < 1 || offsize > 4 ) { - error = FT_Err_Invalid_Table; + error = CFF_Err_Invalid_Table; goto Exit; } @@ -760,7 +760,7 @@ FT_UInt num_glyphs, FT_Memory memory ) { - FT_Error error = FT_Err_Ok; + FT_Error error = CFF_Err_Ok; FT_UInt i; FT_Long j; FT_UShort max_cid = 0; diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c index 659b427ac..0d11a7278 100644 --- a/src/cff/cffparse.c +++ b/src/cff/cffparse.c @@ -707,7 +707,7 @@ clazz[i].count_offset = 0; *output_class = clazz; - return FT_Err_Ok; + return CFF_Err_Ok; } diff --git a/src/cff/cffpic.c b/src/cff/cffpic.c index 568956d6a..5d01bd45e 100644 --- a/src/cff/cffpic.c +++ b/src/cff/cffpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for cff module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -59,18 +59,20 @@ } } + 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_Error error = FT_Err_Ok; - CffModulePIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = CFF_Err_Ok; + CffModulePIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) return error; - FT_MEM_SET( container, 0, sizeof(*container) ); + FT_MEM_SET( container, 0, sizeof ( *container ) ); pic_container->cff = container; /* initialize pointer table - this is how the module usually expects this data */ diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c index 82678af0d..eb8216888 100644 --- a/src/cid/cidobjs.c +++ b/src/cid/cidobjs.c @@ -4,7 +4,7 @@ /* */ /* 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. */ /* */ /* 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 size = (CID_Size)cidsize; - FT_Error error = 0; + FT_Error error = CID_Err_Ok; PSH_Globals_Funcs funcs = cid_size_get_globals_funcs( size ); diff --git a/src/gxvalid/gxvcommn.c b/src/gxvalid/gxvcommn.c index de7ce6fde..211f97201 100644 --- a/src/gxvalid/gxvcommn.c +++ b/src/gxvalid/gxvcommn.c @@ -4,7 +4,7 @@ /* */ /* TrueTypeGX/AAT common tables validation (body). */ /* */ -/* Copyright 2004, 2005, 2009 */ +/* Copyright 2004, 2005, 2009, 2010 */ /* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ @@ -908,7 +908,7 @@ nnames = FT_Get_Sfnt_Name_Count( valid->face ); 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 ; if ( name.name_id == name_index ) diff --git a/src/gzip/ftgzip.c b/src/gzip/ftgzip.c index 6f0c51572..ba2d88322 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, 2006, 2009 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* 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 ) { z_stream* zstream = &zip->zstream; - FT_Error error = 0; + FT_Error error = Gzip_Err_Ok; zip->cursor = zip->buffer; @@ -656,7 +656,7 @@ ft_gzip_file_io( zip, 0, NULL, 0 ); FT_FREE( zip_buff ); } - error = 0; + error = Gzip_Err_Ok; } } diff --git a/src/lzw/ftlzw.c b/src/lzw/ftlzw.c index 6e57dedb9..0b798fe54 100644 --- a/src/lzw/ftlzw.c +++ b/src/lzw/ftlzw.c @@ -171,7 +171,7 @@ { FT_LzwState lzw = &zip->lzw; FT_ULong count; - FT_Error error = 0; + FT_Error error = LZW_Err_Ok; zip->cursor = zip->buffer; diff --git a/src/pfr/pfrdrivr.c b/src/pfr/pfrdrivr.c index 15cca9854..0053050a2 100644 --- a/src/pfr/pfrdrivr.c +++ b/src/pfr/pfrdrivr.c @@ -4,7 +4,7 @@ /* */ /* 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. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -84,7 +84,7 @@ if ( gindex < phys->num_chars ) { *anadvance = phys->chars[gindex].advance; - error = 0; + error = PFR_Err_Ok; } } diff --git a/src/pfr/pfrgload.c b/src/pfr/pfrgload.c index b794722d2..387bde2a6 100644 --- a/src/pfr/pfrgload.c +++ b/src/pfr/pfrgload.c @@ -248,7 +248,7 @@ FT_Byte* p, FT_Byte* limit ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Memory memory = glyph->loader->memory; FT_UInt flags, x_count, y_count, i, count, mask; FT_Int x; @@ -558,7 +558,7 @@ FT_Byte* p, FT_Byte* limit ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_GlyphLoader loader = glyph->loader; FT_Memory memory = loader->memory; PFR_SubGlyph subglyph; diff --git a/src/pfr/pfrload.c b/src/pfr/pfrload.c index bc5c035f3..b63148c5e 100644 --- a/src/pfr/pfrload.c +++ b/src/pfr/pfrload.c @@ -4,7 +4,7 @@ /* */ /* 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. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -49,7 +49,7 @@ PFR_ExtraItem item_list, FT_Pointer item_data ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Byte* p = *pp; FT_UInt num_items, item_type, item_size; @@ -353,7 +353,7 @@ PFR_Strike strike; FT_UInt flags0; FT_UInt n, count, size1; - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; PFR_CHECK( 5 ); @@ -449,7 +449,7 @@ FT_Byte* limit, PFR_PhyFont phy_font ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Memory memory = phy_font->memory; FT_PtrDist len = limit - p; @@ -477,7 +477,7 @@ { FT_UInt count, num_vert, num_horz; FT_Int* snaps; - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Memory memory = phy_font->memory; @@ -521,7 +521,7 @@ PFR_PhyFont phy_font ) { PFR_KernItem item; - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Memory memory = phy_font->memory; @@ -631,7 +631,7 @@ FT_Memory memory, FT_String* *astring ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_String* result = NULL; FT_UInt n, ok; diff --git a/src/pfr/pfrsbit.c b/src/pfr/pfrsbit.c index d2f17dc9c..52bc2c8c3 100644 --- a/src/pfr/pfrsbit.c +++ b/src/pfr/pfrsbit.c @@ -4,7 +4,7 @@ /* */ /* 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. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -353,7 +353,7 @@ FT_Long *aadvance, FT_UInt *aformat ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Byte flags; FT_Char b; FT_Byte* p = *pdata; @@ -484,7 +484,7 @@ FT_Bool decreasing, FT_Bitmap* target ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; PFR_BitWriterRec writer; diff --git a/src/pshinter/pshpic.c b/src/pshinter/pshpic.c index 51a087988..5efb42294 100644 --- a/src/pshinter/pshpic.c +++ b/src/pshinter/pshpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for pshinter module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -38,18 +38,20 @@ } } + 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_Error error = FT_Err_Ok; - PSHinterPIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = PSH_Err_Ok; + PSHinterPIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) return error; - FT_MEM_SET( container, 0, sizeof(*container) ); + FT_MEM_SET( container, 0, sizeof ( *container ) ); pic_container->pshinter = container; /* add call to initialization function when you add new scripts */ diff --git a/src/psnames/pspic.c b/src/psnames/pspic.c index ed7dadda3..b9075d5a5 100644 --- a/src/psnames/pspic.c +++ b/src/psnames/pspic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for psnames module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -44,13 +44,15 @@ } } + 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_Error error = FT_Err_Ok; - PSModulePIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = PSnames_Err_Ok; + PSModulePIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) diff --git a/src/raster/rastpic.c b/src/raster/rastpic.c index 3c264877b..e31c54976 100644 --- a/src/raster/rastpic.c +++ b/src/raster/rastpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for raster module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -43,16 +43,17 @@ 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_Error error = FT_Err_Ok; - RasterPIC* container; - FT_Memory memory = library->memory; + FT_Error error = Raster_Err_Ok; + RasterPIC* container; + FT_Memory memory = library->memory; + /* since this function also serve raster5 renderer, it implements reference counting */ - if(pic_container->raster) + if ( pic_container->raster ) { ((RasterPIC*)pic_container->raster)->ref_count++; return error; diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c index 1097efb86..b74679b31 100644 --- a/src/sfnt/sfdriver.c +++ b/src/sfnt/sfdriver.c @@ -4,7 +4,7 @@ /* */ /* 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. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -362,7 +362,7 @@ *acharset_registry = registry.u.atom; } else - error = FT_Err_Invalid_Argument; + error = SFNT_Err_Invalid_Argument; } } @@ -436,7 +436,7 @@ FT_UNUSED( face_index ); FT_UNUSED( header ); - return FT_Err_Unimplemented_Feature; + return SFNT_Err_Unimplemented_Feature; } @@ -449,7 +449,7 @@ FT_UNUSED( stream ); FT_UNUSED( header ); - return FT_Err_Unimplemented_Feature; + return SFNT_Err_Unimplemented_Feature; } @@ -460,7 +460,7 @@ FT_UNUSED( face ); 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 * 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( input ); - return FT_Err_Unimplemented_Feature; + return SFNT_Err_Unimplemented_Feature; } @@ -545,7 +545,7 @@ FT_UNUSED( face ); FT_UNUSED( cmap ); - return 0; + return SFNT_Err_Ok; } #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ diff --git a/src/sfnt/sfntpic.c b/src/sfnt/sfntpic.c index fd3cf4e92..53aca17b5 100644 --- a/src/sfnt/sfntpic.c +++ b/src/sfnt/sfntpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for sfnt module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -60,15 +60,16 @@ FT_Error sfnt_module_class_pic_init( FT_Library library ) { - FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; - sfntModulePIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = SFNT_Err_Ok; + sfntModulePIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) return error; - FT_MEM_SET( container, 0, sizeof(*container) ); + FT_MEM_SET( container, 0, sizeof ( *container ) ); pic_container->sfnt = container; /* initialize pointer table - this is how the module usually expects this data */ diff --git a/src/sfnt/ttbdf.c b/src/sfnt/ttbdf.c index 206cecee5..18845c39c 100644 --- a/src/sfnt/ttbdf.c +++ b/src/sfnt/ttbdf.c @@ -4,7 +4,7 @@ /* */ /* TrueType and OpenType embedded BDF properties (body). */ /* */ -/* Copyright 2005, 2006 by */ +/* Copyright 2005, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -74,7 +74,7 @@ length < 8 || FT_FRAME_EXTRACT( length, bdf->table ) ) { - error = FT_Err_Invalid_Table; + error = SFNT_Err_Invalid_Table; goto Exit; } @@ -131,7 +131,7 @@ BadTable: FT_FRAME_RELEASE( bdf->table ); FT_ZERO( bdf ); - error = FT_Err_Invalid_Table; + error = SFNT_Err_Invalid_Table; goto Exit; } @@ -143,7 +143,7 @@ { TT_BDF bdf = &face->bdf; FT_Size size = FT_FACE(face)->size; - FT_Error error = 0; + FT_Error error = SFNT_Err_Ok; FT_Byte* p; FT_UInt count; FT_Byte* strike; @@ -163,7 +163,7 @@ p = bdf->table + 8; strike = p + 4 * count; - error = FT_Err_Invalid_Argument; + error = SFNT_Err_Invalid_Argument; if ( size == NULL || property_name == NULL ) goto Exit; @@ -215,7 +215,7 @@ { aprop->type = BDF_PROPERTY_TYPE_ATOM; aprop->u.atom = (const char*)bdf->strings + value; - error = 0; + error = SFNT_Err_Ok; goto Exit; } break; @@ -223,13 +223,13 @@ case 0x02: aprop->type = BDF_PROPERTY_TYPE_INTEGER; aprop->u.integer = (FT_Int32)value; - error = 0; + error = SFNT_Err_Ok; goto Exit; case 0x03: aprop->type = BDF_PROPERTY_TYPE_CARDINAL; aprop->u.cardinal = value; - error = 0; + error = SFNT_Err_Ok; goto Exit; default: diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c index 99e7dec5a..1df682f7b 100644 --- a/src/sfnt/ttcmap.c +++ b/src/sfnt/ttcmap.c @@ -2689,7 +2689,7 @@ FT_Memory memory ) { FT_UInt32 old_max = cmap->max_results; - FT_Error error = 0; + FT_Error error = SFNT_Err_Ok; if ( num_results > cmap->max_results ) @@ -3376,7 +3376,7 @@ clazz[i] = NULL; *output_class = clazz; - return FT_Err_Ok; + return SFNT_Err_Ok; } #endif /*FT_CONFIG_OPTION_PIC*/ diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c index 833bb2add..faa8f88fd 100644 --- a/src/sfnt/ttsbit.c +++ b/src/sfnt/ttsbit.c @@ -4,7 +4,8 @@ /* */ /* 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. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -417,7 +418,7 @@ tt_face_load_eblc( TT_Face face, FT_Stream stream ) { - FT_Error error = 0; + FT_Error error = SFNT_Err_Ok; FT_Memory memory = stream->memory; FT_Fixed version; FT_ULong num_strikes; diff --git a/src/smooth/ftspic.c b/src/smooth/ftspic.c index aa547fceb..7adaab17d 100644 --- a/src/smooth/ftspic.c +++ b/src/smooth/ftspic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for smooth module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -43,12 +43,13 @@ 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_Error error = FT_Err_Ok; - SmoothPIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = Smooth_Err_Ok; + SmoothPIC* container; + FT_Memory memory = library->memory; + /* since this function also serve smooth_lcd and smooth_lcdv renderers, it implements reference counting */ diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 2fc031bc8..a4489b397 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -390,7 +390,7 @@ if ( cont[0] <= prev_cont ) { /* unordered contours: this is invalid */ - error = FT_Err_Invalid_Table; + error = TT_Err_Invalid_Table; goto Fail; } prev_cont = cont[0]; diff --git a/src/truetype/ttpic.c b/src/truetype/ttpic.c index 27ec4a1d5..5d725742c 100644 --- a/src/truetype/ttpic.c +++ b/src/truetype/ttpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for truetype module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,13 +45,15 @@ } } + 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_Error error = FT_Err_Ok; - TTModulePIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = TT_Err_Ok; + TTModulePIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) )