aboutsummaryrefslogtreecommitdiff
path: root/gdb/m2-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-02 11:36:44 -0700
committerTom Tromey <tom@tromey.com>2022-03-29 12:46:24 -0600
commit0426ad513f93bb1c5805988e60d6f87fbe738860 (patch)
tree6ad0f94f9b2a907623df38db9dd7727fe80f5d51 /gdb/m2-lang.c
parent19a7b8ab871b92dee32a0ebffe274388d3426564 (diff)
downloadgdb-0426ad513f93bb1c5805988e60d6f87fbe738860.zip
gdb-0426ad513f93bb1c5805988e60d6f87fbe738860.tar.gz
gdb-0426ad513f93bb1c5805988e60d6f87fbe738860.tar.bz2
Unify gdb puts functions
Now that filtered and unfiltered output can be treated identically, we can unify the puts family of functions. This is done under the name "gdb_puts". Most of this patch was written by script.
Diffstat (limited to 'gdb/m2-lang.c')
-rw-r--r--gdb/m2-lang.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 7673426..bc82bc5 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -145,9 +145,9 @@ void
m2_language::printchar (int c, struct type *type,
struct ui_file *stream) const
{
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
emitchar (c, type, stream, '\'');
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
}
/* See language.h. */
@@ -165,7 +165,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
if (length == 0)
{
- puts_filtered ("\"\"");
+ gdb_puts ("\"\"");
return;
}
@@ -181,7 +181,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
if (need_comma)
{
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
need_comma = 0;
}
@@ -197,7 +197,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
{
if (in_quotes)
{
- fputs_filtered ("\", ", stream);
+ gdb_puts ("\", ", stream);
in_quotes = 0;
}
printchar (string[i], elttype, stream);
@@ -210,7 +210,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
{
if (!in_quotes)
{
- fputs_filtered ("\"", stream);
+ gdb_puts ("\"", stream);
in_quotes = 1;
}
emitchar (string[i], elttype, stream, '"');
@@ -220,10 +220,10 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
/* Terminate the quotes if necessary. */
if (in_quotes)
- fputs_filtered ("\"", stream);
+ gdb_puts ("\"", stream);
if (force_ellipses || i < length)
- fputs_filtered ("...", stream);
+ gdb_puts ("...", stream);
}
/* See language.h. */
@@ -237,7 +237,7 @@ m2_language::emitchar (int ch, struct type *chtype,
if (PRINT_LITERAL_FORM (ch))
{
if (ch == '\\' || ch == quoter)
- fputs_filtered ("\\", stream);
+ gdb_puts ("\\", stream);
fprintf_filtered (stream, "%c", ch);
}
else
@@ -245,25 +245,25 @@ m2_language::emitchar (int ch, struct type *chtype,
switch (ch)
{
case '\n':
- fputs_filtered ("\\n", stream);
+ gdb_puts ("\\n", stream);
break;
case '\b':
- fputs_filtered ("\\b", stream);
+ gdb_puts ("\\b", stream);
break;
case '\t':
- fputs_filtered ("\\t", stream);
+ gdb_puts ("\\t", stream);
break;
case '\f':
- fputs_filtered ("\\f", stream);
+ gdb_puts ("\\f", stream);
break;
case '\r':
- fputs_filtered ("\\r", stream);
+ gdb_puts ("\\r", stream);
break;
case '\033':
- fputs_filtered ("\\e", stream);
+ gdb_puts ("\\e", stream);
break;
case '\007':
- fputs_filtered ("\\a", stream);
+ gdb_puts ("\\a", stream);
break;
default:
fprintf_filtered (stream, "\\%.3o", (unsigned int) ch);