summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2021-09-16 17:03:19 -0400
committerAlexei Podtelezhnikov <apodtele@gmail.com>2021-09-16 17:03:19 -0400
commitfce74b73653a6b871f6165ba289120c29044eb38 (patch)
treec6fa5cd10ae00828c60b5fd0ea3d30c26b01665f
parent79d14cc2563d18eec79f3fe97c6aff989c4b2077 (diff)
downloadfreetype2-fce74b73653a6b871f6165ba289120c29044eb38.tar.gz
[cache] Miscellaneous clean-ups.
* src/cache/ftccache.c (ftc_get_top_node_for_hash, FTC_Cache_Clear): Remove barely used variables. (ftc_cache_add): Adjust casting. * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Remove casting. * src/cache/ftcsbits.c (ftc_snode_load): Remove casting.
-rw-r--r--src/cache/ftccache.c9
-rw-r--r--src/cache/ftccmap.c7
-rw-r--r--src/cache/ftcsbits.c6
3 files changed, 10 insertions, 12 deletions
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index fbca4909d..bae1481d2 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -90,15 +90,14 @@
ftc_get_top_node_for_hash( FTC_Cache cache,
FT_Offset hash )
{
- FTC_Node* pnode;
FT_Offset idx;
idx = hash & cache->mask;
if ( idx < cache->p )
idx = hash & ( 2 * cache->mask + 1 );
- pnode = cache->buckets + idx;
- return pnode;
+
+ return cache->buckets + idx;
}
#endif /* !FTC_INLINE */
@@ -360,7 +359,7 @@
for ( i = 0; i < count; i++ )
{
- FTC_Node *pnode = cache->buckets + i, next, node = *pnode;
+ FTC_Node node = cache->buckets[i], next;
while ( node )
@@ -417,7 +416,7 @@
FTC_Node node )
{
node->hash = hash;
- node->cache_index = (FT_UInt16)cache->index;
+ node->cache_index = (FT_UShort)cache->index;
node->ref_count = 0;
ftc_node_hash_link( node, cache );
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index cfce0a6d3..40b449b9c 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -273,12 +273,11 @@
if ( error )
goto Exit;
- FT_ASSERT( (FT_UInt)( char_code - FTC_CMAP_NODE( node )->first ) <
- FTC_CMAP_INDICES_MAX );
+ FT_ASSERT( char_code - FTC_CMAP_NODE( node )->first <
+ FTC_CMAP_INDICES_MAX );
/* something rotten can happen with rogue clients */
- if ( (FT_UInt)( char_code - FTC_CMAP_NODE( node )->first >=
- FTC_CMAP_INDICES_MAX ) )
+ if ( char_code - FTC_CMAP_NODE( node )->first >= FTC_CMAP_INDICES_MAX )
return 0; /* XXX: should return appropriate error */
gindex = FTC_CMAP_NODE( node )->indices[char_code -
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index 7e24d81d9..362999fce 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -111,7 +111,7 @@
FTC_SFamilyClass clazz;
- if ( (FT_UInt)(gindex - gnode->gindex) >= snode->count )
+ if ( gindex - gnode->gindex >= snode->count )
{
FT_ERROR(( "ftc_snode_load: invalid glyph index" ));
return FT_THROW( Invalid_Argument );
@@ -342,8 +342,8 @@
if (list_changed)
*list_changed = FALSE;
- result = FT_BOOL( gnode->family == gquery->family &&
- (FT_UInt)( gindex - gnode->gindex ) < snode->count );
+ result = FT_BOOL( gnode->family == gquery->family &&
+ gindex - gnode->gindex < snode->count );
if ( result )
{
/* check if we need to load the glyph bitmap now */