From 9cef4460d446b7946792dcba6bdd486682f08755 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 10 Dec 2003 07:27:18 +0000 Subject: [PATCH] fix g++ compile --- stepmania/src/RageUtil_FileDB.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index be3dcdee0f..df557999f1 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -296,11 +296,16 @@ File *FilenameDB::GetFile( const CString &sPath ) SplitPath(sPath, Dir, Name); FileSet &fs = GetFileSet( Dir ); - set::iterator i = fs.files.find( File(Name) ); - if(i == fs.files.end()) + set::iterator it; + it = fs.files.find( File(Name) ); + if( it == fs.files.end() ) return NULL; - return &*i; + /* Oops. &*it is a const File &, because you can't change the order + * of something once it's in a list. Cast away the const; we won't + * change the filename (used for the ordering), but the rest of the + * values are non-const. */ + return const_cast (&*it); }