From f65da9e63e0630cb9582f6901a27bddc3a57dc00 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 22 May 2003 19:36:54 +0000 Subject: [PATCH] Hash values are unsigned (gets rid of negative numbers in cache.index). --- stepmania/src/SongCacheIndex.cpp | 10 +++++----- stepmania/src/SongCacheIndex.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stepmania/src/SongCacheIndex.cpp b/stepmania/src/SongCacheIndex.cpp index 162a4ba146..cbc3154bf0 100644 --- a/stepmania/src/SongCacheIndex.cpp +++ b/stepmania/src/SongCacheIndex.cpp @@ -39,16 +39,16 @@ void SongCacheIndex::ReadCacheIndex() 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", path, hash ); + CacheIndex.SetValueU( "Cache", path, hash ); CacheIndex.WriteFile(); } -int SongCacheIndex::GetCacheHash( const CString &path ) +unsigned SongCacheIndex::GetCacheHash( const CString &path ) const { - int iDirHash; - CacheIndex.GetValueI( "Cache", path, iDirHash ); + unsigned iDirHash; + CacheIndex.GetValueU( "Cache", path, iDirHash ); return iDirHash; } diff --git a/stepmania/src/SongCacheIndex.h b/stepmania/src/SongCacheIndex.h index 445765ab8c..d05902002d 100644 --- a/stepmania/src/SongCacheIndex.h +++ b/stepmania/src/SongCacheIndex.h @@ -10,8 +10,8 @@ public: ~SongCacheIndex(); void ReadCacheIndex(); - void AddCacheIndex( const CString &path, int hash ); - int GetCacheHash( const CString &path ); + void AddCacheIndex( const CString &path, unsigned hash ); + unsigned GetCacheHash( const CString &path ) const; }; extern SongCacheIndex *SONGINDEX; // global and accessable from anywhere in our program