formatting & small beautification
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
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 );