From 959956db1d4e5f2e9ecbc3b131a86d50873dd4e9 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 22 Sep 2006 21:00:18 +0000 Subject: The cache may be 64-bit compatable now...maybe... --- src/cache.cpp | 22 +++++++++++----------- src/cache.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/cache.cpp b/src/cache.cpp index 10971b1..acfd368 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -19,24 +19,24 @@ void Cache::serialize( class Serializer &ar ) { if( ar.isLoading() ) { - int sCache, sData, sIndex; + uint32_t sCache, sData, sIndex; ar >> sIndex; StaticString *Index = new StaticString[sIndex]; - for( int i = 0; i < sIndex; i++ ) + for( uint32_t i = 0; i < sIndex; i++ ) { ar >> Index[i]; } ar >> sCache; - int nTmp; - for( int i = 0; i < sCache; i++ ) + uint32_t nTmp; + for( uint32_t i = 0; i < sCache; i++ ) { Entry *e = new Entry; ar >> e->tCreated; ar >> sData; std::list &lData = e->lData; - for( int j = 0; j < sData; j++ ) + for( uint32_t j = 0; j < sData; j++ ) { ar >> nTmp; lData.push_back( Index[nTmp].getString() ); @@ -45,17 +45,17 @@ void Cache::serialize( class Serializer &ar ) mCache[Index[nTmp].getString()] = e; } /* - int sCache, sData; + uint32_t sCache, sData; ar >> sCache; std::string sTmp; - for( int i = 0; i < sCache; i++ ) + for( uint32_t i = 0; i < sCache; i++ ) { Entry *e = new Entry; ar >> e->tCreated; ar >> sData; std::list &lData = e->lData; - for( int j = 0; j < sData; j++ ) + for( uint32_t j = 0; j < sData; j++ ) { ar >> sTmp; lData.push_back( sTmp ); @@ -67,7 +67,7 @@ void Cache::serialize( class Serializer &ar ) } else { - std::map mIndex; + std::map mIndex; for( std::map::iterator i = mCache.begin(); i != mCache.end(); i++ ) { @@ -81,8 +81,8 @@ void Cache::serialize( class Serializer &ar ) } ar << mIndex.size(); - int cnt = 0; - for( std::map::iterator i = mIndex.begin(); + uint32_t cnt = 0; + for( std::map::iterator i = mIndex.begin(); i != mIndex.end(); i++ ) { (*i).second = cnt; diff --git a/src/cache.h b/src/cache.h index 944aa24..16c4782 100644 --- a/src/cache.h +++ b/src/cache.h @@ -19,7 +19,7 @@ public: class Entry { public: - int tCreated; + uint32_t tCreated; std::list lData; }; -- cgit v1.2.3