compiler warnings

This commit is contained in:
James Cherry 2021-01-03 15:35:14 -08:00
parent abb0243c87
commit ce8aa3ba41
3 changed files with 11 additions and 3 deletions

View File

@ -125,7 +125,7 @@ protected:
// Primitive to print output on the console.
// Return the number of characters written.
virtual size_t printConsole(const char *buffer,
size_t length) = 0;
size_t length);
void printToBuffer(const char *fmt,
...)
__attribute__((format (printf, 2, 3)));

View File

@ -109,7 +109,7 @@ Debug::reportLine(const char *what,
{
va_list args;
va_start(args, fmt);
report_->printToBuffer(what);
report_->printToBuffer("%s", what);
report_->printToBufferAppend(": ");
report_->printToBufferAppend(fmt, args);
report_->printBufferLine();

View File

@ -44,6 +44,14 @@ Report::~Report()
delete [] buffer_;
}
size_t
Report::printConsole(const char *buffer,
size_t length)
{
printf("%s", buffer);
return length;
}
void
Report::printLine(const char *line,
size_t length)
@ -276,7 +284,7 @@ Report::fileCritical(int /* id */,
{
va_list args;
va_start(args, fmt);
printToBuffer("Critical: %s line %d, ", filename, line, fmt, args);
printToBuffer("Critical: %s line %d, ", filename, line);
printToBufferAppend(fmt, args);
printBufferLine();
va_end(args);