From 58b17f9647d8b1ecc17f4d8dceceeed8baff123f Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 27 Jul 2000 23:29:08 +0000 Subject: [PATCH] Formatting. --- builds/unix/ftsystem.c | 3 ++- include/freetype/internal/ftobjs.h | 31 +++++++++++++++--------------- src/autohint/ahglyph.c | 12 ++++++------ src/base/ftinit.c | 3 +-- src/base/ftobjs.c | 27 +++++++++++++++----------- src/base/ftsystem.c | 3 ++- src/truetype/ttgload.c | 5 +++-- src/truetype/ttobjs.c | 2 +- 8 files changed, 46 insertions(+), 40 deletions(-) diff --git a/builds/unix/ftsystem.c b/builds/unix/ftsystem.c index cb9ce8bfd..97b342f56 100644 --- a/builds/unix/ftsystem.c +++ b/builds/unix/ftsystem.c @@ -302,6 +302,7 @@ return memory; } + /*************************************************************************/ /* */ /* */ @@ -311,7 +312,7 @@ /* Discards memory manager. */ /* */ /* */ - /* memory :: handle to memory manager */ + /* memory :: A handle to the memory manager. */ /* */ FT_EXPORT_FUNC( void ) FT_Done_Memory( FT_Memory memory ) { diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index 05b8dcfbf..ff7771dda 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -462,22 +462,22 @@ /* */ typedef struct FT_LibraryRec_ { - FT_Memory memory; /* library's memory manager */ + FT_Memory memory; /* library's memory manager */ - FT_Generic generic; + FT_Generic generic; - FT_UInt num_modules; - FT_Module modules[FT_MAX_MODULES]; /* module objects */ + FT_UInt num_modules; + FT_Module modules[FT_MAX_MODULES]; /* module objects */ - FT_ListRec renderers; /* list of renderers */ - FT_Renderer cur_renderer; /* current outline renderer */ - FT_Module auto_hinter; + FT_ListRec renderers; /* list of renderers */ + FT_Renderer cur_renderer; /* current outline renderer */ + FT_Module auto_hinter; - FT_Byte* raster_pool; /* scan-line conversion */ + FT_Byte* raster_pool; /* scan-line conversion */ /* render pool */ - FT_ULong raster_pool_size; /* size of render pool in bytes */ + FT_ULong raster_pool_size; /* size of render pool in bytes */ - FT_DebugHook_Func debug_hooks[4]; + FT_DebugHook_Func debug_hooks[4]; } FT_LibraryRec; @@ -498,21 +498,20 @@ #ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM + FT_EXPORT_DEF( FT_Error ) FT_New_Stream( const char* filepathname, + FT_Stream astream ); - FT_EXPORT_DEF( FT_Error ) FT_New_Stream( const char* filepathname, - FT_Stream astream ); - - FT_EXPORT_DEF( void ) FT_Done_Stream( FT_Stream stream ); + FT_EXPORT_DEF( void ) FT_Done_Stream( FT_Stream stream ); FT_EXPORT_DEF( FT_Memory ) FT_New_Memory( void ); - FT_EXPORT_DEF( void ) FT_Done_Memory( FT_Memory memory ); + FT_EXPORT_DEF( void ) FT_Done_Memory( FT_Memory memory ); #endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */ /* Define default raster's interface. The default raster is located in */ - /* `src/base/ftraster.c' */ + /* `src/base/ftraster.c'. */ /* */ /* Client applications can register new rasters through the */ /* FT_Set_Raster() API. */ diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c index 2037f42b7..bd4dbc8e3 100644 --- a/src/autohint/ahglyph.c +++ b/src/autohint/ahglyph.c @@ -322,13 +322,13 @@ outline->max_contours = new_contours; } - /* then, realloc the points, segments & edges arrays if needed */ - /* note that we reserved two additional point positions, used to */ - /* hint metrics appropriately.. */ - /* */ - if ( num_points+2 > outline->max_points ) + /* then, reallocate the points, segments & edges arrays if needed -- */ + /* note that we reserved two additional point positions, used to */ + /* hint metrics appropriately */ + /* */ + if ( num_points + 2 > outline->max_points ) { - FT_Int news = ( num_points+2 + 7 ) & -8; + FT_Int news = ( num_points + 2 + 7 ) & -8; FT_Int max = outline->max_points; diff --git a/src/base/ftinit.c b/src/base/ftinit.c index cba8f7c02..b953ea17d 100644 --- a/src/base/ftinit.c +++ b/src/base/ftinit.c @@ -169,7 +169,7 @@ const FT_Module_Class* ft_default_modules[] = /* */ FT_EXPORT_FUNC( FT_Error ) FT_Done_FreeType( FT_Library library ) { - if (library) + if ( library ) { FT_Memory memory = library->memory; @@ -185,5 +185,4 @@ const FT_Module_Class* ft_default_modules[] = } - /* END */ diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 3ddd5c7af..7b1d40363 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -263,11 +263,11 @@ error = FT_New_Stream( args->pathname, stream ); stream->pathname.pointer = args->pathname; } - else if ( args->flags & ft_open_stream && args->stream ) + else if ( ( args->flags & ft_open_stream ) && args->stream ) { - /* in this case, we do not need to allocate a new stream */ - /* object. The caller is responsible for closing it himself!! */ - FREE(stream); + /* in this case, we do not need to allocate a new stream object */ + /* since the caller is responsible for closing it himself */ + FREE( stream ); stream = args->stream; } else @@ -302,7 +302,8 @@ static - void ft_done_stream( FT_Stream* astream, FT_Int external ) + void ft_done_stream( FT_Stream* astream, + FT_Int external ) { FT_Stream stream = *astream; @@ -310,9 +311,11 @@ if ( stream->close ) stream->close( stream ); - if (!external) + if ( !external ) { FT_Memory memory = stream->memory; + + FREE( stream ); } *astream = 0; @@ -1151,8 +1154,9 @@ clazz->done_face( face ); /* close the stream for this face if needed */ - ft_done_stream( &face->stream, - (face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM) != 0 ); + ft_done_stream( + &face->stream, + ( face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 ); /* get rid of it */ FREE( face ); @@ -1399,6 +1403,7 @@ FT_ListNode node = 0; FT_Bool external_stream; + /* test for valid `library' and `args' delayed to */ /* ft_new_input_stream() */ @@ -1407,7 +1412,7 @@ *aface = 0; - external_stream = ( args->flags & ft_open_stream && args->stream ); + external_stream = ( ( args->flags & ft_open_stream ) && args->stream ); /* create input stream */ error = ft_new_input_stream( library, args, &stream ); @@ -1662,8 +1667,8 @@ /* close the attached stream */ ft_done_stream( &stream, - (FT_Bool)(parameters->stream && - (parameters->flags & ft_open_stream)) ); + (FT_Bool)( parameters->stream && + ( parameters->flags & ft_open_stream ) ) ); Exit: return error; diff --git a/src/base/ftsystem.c b/src/base/ftsystem.c index 52167b014..859ed06bf 100644 --- a/src/base/ftsystem.c +++ b/src/base/ftsystem.c @@ -305,11 +305,12 @@ /* Discards memory manager. */ /* */ /* */ - /* memory :: handle to memory manager */ + /* memory :: A handle to the memory manager. */ /* */ FT_EXPORT_FUNC( void ) FT_Done_Memory( FT_Memory memory ) { free( memory ); } + /* END */ diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index afdc157f4..9777fe12b 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -538,8 +538,8 @@ TT_GlyphZone* zone = &load->zone; FT_Error error = FT_Err_Ok; + FT_UNUSED( debug ); /* used by truetype interpreter only */ - FT_UNUSED(debug); /* used by truetype interpreter only */ n_ins = load->glyph->control_len; @@ -676,8 +676,9 @@ FT_GlyphLoader* gloader = loader->gloader; FT_Bool opened_frame = 0; - FT_UNUSED(stream); /* used with bytecode interpreter only */ + FT_UNUSED( stream ); /* used with bytecode interpreter only */ + /* check glyph index */ index = glyph_index; if ( index >= (FT_UInt)face->root.num_glyphs ) diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index 01685f22d..b6d82e399 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -730,7 +730,7 @@ driver->context = NULL; } #else - FT_UNUSED(driver); + FT_UNUSED( driver ); #endif }