From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id B720A385741A; Fri, 15 Apr 2022 17:54:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B720A385741A Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Return void from gdb_putc X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 111d19818a4a7c96c87e330c6c143fa03bb86819 X-Git-Newrev: 4311246bb1f94ca323b0cf74e917d2b8d3a87565 Message-Id: <20220415175404.B720A385741A@sourceware.org> Date: Fri, 15 Apr 2022 17:54:04 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2022 17:54:04 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4311246bb1f9= 4ca323b0cf74e917d2b8d3a87565 commit 4311246bb1f94ca323b0cf74e917d2b8d3a87565 Author: Tom Tromey Date: Fri Apr 1 19:04:48 2022 -0600 Return void from gdb_putc =20 I don't think it's very useful to return the character from gdb_putc, so this patch changes it to return void. Diff: --- gdb/ui-file.c | 3 +-- gdb/ui-file.h | 2 +- gdb/utils.c | 7 ++----- gdb/utils.h | 4 ++-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gdb/ui-file.c b/gdb/ui-file.c index afb12b408f5..47044e42a67 100644 --- a/gdb/ui-file.c +++ b/gdb/ui-file.c @@ -60,12 +60,11 @@ ui_file::putstrn (const char *str, int n, int quoter, b= ool async_safe) printchar (str[i], quoter, async_safe); } =20 -int +void ui_file::putc (int c) { char copy =3D (char) c; write (©, 1); - return c; } =20 void diff --git a/gdb/ui-file.h b/gdb/ui-file.h index 4c9ce1aaa0c..e33ae79e753 100644 --- a/gdb/ui-file.h +++ b/gdb/ui-file.h @@ -51,7 +51,7 @@ public: write_async_safe method. */ void putstrn (const char *str, int n, int quoter, bool async_safe =3D fa= lse); =20 - int putc (int c); + void putc (int c); =20 void vprintf (const char *, va_list) ATTRIBUTE_PRINTF (2, 0); =20 diff --git a/gdb/utils.c b/gdb/utils.c index 2465bf3a3ed..f9dc4f23431 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1838,16 +1838,13 @@ fputs_highlighted (const char *str, const compiled_= regex &highlight, gdb_puts (str, stream); } =20 -/* Write character C to gdb_stdout using GDB's paging mechanism and return= C. - May return nonlocally. */ - -int +void gdb_putc (int c) { return gdb_stdout->putc (c); } =20 -int +void gdb_putc (int c, struct ui_file *stream) { return stream->putc (c); diff --git a/gdb/utils.h b/gdb/utils.h index c1ac85497bf..7e2028580bf 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -224,9 +224,9 @@ extern void set_screen_width_and_height (int width, int= height); =20 extern void gdb_puts (const char *, struct ui_file *); =20 -extern int gdb_putc (int c, struct ui_file *); +extern void gdb_putc (int c, struct ui_file *); =20 -extern int gdb_putc (int c); +extern void gdb_putc (int c); =20 extern void gdb_puts (const char *);