]> git.ipfire.org Git - people/ms/gcc.git/commit
libstdc++: Simplify print_raw function for debug assertions
authorJonathan Wakely <jwakely@redhat.com>
Wed, 12 Oct 2022 10:59:33 +0000 (11:59 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 14 Oct 2022 14:35:41 +0000 (15:35 +0100)
commitcf0b7e9787c3686c47219a725f2cbcaa19faaaca
tree5b19a06450361b90b0a5099364e8a3900f08350b
parent823e9097f70eb95ef09fde357aebd071aec311d9
libstdc++: Simplify print_raw function for debug assertions

Replace two uses of print_raw where it's clearer to just use fprintf
directly. Then the only remaining use of print_raw is as the print_func
argument of pretty_print. When called by pretty_print the count is
either a positive integer or -1, so we can simplify print_raw itself.

Remove the default argument, because it's never used. Remove the check
for nbc == 0, which never happens (but would be harmless if it did).
Replace the conditional expression with a single call to fprintf, using
INT_MAX as the maximum length.

libstdc++-v3/ChangeLog:

* src/c++11/debug.cc (print_raw): Simplify.
(print_word): Print indentation by calling fprintf directly.
(_Error_formatter::_M_error): Print unindented string by calling
fprintf directly.
libstdc++-v3/src/c++11/debug.cc