Various minor clean-ups.

* src/base/ftapi.c: Remove.  Unused.
* src/base/Jamfile (_sources): Updated.

* src/base/ftstream.c (FT_Stream_ReleaseFrame): Remove redundant
code.
This commit is contained in:
Werner Lemberg 2018-08-26 06:39:43 +02:00
parent c98aa9b78a
commit b287c80b6a
6 changed files with 32 additions and 135 deletions

View File

@ -1,4 +1,14 @@
2018-05-25 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com>
2018-08-26 Werner Lemberg <wl@gnu.org>
Various minor clean-ups.
* src/base/ftapi.c: Remove. Unused.
* src/base/Jamfile (_sources): Updated.
* src/base/ftstream.c (FT_Stream_ReleaseFrame): Remove redundant
code.
2018-08-25 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com>
Convert documentation markup to Markdown.

View File

@ -96,13 +96,13 @@ FT_BEGIN_HEADER
/* The structure type must be set in the FT_STRUCTURE macro before */
/* calling the FT_FRAME_START() macro. */
/* */
#define FT_FIELD_SIZE( f ) \
#define FT_FIELD_SIZE( f ) \
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )
#define FT_FIELD_SIZE_DELTA( f ) \
#define FT_FIELD_SIZE_DELTA( f ) \
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
#define FT_FIELD_OFFSET( f ) \
#define FT_FIELD_OFFSET( f ) \
(FT_UShort)( offsetof( FT_STRUCTURE, f ) )
#define FT_FRAME_FIELD( frame_op, field ) \
@ -406,12 +406,14 @@ FT_BEGIN_HEADER
/* Enter a frame of `count' consecutive bytes in a stream. Returns an */
/* error if the frame could not be read/accessed. The caller can use */
/* the `FT_Stream_Get_XXX' functions to retrieve frame data without */
/* the `FT_Stream_GetXXX' functions to retrieve frame data without */
/* error checks. */
/* */
/* You must _always_ call `FT_Stream_ExitFrame' once you have entered */
/* a stream frame! */
/* */
/* Nested frames are not permitted. */
/* */
FT_BASE( FT_Error )
FT_Stream_EnterFrame( FT_Stream stream,
FT_ULong count );
@ -420,14 +422,17 @@ FT_BEGIN_HEADER
FT_BASE( void )
FT_Stream_ExitFrame( FT_Stream stream );
/* Extract a stream frame. If the stream is disk-based, a heap block */
/* is allocated and the frame bytes are read into it. If the stream */
/* is memory-based, this function simply set a pointer to the data. */
/* is memory-based, this function simply sets a pointer to the data. */
/* */
/* Useful to optimize access to memory-based streams transparently. */
/* */
/* All extracted frames must be `freed' with a call to the function */
/* FT_Stream_ReleaseFrame(). */
/* `FT_Stream_GetXXX' functions can't be used. */
/* */
/* An extracted frame must be `freed' with a call to the function */
/* `FT_Stream_ReleaseFrame'. */
/* */
FT_BASE( FT_Error )
FT_Stream_ExtractFrame( FT_Stream stream,
@ -439,6 +444,7 @@ FT_BEGIN_HEADER
FT_Stream_ReleaseFrame( FT_Stream stream,
FT_Byte** pbytes );
/* read a byte from an entered frame */
FT_BASE( FT_Char )
FT_Stream_GetChar( FT_Stream stream );

View File

@ -48,8 +48,7 @@ SubDir FT2_TOP $(FT2_SRC_DIR) base ;
# Add the optional/replaceable files.
#
{
local _sources = ftapi
ftbbox
local _sources = ftbbox
ftbdf
ftbitmap
ftcid

View File

@ -1,121 +0,0 @@
/****************************************************************************
*
* ftapi.c
*
* The FreeType compatibility functions (body).
*
* Copyright 2002-2018 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#include <ft2build.h>
#include FT_LIST_H
#include FT_OUTLINE_H
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_TABLES_H
#include FT_OUTLINE_H
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** ****/
/**** C O M P A T I B I L I T Y ****/
/**** ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* backward compatibility API */
FT_BASE_DEF( void )
FT_New_Memory_Stream( FT_Library library,
FT_Byte* base,
FT_ULong size,
FT_Stream stream )
{
FT_UNUSED( library );
FT_Stream_OpenMemory( stream, base, size );
}
FT_BASE_DEF( FT_Error )
FT_Seek_Stream( FT_Stream stream,
FT_ULong pos )
{
return FT_Stream_Seek( stream, pos );
}
FT_BASE_DEF( FT_Error )
FT_Skip_Stream( FT_Stream stream,
FT_Long distance )
{
return FT_Stream_Skip( stream, distance );
}
FT_BASE_DEF( FT_Error )
FT_Read_Stream( FT_Stream stream,
FT_Byte* buffer,
FT_ULong count )
{
return FT_Stream_Read( stream, buffer, count );
}
FT_BASE_DEF( FT_Error )
FT_Read_Stream_At( FT_Stream stream,
FT_ULong pos,
FT_Byte* buffer,
FT_ULong count )
{
return FT_Stream_ReadAt( stream, pos, buffer, count );
}
FT_BASE_DEF( FT_Error )
FT_Extract_Frame( FT_Stream stream,
FT_ULong count,
FT_Byte** pbytes )
{
return FT_Stream_ExtractFrame( stream, count, pbytes );
}
FT_BASE_DEF( void )
FT_Release_Frame( FT_Stream stream,
FT_Byte** pbytes )
{
FT_Stream_ReleaseFrame( stream, pbytes );
}
FT_BASE_DEF( FT_Error )
FT_Access_Frame( FT_Stream stream,
FT_ULong count )
{
return FT_Stream_EnterFrame( stream, count );
}
FT_BASE_DEF( void )
FT_Forget_Frame( FT_Stream stream )
{
FT_Stream_ExitFrame( stream );
}
/* END */

View File

@ -76,7 +76,7 @@
/* do lazy copying whenever possible */
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
glyph->bitmap = slot->bitmap;
glyph->bitmap = slot->bitmap;
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
else
@ -400,8 +400,8 @@
FT_Get_Glyph( FT_GlyphSlot slot,
FT_Glyph *aglyph )
{
FT_Error error;
FT_Glyph glyph;
FT_Error error;
FT_Glyph glyph;
if ( !slot )

View File

@ -222,11 +222,11 @@
#ifdef FT_DEBUG_MEMORY
ft_mem_free( memory, *pbytes );
*pbytes = NULL;
#else
FT_FREE( *pbytes );
#endif
}
*pbytes = NULL;
}
@ -282,6 +282,7 @@
FT_FREE( stream->base );
error = FT_THROW( Invalid_Stream_Operation );
}
stream->cursor = stream->base;
stream->limit = stream->cursor + count;
stream->pos += read_bytes;
@ -329,6 +330,7 @@
{
FT_Memory memory = stream->memory;
#ifdef FT_DEBUG_MEMORY
ft_mem_free( memory, stream->base );
stream->base = NULL;
@ -336,6 +338,7 @@
FT_FREE( stream->base );
#endif
}
stream->cursor = NULL;
stream->limit = NULL;
}