diff options
Diffstat (limited to '')
-rw-r--r-- | src/cache.cpp | 22 | ||||
-rw-r--r-- | 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 ) | |||
19 | { | 19 | { |
20 | if( ar.isLoading() ) | 20 | if( ar.isLoading() ) |
21 | { | 21 | { |
22 | int sCache, sData, sIndex; | 22 | uint32_t sCache, sData, sIndex; |
23 | 23 | ||
24 | ar >> sIndex; | 24 | ar >> sIndex; |
25 | StaticString *Index = new StaticString[sIndex]; | 25 | StaticString *Index = new StaticString[sIndex]; |
26 | for( int i = 0; i < sIndex; i++ ) | 26 | for( uint32_t i = 0; i < sIndex; i++ ) |
27 | { | 27 | { |
28 | ar >> Index[i]; | 28 | ar >> Index[i]; |
29 | } | 29 | } |
30 | 30 | ||
31 | ar >> sCache; | 31 | ar >> sCache; |
32 | int nTmp; | 32 | uint32_t nTmp; |
33 | for( int i = 0; i < sCache; i++ ) | 33 | for( uint32_t i = 0; i < sCache; i++ ) |
34 | { | 34 | { |
35 | Entry *e = new Entry; | 35 | Entry *e = new Entry; |
36 | ar >> e->tCreated; | 36 | ar >> e->tCreated; |
37 | ar >> sData; | 37 | ar >> sData; |
38 | std::list<std::string> &lData = e->lData; | 38 | std::list<std::string> &lData = e->lData; |
39 | for( int j = 0; j < sData; j++ ) | 39 | for( uint32_t j = 0; j < sData; j++ ) |
40 | { | 40 | { |
41 | ar >> nTmp; | 41 | ar >> nTmp; |
42 | lData.push_back( Index[nTmp].getString() ); | 42 | lData.push_back( Index[nTmp].getString() ); |
@@ -45,17 +45,17 @@ void Cache::serialize( class Serializer &ar ) | |||
45 | mCache[Index[nTmp].getString()] = e; | 45 | mCache[Index[nTmp].getString()] = e; |
46 | } | 46 | } |
47 | /* | 47 | /* |
48 | int sCache, sData; | 48 | uint32_t sCache, sData; |
49 | ar >> sCache; | 49 | ar >> sCache; |
50 | std::string sTmp; | 50 | std::string sTmp; |
51 | 51 | ||
52 | for( int i = 0; i < sCache; i++ ) | 52 | for( uint32_t i = 0; i < sCache; i++ ) |
53 | { | 53 | { |
54 | Entry *e = new Entry; | 54 | Entry *e = new Entry; |
55 | ar >> e->tCreated; | 55 | ar >> e->tCreated; |
56 | ar >> sData; | 56 | ar >> sData; |
57 | std::list<std::string> &lData = e->lData; | 57 | std::list<std::string> &lData = e->lData; |
58 | for( int j = 0; j < sData; j++ ) | 58 | for( uint32_t j = 0; j < sData; j++ ) |
59 | { | 59 | { |
60 | ar >> sTmp; | 60 | ar >> sTmp; |
61 | lData.push_back( sTmp ); | 61 | lData.push_back( sTmp ); |
@@ -67,7 +67,7 @@ void Cache::serialize( class Serializer &ar ) | |||
67 | } | 67 | } |
68 | else | 68 | else |
69 | { | 69 | { |
70 | std::map<std::string, int> mIndex; | 70 | std::map<std::string, uint32_t> mIndex; |
71 | for( std::map<std::string, Entry *>::iterator i = mCache.begin(); | 71 | for( std::map<std::string, Entry *>::iterator i = mCache.begin(); |
72 | i != mCache.end(); i++ ) | 72 | i != mCache.end(); i++ ) |
73 | { | 73 | { |
@@ -81,8 +81,8 @@ void Cache::serialize( class Serializer &ar ) | |||
81 | } | 81 | } |
82 | 82 | ||
83 | ar << mIndex.size(); | 83 | ar << mIndex.size(); |
84 | int cnt = 0; | 84 | uint32_t cnt = 0; |
85 | for( std::map<std::string, int>::iterator i = mIndex.begin(); | 85 | for( std::map<std::string, uint32_t>::iterator i = mIndex.begin(); |
86 | i != mIndex.end(); i++ ) | 86 | i != mIndex.end(); i++ ) |
87 | { | 87 | { |
88 | (*i).second = cnt; | 88 | (*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: | |||
19 | class Entry | 19 | class Entry |
20 | { | 20 | { |
21 | public: | 21 | public: |
22 | int tCreated; | 22 | uint32_t tCreated; |
23 | std::list<std::string> lData; | 23 | std::list<std::string> lData; |
24 | }; | 24 | }; |
25 | 25 | ||