From b566d42aa0470683634174671ce652f385902a93 Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Sat, 1 Aug 2009 00:30:19 +0900 Subject: [PATCH] cache: Fix some data types mismatching with their sources. --- ChangeLog | 12 ++++++++++++ src/cache/ftccache.c | 10 +++++----- src/cache/ftccache.h | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1bee40148..b9cdd4f65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-07-31 suzuki toshiya + + cache: Fix some data types mismatching with their sources. + + * src/cache/ftccache.c (ftc_cache_resize): The types of + `p', `mask', `count' are matched with FTC_Cache->{p,mask}. + (FTC_Cache_Clear): The type of `old_index' is matched to + FTC_Cache->{p,mask}. + + * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): The type + of `_idx' is matched with FTC_Cache->{p,mask}. + 2009-07-31 suzuki toshiya cache: Fix some data types mismatching with their sources. diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c index 878057c20..116269566 100644 --- a/src/cache/ftccache.c +++ b/src/cache/ftccache.c @@ -93,9 +93,9 @@ for (;;) { FTC_Node node, *pnode; - FT_UInt p = cache->p; - FT_UInt mask = cache->mask; - FT_UInt count = mask + p + 1; /* number of buckets */ + FT_UFast p = cache->p; + FT_UFast mask = cache->mask; + FT_UFast count = mask + p + 1; /* number of buckets */ /* do we need to shrink the buckets array? */ @@ -153,7 +153,7 @@ /* do we need to expand the buckets array? */ else if ( cache->slack > (FT_Long)count * FTC_HASH_SUB_LOAD ) { - FT_UInt old_index = p + mask; + FT_UFast old_index = p + mask; FTC_Node* pold; @@ -347,7 +347,7 @@ { FTC_Manager manager = cache->manager; FT_UFast i; - FT_UInt count; + FT_UFast count; count = cache->p + cache->mask + 1; diff --git a/src/cache/ftccache.h b/src/cache/ftccache.h index be5b24e24..19ac5f7ce 100644 --- a/src/cache/ftccache.h +++ b/src/cache/ftccache.h @@ -202,7 +202,7 @@ FT_BEGIN_HEADER FTC_Cache _cache = FTC_CACHE(cache); \ FT_UInt32 _hash = (FT_UInt32)(hash); \ FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \ - FT_UInt _idx; \ + FT_UFast _idx; \ \ \ error = 0; \