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