diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index 5b73a5a5ce..87891ef7a5 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -438,9 +438,9 @@ void Font::GetFontPaths(const CString &sFontOrTextureFilePath, CString Font::GetPageNameFromFileName(const CString &fn) { - unsigned begin = fn.find_first_of('['); + size_t begin = fn.find_first_of('['); if(begin == fn.npos) return "main"; - unsigned end = fn.find_first_of(']', begin); + size_t end = fn.find_first_of(']', begin); if(end == fn.npos) return "main"; begin++; end--; if(end == begin) return "main"; diff --git a/stepmania/src/FontCharAliases.cpp b/stepmania/src/FontCharAliases.cpp index 08de3c57fc..86c2517094 100644 --- a/stepmania/src/FontCharAliases.cpp +++ b/stepmania/src/FontCharAliases.cpp @@ -316,7 +316,7 @@ void ReplaceText( CString &Text, const map &m ) for(map::const_iterator it = m.begin(); it != m.end(); ++it) { - unsigned start = 0; + size_t start = 0; while(1) { unsigned pos = txt.find(it->first, start); diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index 397fa2dbcb..800411f50d 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -91,7 +91,7 @@ static CString GetDirOfExecutable( CString argv0 ) #endif // strip off executable name - unsigned n = sPath.find_last_of("/"); + size_t n = sPath.find_last_of("/"); if( n != sPath.npos ) sPath.erase(n); else diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 48f114249a..7bed6300d6 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -255,10 +255,10 @@ CString join( const CString &Delimitor, CStringArray::const_iterator begin, CStr template void do_split( const S &Source, const S &Delimitor, vector &AddIt, const bool bIgnoreEmpty ) { - unsigned startpos = 0; + size_t startpos = 0; do { - unsigned pos; + size_t pos; if( Delimitor.size() == 1 ) pos = Source.find( Delimitor[0], startpos ); else @@ -323,7 +323,7 @@ void do_split( const S &Source, const S &Delimitor, int &begin, int &size, int l /* Where's the string function to find within a substring? C++ strings apparently * are missing that ... */ - unsigned pos; + size_t pos; if( Delimitor.size() == 1 ) pos = Source.find( Delimitor[0], begin ); else @@ -400,11 +400,11 @@ CString SetExtension( const CString &path, const CString &ext ) CString GetExtension( const CString &sPath ) { - unsigned pos = sPath.rfind( '.' ); + size_t pos = sPath.rfind( '.' ); if( pos == sPath.npos ) return ""; - unsigned slash = sPath.find( '/', pos ); + size_t slash = sPath.find( '/', pos ); if( slash != sPath.npos ) return ""; /* rare: path/dir.ext/fn */ @@ -1007,7 +1007,7 @@ void Replace_Unicode_Markers( CString &Text ) { /* Look for &#digits; */ bool hex = false; - unsigned pos = Text.find("&#", start); + size_t pos = Text.find("&#", start); if(pos == Text.npos) { hex = true; pos = Text.find("&x", start); @@ -1058,11 +1058,11 @@ CString WcharDisplayText(wchar_t c) */ CString Basename( const CString &dir ) { - unsigned end = dir.find_last_not_of( "/\\" ); + size_t end = dir.find_last_not_of( "/\\" ); if( end == dir.npos ) return ""; - unsigned start = dir.find_last_of( "/\\", end ); + size_t start = dir.find_last_of( "/\\", end ); if( start == dir.npos ) start = 0; else diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index bd3abc1df4..6c169438cd 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -31,7 +31,7 @@ void FileSet::GetFilesMatching(const CString &beginning, const CString &containi * search instead of string match). */ if(containing.size()) { - unsigned pos = i->name.find(containing, beginning.size()); + size_t pos = i->name.find(containing, beginning.size()); if(pos == i->name.npos) continue; /* doesn't contain it */ if(pos + containing.size() > unsigned(end_pos)) continue; /* found it but it overlaps with the end */ } @@ -87,7 +87,7 @@ static void SplitPath( CString Path, CString &Dir, CString &Name ) if( Path.Right(1) == "/" ) Path.erase( Path.size()-1 ); - unsigned sep = Path.find_last_of( '/' ); + size_t sep = Path.find_last_of( '/' ); if( sep == CString::npos ) { Dir = ""; @@ -196,13 +196,13 @@ void FilenameDB::GetFilesEqualTo(const CString &dir, const CString &fn, vector &out, bool bOnlyDirs) { /* Does this contain a wildcard? */ - unsigned first_pos = fn.find_first_of('*'); + size_t first_pos = fn.find_first_of('*'); if(first_pos == fn.npos) { /* No; just do a regular search. */ GetFilesEqualTo(dir, fn, out, bOnlyDirs); } else { - unsigned second_pos = fn.find_first_of('*', first_pos+1); + size_t second_pos = fn.find_first_of('*', first_pos+1); if(second_pos == fn.npos) { /* Only one *: "A*B". */ @@ -392,7 +392,7 @@ void FilenameDB::GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDi ASSERT(!sPath.empty()); /* Strip off the last path element and use it as a mask. */ - unsigned pos = sPath.find_last_of( '/' ); + size_t pos = sPath.find_last_of( '/' ); CString fn; if( pos == sPath.npos ) { diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 41c730ad28..61c98c6092 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -352,7 +352,7 @@ static void GetImageDirListing( CString sPath, CStringArray &AddTo, bool bReturn static CString RemoveInitialWhitespace( CString s ) { - unsigned i = s.find_first_not_of(" \t\r\n"); + size_t i = s.find_first_not_of(" \t\r\n"); if( i != s.npos ) s.erase( 0, i ); return s; diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 1623113174..3832c11e92 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -847,7 +847,7 @@ bool GetCommandlineArgument( const CString &option, CString *argument, int iInde { const CString CurArgument = g_argv[arg]; - const unsigned i = CurArgument.find( "=" ); + const size_t i = CurArgument.find( "=" ); CString CurOption = CurArgument.substr(0,i); if( CurOption.CompareNoCase(optstr) ) continue; /* no match */