fixing some bugs, simplifying other parts of the code

This commit is contained in:
David Turner 2005-09-22 20:47:28 +00:00
parent b260500eac
commit 1abfd22056
6 changed files with 29 additions and 24 deletions

View File

@ -246,7 +246,7 @@ FT_BEGIN_HEADER
_pnode = &_node->link; \
} \
\
if ( _node != *_bucket ) \
if ( 0 && _node != *_bucket ) \
{ \
*_pnode = _node->link; \
_node->link = *_bucket; \
@ -256,7 +256,6 @@ FT_BEGIN_HEADER
{ \
FTC_Manager _manager = _cache->manager; \
\
\
if ( _node != _manager->nodes_list ) \
FTC_MruNode_Up( (FTC_MruNode*)&_manager->nodes_list, \
(FTC_MruNode)_node ); \
@ -265,10 +264,12 @@ FT_BEGIN_HEADER
\
_NewNode: \
error = FTC_Cache_NewNode( _cache, _hash, query, &_node ); \
\
_Ok: \
_pnode = (FTC_Node*)(void*)&(node); \
*_pnode = _node; \
if ( !error ) \
{ \
_Ok: \
_pnode = (FTC_Node*)(void*)&(node); \
*_pnode = _node; \
} \
FT_END_STMNT
#else /* !FTC_INLINE */

View File

@ -253,6 +253,8 @@ FT_BEGIN_HEADER
FT_UInt32 hash,
FTC_GCache cache );
#define FTC_FAMILY_UNREF(f) FTC_Family_Unref( FTC_FAMILY(f) )
typedef struct FTC_GCacheRec_
{
@ -350,7 +352,8 @@ FT_BEGIN_HEADER
FTC_Family* _pfamily = &_gcache->families; \
FTC_Family _family; \
\
error = 0; \
error = 0; \
family = NULL; \
\
for (;;) \
{ \
@ -374,11 +377,13 @@ FT_BEGIN_HEADER
\
_NewFamily: \
error = FTC_GCache_NewFamily( _gcache, hash, _key, &_family ); \
_FoundIt: \
if ( !error ) \
{ \
_FoundIt: \
_family->num_nodes++; \
\
*(FTC_Family*)(void*)(family) = _family; \
_pfamily = (FTC_Family*)(void*)&(family); \
*_pfamily = _family; \
} \
FT_END_STMNT
#else /* !FTC_INLINE */

View File

@ -848,7 +848,7 @@
AF_Direction major_dir = axis->major_dir;
AF_Segment seg1, seg2;
/* now compare each segment to the others */
for ( seg1 = segments; seg1 < segment_limit; seg1++ )
{
@ -1311,6 +1311,8 @@
mode = metrics->root.scaler.render_mode;
hints->other_flags = 0;
/*
* We snap the width of vertical stems for the monochrome and
* horizontal LCD rendering targets only.

12
src/cache/ftcbasic.c vendored
View File

@ -40,7 +40,7 @@
#define FTC_BASIC_FAMILY_HASH(f) \
( FTC_SCALER_HASH( &(f)->scaler ) + 31*(f)->load_flags )
( FTC_SCALER_HASH( &(f)->scaler ) + 7*(f)->load_flags )
FT_CALLBACK_DEF( FT_Bool )
@ -166,7 +166,7 @@
FTC_INode_Free,
FTC_GCacheRec,
FTC_GCache_Init,
FTC_GCache_Done
FTC_GCache_Done
),
FTC_DEFINE_FAMILY_CLASS(
FTC_BasicFamilyRec,
@ -229,7 +229,7 @@
hash = FTC_BASIC_FAMILY_HASH( &key_family );
FTC_GCACHE_GET_FAMILY( cache, ftc_basic_family_equal,
hash, &key_family, &key.family, error );
hash, &key_family, key.family, error );
if ( !error )
{
hash += gindex;
@ -245,7 +245,7 @@
*anode = FTC_NODE_REF( node );
}
FTC_Family_Unref( FTC_FAMILY(key.family) );
FTC_FAMILY_UNREF( key.family );
}
Exit:
@ -332,7 +332,7 @@
hash = FTC_BASIC_FAMILY_HASH( &key_family );
FTC_GCACHE_GET_FAMILY( cache, ftc_basic_family_equal,
hash, &key_family, &key.family, error );
hash, &key_family, key.family, error );
if ( !error )
{
/* beware, the hash must be the same for all glyph ranges */
@ -350,7 +350,7 @@
*anode = FTC_NODE_REF(node);
}
FTC_Family_Unref( FTC_FAMILY(key.family) );
FTC_FAMILY_UNREF( key.family );
}
return error;

View File

@ -378,7 +378,7 @@
FT_UInt32 hash,
FTC_Node node )
{
node->hash = hash;
node->hash = hash;
node->cache_index = (FT_UInt16) cache->index;
node->ref_count = 0;
@ -426,12 +426,7 @@
if ( error )
node = NULL;
else
{
/* don't assume that the cache has the same number of buckets, since
* our allocation request might have triggered global cache flushing
*/
ftc_cache_add( cache, hash, node );
}
*anode = node;
return error;

View File

@ -179,6 +179,8 @@
*pfamily = family->link;
break;
}
pfamily = &(*pfamily)->link;
}
if ( clazz->fam_done )
@ -219,7 +221,7 @@
goto Exit;
}
}
family->link = cache->families;
cache->families = family;
}