Commit 3fb70ba6442ff8193b8acda53b00ffa32581a281

Werner Lemberg 2004-07-19T20:02:35

formatting & small beautification

diff --git a/ChangeLog b/ChangeLog
index 7758698..5ae1a9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,16 +1,24 @@
 2004-07-17  David Turner  <david@freetype.org>
 
-        * include/freetype/cache/ftcglyph.h, src/cache/ftcglyph.c:
-        fixed a dangling pointer bug that happened in very rare cases:
-        i.e. when a new family object was destroyed by an out-of-memory
-        condition during a glyph node initialization. The function
-        FTC_Cache_Lookup would flush the cache and restart the lookup
-        with a bad pointer.
+	Fixed a dangling pointer bug in the cache code that happened in very
+	rare cases, i.e., when a new family object was destroyed by an
+	out-of-memory condition during a glyph node initialization.  The
+	function FTC_Cache_Lookup would flush the cache and restart the
+	lookup with a bad pointer.
 
-        * src/cache/ftcmanag.c: fixed a cache flushing bug
+	* include/freetype/cache/ftcglyph.h (FTC_FAMILY_TREE): New macro.
+	(FTC_GCACHE_LOOKUP_CMP): Use it.
+	Handle reference count in `num_nodes' correctly.
 
-        * src/truetype/ttinterp.c (TT_Normalize): fixed a bug that
-        caused long and unecessary delays when normalizing huge vectors
+	* src/cache/ftcglyph.c (FTC_GNode_UnselectFamily): Use
+	FTC_FAMILY_FREE.
+	(FTC_GCache_Lookup): Handle reference count in `num_nodes' correctly.
+
+	* src/cache/ftcmanag.c (FTC_Manager_FlushN): Fixed a cache flushing
+	bug.
+
+	* src/truetype/ttinterp.c (Normalize): Fixed a bug that caused
+	long and unnecessary delays while normalizing huge vectors.
 
 2004-07-15  Werner Lemberg  <wl@gnu.org>
 
@@ -68,6 +76,11 @@
 
 2004-06-24  David Turner  <david@freetype.org>
 
+
+	* Version 2.1.9 released.
+	=========================
+
+
 	* src/truetype/ttgload.c, src/truetype/ttxgvar.c: Removing
 	compiler warnings.
 
diff --git a/include/freetype/cache/ftcglyph.h b/include/freetype/cache/ftcglyph.h
index 639ab94..3f8301a 100644
--- a/include/freetype/cache/ftcglyph.h
+++ b/include/freetype/cache/ftcglyph.h
@@ -238,7 +238,7 @@ FT_BEGIN_HEADER
 #define FTC_CACHE__GCACHE_CLASS( x ) \
           FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class )
 #define FTC_CACHE__FAMILY_CLASS( x ) \
-          ((FTC_MruListClass) FTC_CACHE__GCACHE_CLASS(x)->family_class)
+          ( (FTC_MruListClass)FTC_CACHE__GCACHE_CLASS( x )->family_class )
 
 
   /* convenience function; use it instead of FTC_Manager_Register_Cache */
@@ -256,9 +256,11 @@ FT_BEGIN_HEADER
 
 
   /* */
-#define  FTC_FAMILY_FREE(family,cache)                          \
-           FTC_MruList_Remove( &FTC_GCACHE((cache))->families,  \
-                               (FTC_MruNode)(family) )
+
+
+#define FTC_FAMILY_FREE( family, cache )                      \
+          FTC_MruList_Remove( &FTC_GCACHE((cache))->families, \
+                              (FTC_MruNode)(family) )
 
 
 #ifdef FTC_INLINE
@@ -279,6 +281,7 @@ FT_BEGIN_HEADER
     {                                                                       \
       FTC_Family  _gqfamily = _gquery->family;                              \
                                                                             \
+                                                                            \
       _gqfamily->num_nodes++;                                               \
                                                                             \
       FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error );     \
diff --git a/src/cache/ftcglyph.c b/src/cache/ftcglyph.c
index c5c9e70..d524c9c 100644
--- a/src/cache/ftcglyph.c
+++ b/src/cache/ftcglyph.c
@@ -27,7 +27,6 @@
 #include "ftcerror.h"
 
 
-
   /* create a new chunk node, setting its cache index and ref count */
   FT_EXPORT_DEF( void )
   FTC_GNode_Init( FTC_GNode   gnode,
@@ -183,9 +182,9 @@
     {
       FTC_Family  family = query->family;
 
-     /* prevent the family from being destroyed too early when an out-of-memory
-      * condition occurs during glyph node initialization.
-      */
+
+      /* prevent the family from being destroyed too early when an        */
+      /* out-of-memory condition occurs during glyph node initialization. */
       family->num_nodes++;
 
       error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, anode );