From: Amos Jeffries Date: Sat, 16 Jul 2016 11:13:00 +0000 (+1200) Subject: Fix error: taking the absolute value of unsigned type after rev.14739 X-Git-Tag: SQUID_4_0_13~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3faf51979e8d57b268da951be4ebb2d403829823;p=thirdparty%2Fsquid.git Fix error: taking the absolute value of unsigned type after rev.14739 --- diff --git a/src/store_digest.cc b/src/store_digest.cc index 455cbbae42..d32ed1d1f4 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -318,7 +318,11 @@ storeDigestResize() { const uint64_t cap = storeDigestCalcCap(); assert(store_digest); - uint64_t diff = abs(cap - store_digest->capacity); + uint64_t diff; + if (cap > store_digest->capacity) + diff = cap - store_digest->capacity; + else + diff = store_digest->capacity - cap; debugs(71, 2, store_digest->capacity << " -> " << cap << "; change: " << diff << " (" << xpercentInt(diff, store_digest->capacity) << "%)" ); /* avoid minor adjustments */