aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-02 11:42:07 -0700
committerTom Tromey <tom@tromey.com>2022-03-29 12:46:24 -0600
commita11ac3b3e8ff6769badcf0041894f6c5acc1b94f (patch)
tree09cfacc40b2fbe929ca0013869915ddce49378ba /gdb/utils.c
parent0426ad513f93bb1c5805988e60d6f87fbe738860 (diff)
downloadgdb-a11ac3b3e8ff6769badcf0041894f6c5acc1b94f.zip
gdb-a11ac3b3e8ff6769badcf0041894f6c5acc1b94f.tar.gz
gdb-a11ac3b3e8ff6769badcf0041894f6c5acc1b94f.tar.bz2
Unify gdb putc functions
Now that filtered and unfiltered output can be treated identically, we can unify the putc family of functions. This is done under the name "gdb_putc". Most of this patch was written by script.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 2124b4b..21fb7d6 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1765,7 +1765,7 @@ fputs_highlighted (const char *str, const compiled_regex &highlight,
/* Output the part before pmatch with current style. */
while (pmatch.rm_so > 0)
{
- fputc_filtered (*str, stream);
+ gdb_putc (*str, stream);
pmatch.rm_so--;
str++;
}
@@ -1774,7 +1774,7 @@ fputs_highlighted (const char *str, const compiled_regex &highlight,
stream->emit_style_escape (highlight_style.style ());
while (n_highlight > 0)
{
- fputc_filtered (*str, stream);
+ gdb_putc (*str, stream);
n_highlight--;
str++;
}
@@ -1790,31 +1790,15 @@ fputs_highlighted (const char *str, const compiled_regex &highlight,
May return nonlocally. */
int
-putchar_filtered (int c)
+gdb_putc (int c)
{
- return fputc_filtered (c, gdb_stdout);
+ return gdb_stdout->putc (c);
}
int
-fputc_unfiltered (int c, struct ui_file *stream)
+gdb_putc (int c, struct ui_file *stream)
{
- char buf[2];
-
- buf[0] = c;
- buf[1] = 0;
- gdb_puts (buf, stream);
- return c;
-}
-
-int
-fputc_filtered (int c, struct ui_file *stream)
-{
- char buf[2];
-
- buf[0] = c;
- buf[1] = 0;
- gdb_puts (buf, stream);
- return c;
+ return stream->putc (c);
}
void