unsigned -> size_t for string::find returns
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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 )
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ void TitleSubst::Load(const CString &filename, const CString §ion)
|
|||||||
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() );
|
||||||
|
|||||||
Reference in New Issue
Block a user