Formatting.

This commit is contained in:
Werner Lemberg 2000-07-27 23:29:08 +00:00
parent b169341e48
commit 58b17f9647
8 changed files with 46 additions and 40 deletions

View File

@ -302,6 +302,7 @@
return memory; return memory;
} }
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
@ -311,7 +312,7 @@
/* Discards memory manager. */ /* Discards memory manager. */
/* */ /* */
/* <Input> */ /* <Input> */
/* memory :: handle to memory manager */ /* memory :: A handle to the memory manager. */
/* */ /* */
FT_EXPORT_FUNC( void ) FT_Done_Memory( FT_Memory memory ) FT_EXPORT_FUNC( void ) FT_Done_Memory( FT_Memory memory )
{ {

View File

@ -462,22 +462,22 @@
/* */ /* */
typedef struct FT_LibraryRec_ 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_UInt num_modules;
FT_Module modules[FT_MAX_MODULES]; /* module objects */ FT_Module modules[FT_MAX_MODULES]; /* module objects */
FT_ListRec renderers; /* list of renderers */ FT_ListRec renderers; /* list of renderers */
FT_Renderer cur_renderer; /* current outline renderer */ FT_Renderer cur_renderer; /* current outline renderer */
FT_Module auto_hinter; FT_Module auto_hinter;
FT_Byte* raster_pool; /* scan-line conversion */ FT_Byte* raster_pool; /* scan-line conversion */
/* render pool */ /* 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; } FT_LibraryRec;
@ -498,21 +498,20 @@
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM #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_EXPORT_DEF( void ) FT_Done_Stream( FT_Stream stream );
FT_Stream astream );
FT_EXPORT_DEF( void ) FT_Done_Stream( FT_Stream stream );
FT_EXPORT_DEF( FT_Memory ) FT_New_Memory( void ); 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 */ #endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
/* Define default raster's interface. The default raster is located in */ /* 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 */ /* Client applications can register new rasters through the */
/* FT_Set_Raster() API. */ /* FT_Set_Raster() API. */

View File

@ -322,13 +322,13 @@
outline->max_contours = new_contours; outline->max_contours = new_contours;
} }
/* then, realloc the points, segments & edges arrays if needed */ /* then, reallocate the points, segments & edges arrays if needed -- */
/* note that we reserved two additional point positions, used to */ /* note that we reserved two additional point positions, used to */
/* hint metrics appropriately.. */ /* hint metrics appropriately */
/* */ /* */
if ( num_points+2 > outline->max_points ) 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; FT_Int max = outline->max_points;

View File

@ -169,7 +169,7 @@ const FT_Module_Class* ft_default_modules[] =
/* */ /* */
FT_EXPORT_FUNC( FT_Error ) FT_Done_FreeType( FT_Library library ) FT_EXPORT_FUNC( FT_Error ) FT_Done_FreeType( FT_Library library )
{ {
if (library) if ( library )
{ {
FT_Memory memory = library->memory; FT_Memory memory = library->memory;
@ -185,5 +185,4 @@ const FT_Module_Class* ft_default_modules[] =
} }
/* END */ /* END */

View File

@ -263,11 +263,11 @@
error = FT_New_Stream( args->pathname, stream ); error = FT_New_Stream( args->pathname, stream );
stream->pathname.pointer = args->pathname; 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 */ /* in this case, we do not need to allocate a new stream object */
/* object. The caller is responsible for closing it himself!! */ /* since the caller is responsible for closing it himself */
FREE(stream); FREE( stream );
stream = args->stream; stream = args->stream;
} }
else else
@ -302,7 +302,8 @@
static 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; FT_Stream stream = *astream;
@ -310,9 +311,11 @@
if ( stream->close ) if ( stream->close )
stream->close( stream ); stream->close( stream );
if (!external) if ( !external )
{ {
FT_Memory memory = stream->memory; FT_Memory memory = stream->memory;
FREE( stream ); FREE( stream );
} }
*astream = 0; *astream = 0;
@ -1151,8 +1154,9 @@
clazz->done_face( face ); clazz->done_face( face );
/* close the stream for this face if needed */ /* close the stream for this face if needed */
ft_done_stream( &face->stream, ft_done_stream(
(face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM) != 0 ); &face->stream,
( face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 );
/* get rid of it */ /* get rid of it */
FREE( face ); FREE( face );
@ -1399,6 +1403,7 @@
FT_ListNode node = 0; FT_ListNode node = 0;
FT_Bool external_stream; FT_Bool external_stream;
/* test for valid `library' and `args' delayed to */ /* test for valid `library' and `args' delayed to */
/* ft_new_input_stream() */ /* ft_new_input_stream() */
@ -1407,7 +1412,7 @@
*aface = 0; *aface = 0;
external_stream = ( args->flags & ft_open_stream && args->stream ); external_stream = ( ( args->flags & ft_open_stream ) && args->stream );
/* create input stream */ /* create input stream */
error = ft_new_input_stream( library, args, &stream ); error = ft_new_input_stream( library, args, &stream );
@ -1662,8 +1667,8 @@
/* close the attached stream */ /* close the attached stream */
ft_done_stream( &stream, ft_done_stream( &stream,
(FT_Bool)(parameters->stream && (FT_Bool)( parameters->stream &&
(parameters->flags & ft_open_stream)) ); ( parameters->flags & ft_open_stream ) ) );
Exit: Exit:
return error; return error;

View File

@ -305,11 +305,12 @@
/* Discards memory manager. */ /* Discards memory manager. */
/* */ /* */
/* <Input> */ /* <Input> */
/* memory :: handle to memory manager */ /* memory :: A handle to the memory manager. */
/* */ /* */
FT_EXPORT_FUNC( void ) FT_Done_Memory( FT_Memory memory ) FT_EXPORT_FUNC( void ) FT_Done_Memory( FT_Memory memory )
{ {
free( memory ); free( memory );
} }
/* END */ /* END */

View File

@ -538,8 +538,8 @@
TT_GlyphZone* zone = &load->zone; TT_GlyphZone* zone = &load->zone;
FT_Error error = FT_Err_Ok; 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; n_ins = load->glyph->control_len;
@ -676,8 +676,9 @@
FT_GlyphLoader* gloader = loader->gloader; FT_GlyphLoader* gloader = loader->gloader;
FT_Bool opened_frame = 0; FT_Bool opened_frame = 0;
FT_UNUSED(stream); /* used with bytecode interpreter only */ FT_UNUSED( stream ); /* used with bytecode interpreter only */
/* check glyph index */ /* check glyph index */
index = glyph_index; index = glyph_index;
if ( index >= (FT_UInt)face->root.num_glyphs ) if ( index >= (FT_UInt)face->root.num_glyphs )

View File

@ -730,7 +730,7 @@
driver->context = NULL; driver->context = NULL;
} }
#else #else
FT_UNUSED(driver); FT_UNUSED( driver );
#endif #endif
} }