Fix for re-arm buffer overrun warning on logging restart.

This commit is contained in:
mjbudd77 2021-04-27 06:45:54 -04:00
parent 4afb2ac2ac
commit 0006cb265d
1 changed files with 5 additions and 20 deletions

View File

@ -106,7 +106,6 @@ static int oldcodecount = 0, olddatacount = 0;
static traceRecord_t *recBuf = NULL; static traceRecord_t *recBuf = NULL;
static int recBufMax = 0; static int recBufMax = 0;
static int recBufHead = 0; static int recBufHead = 0;
static int recBufTail = 0;
static traceRecord_t *logBuf = NULL; static traceRecord_t *logBuf = NULL;
static int logBufMax = 3000000; static int logBufMax = 3000000;
static int logBufHead = 0; static int logBufHead = 0;
@ -384,24 +383,10 @@ void TraceLoggerDialog_t::updatePeriodic(void)
traceViewDrawEnable = 0; traceViewDrawEnable = 0;
} }
//if (logFileCbox->isChecked()) if ( !logging || !logFileCbox->isChecked())
//{ {
// //char line[256]; overrunWarningArmed = true;
}
// //while (recBufHead != recBufTail)
// //{
// // recBuf[recBufTail].convToText(line);
// // fprintf(logFile, "%s\n", line);
// // recBufTail = (recBufTail + 1) % recBufMax;
// //}
//}
//else
//{
// recBufTail = recBufHead;
// overrunWarningArmed = true;
//}
if (traceViewCounter > 5) if (traceViewCounter > 5)
{ {
@ -1019,7 +1004,7 @@ int initTraceLogBuffer(int maxRecs)
{ {
recBufMax = 0; recBufMax = 0;
} }
recBufHead = recBufTail = 0; recBufHead = 0;
} }
return recBuf == NULL; return recBuf == NULL;
} }