From: Amos Jeffries Date: Sun, 29 Mar 2015 04:22:08 +0000 (-0700) Subject: Cleanup: Place explicit size on ref-count lock counter X-Git-Tag: merge-candidate-3-v1~197 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b69807cf3bb5abbc062fc9cd7d19f209d1316e4;p=thirdparty%2Fsquid.git Cleanup: Place explicit size on ref-count lock counter This allows us to make explicit calculation of child object sizes in a portable way despite differences in system 'unsigned' size. --- diff --git a/src/base/Lock.h b/src/base/Lock.h index d81d793619..33eb51a3df 100644 --- a/src/base/Lock.h +++ b/src/base/Lock.h @@ -40,7 +40,7 @@ public: /// Clear one lock / reference against this object. /// All locks must be cleared before it may be destroyed. - unsigned unlock() const { + uint32_t unlock() const { #if defined(LOCKCOUNT_DEBUG) old_debug(0,1)("Decrementing this %p from count %u\n",this,count_); #endif @@ -49,10 +49,10 @@ public: } /// Inspect the current count of references. - unsigned LockCount() const { return count_; } + uint32_t LockCount() const { return count_; } private: - mutable unsigned count_; ///< number of references currently being tracked + mutable uint32_t count_; ///< number of references currently being tracked }; // For clarity we provide some aliases for the tracking mechanisms