unsigned -> size_t for string::find returns

This commit is contained in:
Glenn Maynard
2004-06-16 07:03:25 +00:00
parent 47d43cee82
commit 85cbccad56
6 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -319,7 +319,7 @@ void ReplaceText( CString &Text, const map<CString,CString> &m )
size_t start = 0; size_t start = 0;
while(1) while(1)
{ {
unsigned pos = txt.find(it->first, start); size_t pos = txt.find(it->first, start);
if(pos == txt.npos) if(pos == txt.npos)
break; break;
+1 -1
View File
@@ -516,7 +516,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
if( value_name == "#title" ) if( value_name == "#title" )
{ {
// strip Steps type out of description leaving only song title - looks like 'B4U <BASIC>' // strip Steps type out of description leaving only song title - looks like 'B4U <BASIC>'
unsigned iIndex = value_data.find_last_of('<'); size_t iIndex = value_data.find_last_of('<');
if( iIndex == value_data.npos ) if( iIndex == value_data.npos )
iIndex = value_data.find_last_of('('); iIndex = value_data.find_last_of('(');
if( iIndex != value_data.npos ) if( iIndex != value_data.npos )
+3 -3
View File
@@ -484,14 +484,14 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
* to pick up images used here as song images (eg. banners). */ * to pick up images used here as song images (eg. banners). */
CString param = sParams[1]; CString param = sParams[1];
/* "{foo} ... {foo2}" */ /* "{foo} ... {foo2}" */
unsigned pos = 0; size_t pos = 0;
while( pos < CString::npos ) while( pos < CString::npos )
{ {
unsigned startpos = param.find('{', pos); size_t startpos = param.find('{', pos);
if( startpos == CString::npos ) if( startpos == CString::npos )
break; break;
unsigned endpos = param.find('}', startpos); size_t endpos = param.find('}', startpos);
if( endpos == CString::npos ) if( endpos == CString::npos )
break; break;
+1 -1
View File
@@ -60,7 +60,7 @@ void ScreenTestSound::UpdateText(int n)
{ {
CString fn = s[n].s.GetLoadedFilePath(); CString fn = s[n].s.GetLoadedFilePath();
unsigned x = fn.find_last_of("/\\"); size_t x = fn.find_last_of("/\\");
if(x != fn.npos) fn.erase(0, x+1); if(x != fn.npos) fn.erase(0, x+1);
vector<RageSound *> snds; vector<RageSound *> snds;
+1 -1
View File
@@ -143,7 +143,7 @@ void TitleSubst::Load(const CString &filename, const CString &section)
continue; continue;
} }
unsigned pos = line.find_first_of(':'); size_t pos = line.find_first_of(':');
if(pos != string::npos) if(pos != string::npos)
{ {
/* x: y */ /* x: y */
@@ -7,7 +7,7 @@
* the HKEY_LOCAL_MACHINE constant in key. */ * the HKEY_LOCAL_MACHINE constant in key. */
static bool GetRegKeyType( const CString &in, CString &out, HKEY &key ) static bool GetRegKeyType( const CString &in, CString &out, HKEY &key )
{ {
unsigned backslash = in.find( '\\' ); size_t backslash = in.find( '\\' );
if( backslash == in.npos ) if( backslash == in.npos )
{ {
LOG->Warn( "Invalid registry key: \"%s\" ", in.c_str() ); LOG->Warn( "Invalid registry key: \"%s\" ", in.c_str() );