Cleanup.
This commit is contained in:
@@ -46,15 +46,18 @@ void MsdFile::ReadBuf( char *buf, int len )
|
||||
if( i+1 < len && buf[i] == '/' && buf[i+1] == '/' )
|
||||
{
|
||||
/* //; erase with spaces until newline */
|
||||
do {
|
||||
do
|
||||
{
|
||||
buf[i] = ' ';
|
||||
i++;
|
||||
} while(i < len && buf[i] != '\n');
|
||||
}
|
||||
while( i < len && buf[i] != '\n' );
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if(ReadingValue && buf[i] == '#') {
|
||||
if( ReadingValue && buf[i] == '#' )
|
||||
{
|
||||
/* Unfortunately, many of these files are missing ;'s.
|
||||
* If we get a # when we thought we were inside a value, assume we
|
||||
* missed the ;. Back up and end the value. */
|
||||
@@ -70,7 +73,8 @@ void MsdFile::ReadBuf( char *buf, int len )
|
||||
break;
|
||||
}
|
||||
|
||||
if(!FirstChar) {
|
||||
if( !FirstChar )
|
||||
{
|
||||
/* Oops, we're not; handle this like a regular character. */
|
||||
i++;
|
||||
continue;
|
||||
@@ -85,7 +89,8 @@ void MsdFile::ReadBuf( char *buf, int len )
|
||||
}
|
||||
|
||||
/* # starts a new value. */
|
||||
if(!ReadingValue && buf[i] == '#') {
|
||||
if( !ReadingValue && buf[i] == '#' )
|
||||
{
|
||||
AddValue();
|
||||
ReadingValue=true;
|
||||
}
|
||||
@@ -160,8 +165,8 @@ void MsdFile::ReadFromString( const RString &sString )
|
||||
|
||||
RString MsdFile::GetParam(unsigned val, unsigned par) const
|
||||
{
|
||||
if(val >= GetNumValues()) return RString();
|
||||
if(par >= GetNumParams(val)) return RString();
|
||||
if( val >= GetNumValues() || par >= GetNumParams(val) )
|
||||
return RString();
|
||||
|
||||
return values[val].params[par];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user