From 039b9071f31a33070ee8467584adb309a1007e5b Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Mon, 1 Aug 2022 20:19:12 -0400 Subject: [PATCH] [cache] Remove some casts, clean up tracing. * src/cache/ftcbasic.c (FTC_ImageCache_Lookup, FTC_SBitCache_Lookup): Clean up tracing types. * src/cache/ftccache.c (ftc_node_destroy): Ditto. * src/cache/ftcmanag.c (FTC_Manager_Check): Ditto. (FTC_Manager_Check, FTC_Node_Unref): Remove a cast. * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto. --- src/cache/ftcbasic.c | 4 ++-- src/cache/ftccache.c | 2 +- src/cache/ftccmap.c | 2 +- src/cache/ftcmanag.c | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cache/ftcbasic.c b/src/cache/ftcbasic.c index 635b17d07..68ca40efe 100644 --- a/src/cache/ftcbasic.c +++ b/src/cache/ftcbasic.c @@ -320,7 +320,7 @@ #if 0xFFFFFFFFUL > FT_UINT_MAX if ( (type->flags & (FT_ULong)FT_UINT_MAX) ) FT_TRACE1(( "FTC_ImageCache_Lookup:" - " higher bits in load_flags 0x%x are dropped\n", + " higher bits in load_flags 0x%lx are dropped\n", (FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) )); #endif @@ -518,7 +518,7 @@ #if 0xFFFFFFFFUL > FT_UINT_MAX if ( (type->flags & (FT_ULong)FT_UINT_MAX) ) FT_TRACE1(( "FTC_ImageCache_Lookup:" - " higher bits in load_flags 0x%x are dropped\n", + " higher bits in load_flags 0x%lx are dropped\n", (FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) )); #endif diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c index ab4ad2faa..199bf8770 100644 --- a/src/cache/ftccache.c +++ b/src/cache/ftccache.c @@ -307,7 +307,7 @@ #if 0 /* check, just in case of general corruption :-) */ if ( manager->num_nodes == 0 ) - FT_TRACE0(( "ftc_node_destroy: invalid cache node count (%d)\n", + FT_TRACE0(( "ftc_node_destroy: invalid cache node count (%u)\n", manager->num_nodes )); #endif } diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c index 0ee1834e2..8e97a7b57 100644 --- a/src/cache/ftccmap.c +++ b/src/cache/ftccmap.c @@ -295,7 +295,7 @@ if ( error ) goto Exit; - if ( (FT_UInt)cmap_index < (FT_UInt)face->num_charmaps ) + if ( cmap_index < face->num_charmaps ) { FT_CharMap old, cmap = NULL; diff --git a/src/cache/ftcmanag.c b/src/cache/ftcmanag.c index 49f037aa7..6d6b1e03f 100644 --- a/src/cache/ftcmanag.c +++ b/src/cache/ftcmanag.c @@ -488,8 +488,8 @@ FTC_Cache cache = manager->caches[node->cache_index]; - if ( (FT_UInt)node->cache_index >= manager->num_caches ) - FT_TRACE0(( "FTC_Manager_Check: invalid node (cache index = %ld\n", + if ( node->cache_index >= manager->num_caches ) + FT_TRACE0(( "FTC_Manager_Check: invalid node (cache index = %hu\n", node->cache_index )); else weight += cache->clazz.node_weight( node, cache ); @@ -519,7 +519,7 @@ if ( count != manager->num_nodes ) FT_TRACE0(( "FTC_Manager_Check:" - " invalid cache node count %d instead of %d\n", + " invalid cache node count %u instead of %u\n", manager->num_nodes, count )); } } @@ -547,7 +547,7 @@ #ifdef FT_DEBUG_ERROR FTC_Manager_Check( manager ); - FT_TRACE0(( "compressing, weight = %ld, max = %ld, nodes = %d\n", + FT_TRACE0(( "compressing, weight = %ld, max = %ld, nodes = %u\n", manager->cur_weight, manager->max_weight, manager->num_nodes )); #endif @@ -693,9 +693,9 @@ FTC_Node_Unref( FTC_Node node, FTC_Manager manager ) { - if ( node && - manager && - (FT_UInt)node->cache_index < manager->num_caches ) + if ( node && + manager && + node->cache_index < manager->num_caches ) node->ref_count--; }