Fix some issues with formatted_print:

* Add a va_list version which can be correctly used by ivprintf (fixes pycdas output)
* Use a `const char*` format parameter to avoid the need for clang warning workarounds
* Make better use of return values.
This commit is contained in:
Michael Hansen
2023-06-05 13:49:04 -07:00
parent 482c32d84e
commit 8bb8386764
4 changed files with 26 additions and 18 deletions

View File

@@ -58,11 +58,12 @@ static void iputs(std::ostream& pyc_output, int indent, const char* text)
pyc_output << text;
}
static void ivprintf(std::ostream& pyc_output, int indent, const char* fmt, va_list varargs)
static void ivprintf(std::ostream& pyc_output, int indent, const char* fmt,
va_list varargs)
{
for (int i=0; i<indent; i++)
pyc_output << " ";
formatted_print(pyc_output, fmt, varargs);
formatted_printv(pyc_output, fmt, varargs);
}
static void iprintf(std::ostream& pyc_output, int indent, const char* fmt, ...)