cleanup
This commit is contained in:
@@ -382,26 +382,25 @@ static const char *GetCheckpointLog( int slotno, int lineno )
|
||||
return slot.ThreadFormattedOutput;
|
||||
}
|
||||
|
||||
const char *Checkpoints::GetLogs( const char *delim )
|
||||
/* XXX: iSize check unimplemented */
|
||||
void Checkpoints::GetLogs( char *pBuf, int iSize, const char *delim )
|
||||
{
|
||||
static char ret[1024*32];
|
||||
ret[0] = 0;
|
||||
pBuf[0] = 0;
|
||||
|
||||
for( int slotno = 0; slotno < MAX_THREADS; ++slotno )
|
||||
{
|
||||
const char *buf = GetCheckpointLog( slotno, 0 );
|
||||
if( buf == NULL )
|
||||
continue;
|
||||
strcat( ret, buf );
|
||||
strcat( ret, delim );
|
||||
strcat( pBuf, buf );
|
||||
strcat( pBuf, delim );
|
||||
|
||||
for( int line = 1; (buf = GetCheckpointLog( slotno, line )) != NULL; ++line )
|
||||
{
|
||||
strcat( ret, buf );
|
||||
strcat( ret, delim );
|
||||
strcat( pBuf, buf );
|
||||
strcat( pBuf, delim );
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Checkpoints
|
||||
{
|
||||
void LogCheckpoints( bool yes=true );
|
||||
void SetCheckpoint( const char *file, int line, const char *message );
|
||||
const char *GetLogs( const char *delim );
|
||||
void GetLogs( char *pBuf, int iSize, const char *delim );
|
||||
};
|
||||
|
||||
#define CHECKPOINT (Checkpoints::SetCheckpoint(__FILE__, __LINE__, NULL))
|
||||
|
||||
Reference in New Issue
Block a user