ref: a82cd844fb68d14741725946aa43e31490c8468c
parent: a8df54a3ec78c8f2adc26578421f746f78568460
author: Werner Lemberg <[email protected]>
date: Fri Nov 10 17:43:37 EST 2000
Small fixes and formatting.
--- a/builds/cygwin/cygwin-def.in
+++ b/builds/cygwin/cygwin-def.in
@@ -33,13 +33,13 @@
INSTALL_DATA := @INSTALL_DATA@
MKINSTALLDIRS := $(BUILD)/mkinstalldirs
-DISTCLEAN += $(BUILD)/config.cache \
- $(BUILD)/config.log \
- $(BUILD)/config.status \
- $(BUILD)/cygwin-def.mk \
- $(BUILD)/cygwin-cc.mk \
- $(BUILD)/ftconfig.h \
- $(BUILD)/freetype-config \
+DISTCLEAN += $(BUILD)/config.cache \
+ $(BUILD)/config.log \
+ $(BUILD)/config.status \
+ $(BUILD)/cygwin-def.mk \
+ $(BUILD)/cygwin-cc.mk \
+ $(BUILD)/ftconfig.h \
+ $(BUILD)/freetype-config \
$(LIBTOOL)
@@ -70,7 +70,7 @@
# The directory where all library files are placed.
#
-# By default, this is the same as $(OBJ_DIR), however, this can be changed
+# By default, this is the same as $(OBJ_DIR); however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
@@ -77,7 +77,7 @@
# the NO_OUTPUT macro is appended to command lines in order to ignore
-# the output of some programs..
+# the output of some programs.
#
NO_OUTPUT := 2> /dev/null
--- a/builds/cygwin/freetype-config.in
+++ b/builds/cygwin/freetype-config.in
@@ -6,7 +6,7 @@
usage()
{
- cat <<EOF
+ cat <<EOF
Usage: freetype-config [OPTIONS] [LIBRARIES]
Options:
[--prefix[=DIR]]
@@ -15,11 +15,11 @@
[--libs]
[--cflags]
EOF
- exit $1
+ exit $1
}
if test $# -eq 0; then
- usage 1 1>&2
+ usage 1 1>&2
fi
@@ -30,39 +30,40 @@
esac
case $1 in
- --prefix=*)
- prefix=$optarg
- if test $exec_prefix_set = no ; then
- exec_prefix=$optarg
- fi
- ;;
- --prefix)
- echo_prefix=yes
- ;;
- --exec-prefix=*)
- exec_prefix=$optarg
- exec_prefix_set=yes
- ;;
- --exec-prefix)
- echo_exec_prefix=yes
- ;;
- --version)
- echo @VERSION@
- exit 0
- ;;
- --cflags)
- echo_cflags=yes
- ;;
- --libs)
- echo_libs=yes
- ;;
- *)
- usage 1 1>&2
- ;;
+ --prefix=*)
+ prefix=$optarg
+ ;;
+ --prefix)
+ echo_prefix=yes
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ exec_prefix_set=yes
+ ;;
+ --exec-prefix)
+ echo_exec_prefix=yes
+ ;;
+ --version)
+ echo @VERSION@
+ exit 0
+ ;;
+ --cflags)
+ echo_cflags=yes
+ ;;
+ --libs)
+ echo_libs=yes
+ ;;
+ *)
+ usage 1 1>&2
+ ;;
esac
shift
done
+if test "$exec_prefix_set" = "no"; then
+ exec_prefix=$prefix
+fi
+
if test "$echo_prefix" = "yes"; then
echo $prefix
fi
@@ -78,4 +79,4 @@
echo -L@libdir@ $libs
fi
-
+# EOF
--- a/builds/cygwin/install.mk
+++ b/builds/cygwin/install.mk
@@ -19,7 +19,7 @@
$(includedir)/freetype2/freetype/config \
$(includedir)/freetype2/freetype/internal \
$(includedir)/freetype2/freetype/cache \
- $(bindir)
+ $(bindir)
$(LIBTOOL) --mode=install $(INSTALL) $(PROJECT_LIBRARY) $(libdir)
-for P in $(PUBLIC_H) ; do \
$(INSTALL_DATA) $$P $(includedir)/freetype2/freetype ; \
@@ -37,7 +37,7 @@
uninstall:
- -$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/lib$(PROJECT).$A
+ -$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/$(PROJECT_LIBRARY)
-$(DELETE) $(includedir)/freetype2/freetype/cache/*
-$(DELDIR) $(includedir)/freetype2/freetype/cache
-$(DELETE) $(includedir)/freetype2/freetype/config/*
@@ -52,12 +52,12 @@
# Unix cleaning and distclean rules.
#
-clean_project_unix:
+clean_project_cygwin:
-$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S)
-$(DELETE) $(patsubst %.$O,%.$(SO),$(BASE_OBJECTS) $(OBJ_M) $(OBJ_S)) \
$(CLEAN)
-distclean_project_unix: clean_project_unix
+distclean_project_cygwin: clean_project_cygwin
-$(DELETE) $(PROJECT_LIBRARY)
-$(DELETE) $(OBJ_DIR)/.libs/*
-$(DELDIR) $(OBJ_DIR)/.libs
--- a/builds/unix/freetype-config.in
+++ b/builds/unix/freetype-config.in
@@ -6,7 +6,7 @@
usage()
{
- cat <<EOF
+ cat <<EOF
Usage: freetype-config [OPTIONS] [LIBRARIES]
Options:
[--prefix[=DIR]]
@@ -15,11 +15,11 @@
[--libs]
[--cflags]
EOF
- exit $1
+ exit $1
}
if test $# -eq 0; then
- usage 1 1>&2
+ usage 1 1>&2
fi
@@ -30,39 +30,40 @@
esac
case $1 in
- --prefix=*)
- prefix=$optarg
- if test $exec_prefix_set = no ; then
- exec_prefix=$optarg
- fi
- ;;
- --prefix)
- echo_prefix=yes
- ;;
- --exec-prefix=*)
- exec_prefix=$optarg
- exec_prefix_set=yes
- ;;
- --exec-prefix)
- echo_exec_prefix=yes
- ;;
- --version)
- echo @VERSION@
- exit 0
- ;;
- --cflags)
- echo_cflags=yes
- ;;
- --libs)
- echo_libs=yes
- ;;
- *)
- usage 1 1>&2
- ;;
+ --prefix=*)
+ prefix=$optarg
+ ;;
+ --prefix)
+ echo_prefix=yes
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ exec_prefix_set=yes
+ ;;
+ --exec-prefix)
+ echo_exec_prefix=yes
+ ;;
+ --version)
+ echo @VERSION@
+ exit 0
+ ;;
+ --cflags)
+ echo_cflags=yes
+ ;;
+ --libs)
+ echo_libs=yes
+ ;;
+ *)
+ usage 1 1>&2
+ ;;
esac
shift
done
+if test "$exec_prefix_set" = "no"; then
+ exec_prefix=$prefix
+fi
+
if test "$echo_prefix" = "yes"; then
echo $prefix
fi
@@ -78,4 +79,4 @@
echo -L@libdir@ $libs
fi
-
+# EOF
--- a/builds/unix/install.mk
+++ b/builds/unix/install.mk
@@ -19,7 +19,7 @@
$(includedir)/freetype2/freetype/config \
$(includedir)/freetype2/freetype/internal \
$(includedir)/freetype2/freetype/cache \
- $(bindir)
+ $(bindir)
$(LIBTOOL) --mode=install $(INSTALL) $(PROJECT_LIBRARY) $(libdir)
-for P in $(PUBLIC_H) ; do \
$(INSTALL_DATA) $$P $(includedir)/freetype2/freetype ; \
@@ -37,7 +37,7 @@
uninstall:
- -$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/lib$(PROJECT).$A
+ -$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/$(PROJECT_LIBRARY)
-$(DELETE) $(includedir)/freetype2/freetype/cache/*
-$(DELDIR) $(includedir)/freetype2/freetype/cache
-$(DELETE) $(includedir)/freetype2/freetype/config/*
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -33,13 +33,13 @@
INSTALL_DATA := @INSTALL_DATA@
MKINSTALLDIRS := $(BUILD)/mkinstalldirs
-DISTCLEAN += $(BUILD)/config.cache \
- $(BUILD)/config.log \
- $(BUILD)/config.status \
- $(BUILD)/unix-def.mk \
- $(BUILD)/unix-cc.mk \
- $(BUILD)/ftconfig.h \
- $(BUILD)/freetype-config \
+DISTCLEAN += $(BUILD)/config.cache \
+ $(BUILD)/config.log \
+ $(BUILD)/config.status \
+ $(BUILD)/unix-def.mk \
+ $(BUILD)/unix-cc.mk \
+ $(BUILD)/ftconfig.h \
+ $(BUILD)/freetype-config \
$(LIBTOOL)
--- a/include/freetype/cache/ftcchunk.h
+++ b/include/freetype/cache/ftcchunk.h
@@ -177,39 +177,32 @@
/* chunk set objects */
- FT_EXPORT( void )
- FTC_ChunkNode_Destroy( FTC_ChunkNode node );
+ FT_EXPORT( void ) FTC_ChunkNode_Destroy( FTC_ChunkNode node );
- FT_EXPORT( FT_Error )
- FTC_ChunkSet_New( FTC_Chunk_Cache cache,
- FT_Pointer type,
- FTC_ChunkSet *aset );
+ FT_EXPORT( FT_Error ) FTC_ChunkSet_New ( FTC_Chunk_Cache cache,
+ FT_Pointer type,
+ FTC_ChunkSet *aset );
- FT_EXPORT( FT_Error )
- FTC_ChunkSet_Lookup_Node( FTC_ChunkSet cset,
- FT_UInt glyph_index,
- FTC_ChunkNode* anode,
- FT_UInt *anindex );
+ FT_EXPORT( FT_Error ) FTC_ChunkSet_Lookup_Node(
+ FTC_ChunkSet cset,
+ FT_UInt glyph_index,
+ FTC_ChunkNode* anode,
+ FT_UInt *anindex );
/* chunk cache objects */
- FT_EXPORT( FT_Error )
- FTC_Chunk_Cache_Init( FTC_Chunk_Cache cache );
+ FT_EXPORT( FT_Error ) FTC_Chunk_Cache_Init ( FTC_Chunk_Cache cache );
+ FT_EXPORT( void ) FTC_Chunk_Cache_Done ( FTC_Chunk_Cache cache );
- FT_EXPORT( void )
- FTC_Chunk_Cache_Done( FTC_Chunk_Cache cache );
-
-
- FT_EXPORT( FT_Error )
- FTC_Chunk_Cache_Lookup( FTC_Chunk_Cache cache,
- FT_Pointer type,
- FT_UInt gindex,
- FTC_ChunkNode *anode,
- FT_UInt *aindex );
+ FT_EXPORT( FT_Error ) FTC_Chunk_Cache_Lookup( FTC_Chunk_Cache cache,
+ FT_Pointer type,
+ FT_UInt gindex,
+ FTC_ChunkNode *anode,
+ FT_UInt *aindex );
#ifdef __cplusplus
--- a/include/freetype/cache/ftcmanag.h
+++ b/include/freetype/cache/ftcmanag.h
@@ -143,7 +143,7 @@
/* will flush as many old cache nodes as possible (ignoring cache */
/* nodes with a non-zero reference count). */
/* */
- /* <Input> */
+ /* <InOut> */
/* manager :: A handle to the cache manager. */
/* */
/* <Note> */
@@ -212,6 +212,9 @@
/* */
/* cache_data :: A generic pointer passed to the destructor. */
/* */
+ /* <Return> */
+ /* The size of a given cache node in bytes. */
+ /* */
typedef FT_ULong (*FTC_CacheNode_SizeFunc)( FTC_CacheNode node,
FT_Pointer cache_data );
@@ -253,7 +256,6 @@
/* The cache node class doesn't include a `new_node' function because */
/* the cache manager never allocates cache node directly; it */
/* delegates this task to its cache objects. */
- /* */
/* */
typedef struct FTC_CacheNode_Class_
{
--- a/include/freetype/cache/ftlru.h
+++ b/include/freetype/cache/ftlru.h
@@ -79,12 +79,11 @@
} FT_LruNodeRec, *FT_LruNode;
-
/* forward declaration */
typedef struct FT_LruRec_* FT_Lru;
- /* LRU clazz */
+ /* LRU class */
typedef struct FT_Lru_Class_
{
FT_UInt lru_size; /* object size in bytes */
--- a/src/cache/ftcchunk.c
+++ b/src/cache/ftcchunk.c
@@ -173,7 +173,7 @@
FTC_ChunkNode* bucket_limit = bucket + cset->num_chunks;
FT_Memory memory = cache->root.memory;
- FTC_ChunkSet_Class* clazz = cset->clazz;
+ FTC_ChunkSet_Class* clazz = cset->clazz;
/* for each bucket, free the list of glyph nodes */
@@ -183,7 +183,7 @@
FT_ListNode lrunode;
- if (node)
+ if ( node )
{
lrunode = FTC_CHUNKNODE_TO_LRUNODE( node );
@@ -191,15 +191,15 @@
manager->num_nodes--;
FT_List_Remove( glyphs_lru, lrunode );
-
+
clazz->destroy_node( node );
bucket[0] = 0;
}
- }
+ }
- if ( clazz->done )
- clazz->done( cset );
+ if ( clazz->done )
+ clazz->done( cset );
FREE( cset->chunks );
FREE( cset );
@@ -220,6 +220,7 @@
*anode = 0;
+
if ( glyph_index >= cset->element_max )
error = FT_Err_Invalid_Argument;
else
@@ -350,8 +351,7 @@
/*************************************************************************/
- FT_EXPORT_DEF( FT_Error )
- FTC_Chunk_Cache_Init( FTC_Chunk_Cache cache )
+ FT_EXPORT_DEF( FT_Error ) FTC_Chunk_Cache_Init( FTC_Chunk_Cache cache )
{
FT_Memory memory = cache->root.memory;
FT_Error error;
@@ -358,11 +358,12 @@
FTC_Chunk_Cache_Class* ccache_clazz;
+
/* set up root node_class to be used by manager */
cache->root.node_clazz =
(FTC_CacheNode_Class*)&ftc_chunk_cache_node_class;
- /* setup "compare" shortcut */
+ /* setup `compare' shortcut */
ccache_clazz = (FTC_Chunk_Cache_Class*)cache->root.clazz;
cache->compare = ccache_clazz->cset_class->compare;
@@ -376,19 +377,18 @@
}
- FT_EXPORT_DEF( void )
- FTC_Chunk_Cache_Done( FTC_Chunk_Cache cache )
+ FT_EXPORT_DEF( void ) FTC_Chunk_Cache_Done( FTC_Chunk_Cache cache )
{
/* discard glyph sets */
FT_Lru_Done( cache->csets_lru );
}
- FT_EXPORT_DEF( FT_Error )
- FTC_Chunk_Cache_Lookup( FTC_Chunk_Cache cache,
- FT_Pointer type,
- FT_UInt gindex,
- FTC_ChunkNode *anode,
- FT_UInt *aindex )
+
+ FT_EXPORT_DEF( FT_Error ) FTC_Chunk_Cache_Lookup( FTC_Chunk_Cache cache,
+ FT_Pointer type,
+ FT_UInt gindex,
+ FTC_ChunkNode *anode,
+ FT_UInt *aindex )
{
FT_Error error;
FTC_ChunkSet cset;
@@ -435,5 +435,6 @@
Exit:
return error;
}
+
/* END */
--- a/src/cache/ftcglyph.c
+++ b/src/cache/ftcglyph.c
@@ -377,8 +377,7 @@
/*************************************************************************/
- FT_EXPORT_DEF( FT_Error )
- FTC_Glyph_Cache_Init( FTC_Glyph_Cache cache )
+ FT_EXPORT_DEF( FT_Error ) FTC_Glyph_Cache_Init( FTC_Glyph_Cache cache )
{
FT_Memory memory = cache->root.memory;
FT_Error error;
@@ -385,11 +384,12 @@
FTC_Glyph_Cache_Class* gcache_clazz;
+
/* set up root node_class to be used by manager */
cache->root.node_clazz =
(FTC_CacheNode_Class*)&ftc_glyph_cache_node_class;
- /* setup the "compare" shortcut */
+ /* setup the `compare' shortcut */
gcache_clazz = (FTC_Glyph_Cache_Class*)cache->root.clazz;
cache->compare = gcache_clazz->gset_class->compare;
@@ -410,8 +410,7 @@
}
- FT_EXPORT_DEF( void )
- FTC_Glyph_Cache_Done( FTC_Glyph_Cache cache )
+ FT_EXPORT_DEF( void ) FTC_Glyph_Cache_Done( FTC_Glyph_Cache cache )
{
/* discard glyph sets */
FT_Lru_Done( cache->gsets_lru );
@@ -418,11 +417,10 @@
}
- FT_EXPORT_DEF( FT_Error )
- FTC_Glyph_Cache_Lookup( FTC_Glyph_Cache cache,
- FT_Pointer type,
- FT_UInt gindex,
- FTC_GlyphNode *anode )
+ FT_EXPORT_DEF( FT_Error ) FTC_Glyph_Cache_Lookup( FTC_Glyph_Cache cache,
+ FT_Pointer type,
+ FT_UInt gindex,
+ FTC_GlyphNode *anode )
{
FT_Error error;
FTC_GlyphSet gset;
@@ -429,13 +427,15 @@
FTC_GlyphNode node;
FTC_Manager manager;
+
/* check for valid `desc' delayed to FT_Lru_Lookup() */
if ( !cache || !anode )
return FT_Err_Invalid_Argument;
- *anode = 0;
- gset = cache->last_gset;
+ *anode = 0;
+ gset = cache->last_gset;
+
if ( !gset || !cache->compare( gset, type ) )
{
error = FT_Lru_Lookup( cache->gsets_lru,
@@ -464,5 +464,6 @@
Exit:
return error;
}
+
/* END */
--- a/src/cache/ftcimage.c
+++ b/src/cache/ftcimage.c
@@ -73,7 +73,7 @@
FT_CALLBACK_DEF
FT_Error ftc_glyph_image_node_new( FTC_GlyphSet gset,
FT_UInt glyph_index,
- FTC_GlyphImage* anode )
+ FTC_GlyphImage *anode )
{
FT_Memory memory = gset->memory;
FTC_ImageSet imageset = (FTC_ImageSet)gset;
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -94,7 +94,7 @@
FT_CALLBACK_DEF
FT_Error ftc_sbit_chunk_node_new( FTC_ChunkSet cset,
FT_UInt index,
- FTC_ChunkNode* anode )
+ FTC_ChunkNode *anode )
{
FT_Error error;
FT_Memory memory = cset->memory;
@@ -358,9 +358,9 @@
FTC_SBit_Cache *acache )
{
return FTC_Manager_Register_Cache(
- manager,
- (FTC_Cache_Class*)&ftc_sbit_cache_class,
- (FTC_Cache*)acache );
+ manager,
+ (FTC_Cache_Class*)&ftc_sbit_cache_class,
+ (FTC_Cache*)acache );
}
@@ -373,14 +373,15 @@
FTC_ChunkNode node;
FT_UInt cindex;
+
/* argument checks delayed to FTC_Chunk_Cache_Lookup */
- if (!ansbit)
+ if ( !ansbit )
return FT_Err_Invalid_Argument;
*ansbit = 0;
error = FTC_Chunk_Cache_Lookup( &cache->root, desc, gindex,
&node, &cindex );
- if (!error)
+ if ( !error )
*ansbit = (FTC_SBit)node->elements + cindex;
return error;