shithub: freetype+ttf2subf

Download patch

ref: f47d5f0b39f130c3d9d297f64fef2ef3a5635349
parent: 08b7ad4418df8c81f0822c5f1edb6332cfa046a8
author: David Turner <[email protected]>
date: Fri Jun 7 18:09:20 EDT 2002

debugging new cache hash table implementation

git/fs: mount .git/fs: mount/attach disallowed
--- a/include/freetype/cache/ftccache.h
+++ b/include/freetype/cache/ftccache.h
@@ -24,7 +24,7 @@
 #undef   FTC_CACHE_USE_INLINE
 
 /* define to use linear hash table */
-#undef   FTC_CACHE_USE_LINEAR_HASHING
+#define  FTC_CACHE_USE_LINEAR_HASHING
 
 FT_BEGIN_HEADER
 
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -257,8 +257,8 @@
   /*                                                                       */
   /*   Don't define any of these macros to compile in `release' mode!      */
   /*                                                                       */
-#undef  FT_DEBUG_LEVEL_ERROR
-#undef  FT_DEBUG_LEVEL_TRACE
+#define FT_DEBUG_LEVEL_ERROR
+#define FT_DEBUG_LEVEL_TRACE
 
 
   /*************************************************************************/
@@ -273,7 +273,7 @@
   /*   Note that the memory debugger is only activated at runtime when     */
   /*   when the _environment_ variable "FT_DEBUG_MEMORY" is also defined!  */
   /*                                                                       */
-#undef  FT_DEBUG_MEMORY
+#define FT_DEBUG_MEMORY
 
 
   /*************************************************************************/
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -84,6 +84,8 @@
     }
     else
     {
+      FT_ASSERT( manager->num_nodes == 0 );
+
       node->mru_next = node;
       node->mru_prev = node;
     }
@@ -98,21 +100,23 @@
   ftc_node_mru_unlink( FTC_Node     node,
                        FTC_Manager  manager )
   {
+    FTC_Node  first = manager->nodes_list;
     FTC_Node  prev  = node->mru_prev;
     FTC_Node  next  = node->mru_next;
-    FTC_Node  first = manager->nodes_list;
 
+    FT_ASSERT( first != NULL && manager->num_nodes > 0 );
+    FT_ASSERT( next->mru_prev == node );
+    FT_ASSERT( prev->mru_next == node );
 
-    prev->mru_next = next;
     next->mru_prev = prev;
+    prev->mru_next = next;
 
-    if ( node->mru_next == first )
+    if ( node == first )
     {
-      /* this is the last node in the list; update its head pointer */
-      if ( node == first )
+      if ( node == next )
         manager->nodes_list = NULL;
       else
-        first->mru_prev = prev;
+        manager->nodes_list = next;
     }
 
     node->mru_next = NULL;
@@ -848,7 +852,7 @@
             goto Exit;
           }
 
-          pnode = &(*pnode)->link;
+          pnode = &node->link;
         }
       }
 
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -348,6 +348,8 @@
       FT_UInt  offset = (FT_UInt)( char_code - node->first );
 
 
+      FT_ASSERT( offset < FTC_CMAP_INDICES_MAX );
+
       gindex = node->indices[offset];
       if ( gindex == FTC_CMAP_UNKNOWN )
       {
--- a/src/type42/rules.mk
+++ b/src/type42/rules.mk
@@ -45,7 +45,7 @@
 
 # Type42 driver source file for single build
 #
-T42_DRV_SRC_S := $(T42_DIR_)t42drivr.c
+T42_DRV_SRC_S := $(T42_DIR_)type42.c
 
 
 # Type42 driver - single object