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