From d43af5161421dc38eb7b38e49ec66608866b2cce Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 21 Nov 2006 20:40:14 +0000 Subject: Nooow everything in the lib is clean with -Wall, hash was a template and didn't complain until I ran the tests. The tests will be fixed next. --- src/hash.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/hash.h b/src/hash.h index 71abff5..dcf65ae 100644 --- a/src/hash.h +++ b/src/hash.h @@ -58,10 +58,10 @@ private: Hash &hsh; key *pKey; + uint32_t nPos; _value *pValue; - bool bFilled; uint32_t hash; - uint32_t nPos; + bool bFilled; public: operator _value() @@ -121,6 +121,7 @@ public: nFilled( 0 ), nDeleted( 0 ), bFilled( NULL ), + bDeleted( NULL ), aKeys( NULL ), aValues( NULL ), aHashCodes( NULL ) @@ -249,9 +250,8 @@ public: bool has( key k ) { - uint32_t hash = __calcHashCode( k ); bool bFill; - uint32_t nPos = probe( hash, k, bFill ); + probe( __calcHashCode( k ), k, bFill ); return bFill; } @@ -262,8 +262,8 @@ public: private: iterator( Hash &hsh ) : hsh( hsh ), - bFinished( false ), - nPos( 0 ) + nPos( 0 ), + bFinished( false ) { nPos = hsh.getFirstPos( bFinished ); } @@ -276,7 +276,6 @@ public: } Hash &hsh; - uint32_t nPos; bool bFinished; @@ -374,6 +373,7 @@ private: } bFinished = true; + return 0; } uint32_t getNextPos( uint32_t nPos, bool &bFinished ) @@ -386,6 +386,7 @@ private: } bFinished = true; + return 0; } uint32_t probe( uint32_t hash, key k, bool &bFill, bool rehash=true ) @@ -496,10 +497,10 @@ private: uint32_t nDeleted; uint32_t *bFilled; uint32_t *bDeleted; - uint32_t *aHashCodes; uint32_t nKeysSize; - value *aValues; key *aKeys; + value *aValues; + uint32_t *aHashCodes; valuealloc va; keyalloc ka; challoc ca; -- cgit v1.2.3