Fix minor windows pedantic warnings.

This commit is contained in:
Jason Felds
2016-03-27 22:03:15 -04:00
parent 534909d30a
commit bec18a0d36
31 changed files with 173 additions and 67 deletions
+10 -2
View File
@@ -881,7 +881,7 @@ void split( const wstring &sSource, const wstring &sDelimitor, vector<wstring> &
RString str="a,b,c";
int start = 0, size = -1;
while( 1 )
for(;;)
{
do_split( str, ",", start, size );
if( start == str.size() )
@@ -2379,24 +2379,30 @@ bool FileCopy( const RString &sSrcFile, const RString &sDstFile )
bool FileCopy( RageFileBasic &in, RageFileBasic &out, RString &sError, bool *bReadError )
{
while(1)
for(;;)
{
RString data;
if( in.Read(data, 1024*32) == -1 )
{
sError = ssprintf( "read error: %s", in.GetError().c_str() );
if( bReadError != NULL )
{
*bReadError = true;
}
return false;
}
if( data.empty() )
{
break;
}
int i = out.Write(data);
if( i == -1 )
{
sError = ssprintf( "write error: %s", out.GetError().c_str() );
if( bReadError != NULL )
{
*bReadError = false;
}
return false;
}
}
@@ -2405,7 +2411,9 @@ bool FileCopy( RageFileBasic &in, RageFileBasic &out, RString &sError, bool *bRe
{
sError = ssprintf( "write error: %s", out.GetError().c_str() );
if( bReadError != NULL )
{
*bReadError = false;
}
return false;
}