Hash values are unsigned (gets rid of negative numbers in cache.index).

This commit is contained in:
Glenn Maynard
2003-05-22 19:36:54 +00:00
parent 1edc1a325c
commit f65da9e63e
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -39,16 +39,16 @@ void SongCacheIndex::ReadCacheIndex()
CacheIndex.Reset(); CacheIndex.Reset();
} }
void SongCacheIndex::AddCacheIndex(const CString &path, int hash) void SongCacheIndex::AddCacheIndex(const CString &path, unsigned hash)
{ {
CacheIndex.SetValueI( "Cache", "CacheVersion", FILE_CACHE_VERSION ); CacheIndex.SetValueI( "Cache", "CacheVersion", FILE_CACHE_VERSION );
CacheIndex.SetValueI( "Cache", path, hash ); CacheIndex.SetValueU( "Cache", path, hash );
CacheIndex.WriteFile(); CacheIndex.WriteFile();
} }
int SongCacheIndex::GetCacheHash( const CString &path ) unsigned SongCacheIndex::GetCacheHash( const CString &path ) const
{ {
int iDirHash; unsigned iDirHash;
CacheIndex.GetValueI( "Cache", path, iDirHash ); CacheIndex.GetValueU( "Cache", path, iDirHash );
return iDirHash; return iDirHash;
} }
+2 -2
View File
@@ -10,8 +10,8 @@ public:
~SongCacheIndex(); ~SongCacheIndex();
void ReadCacheIndex(); void ReadCacheIndex();
void AddCacheIndex( const CString &path, int hash ); void AddCacheIndex( const CString &path, unsigned hash );
int GetCacheHash( const CString &path ); unsigned GetCacheHash( const CString &path ) const;
}; };
extern SongCacheIndex *SONGINDEX; // global and accessable from anywhere in our program extern SongCacheIndex *SONGINDEX; // global and accessable from anywhere in our program