[RFA,1/4] Make c_type_print_varspec_suffix static

Message ID 20180417195125.14200-2-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey April 17, 2018, 7:51 p.m. UTC
  I noticed that c_type_print_varspec_suffix is only called from
c-typeprint.c, so this patch makes it "static".

ChangeLog
2018-04-17  Tom Tromey  <tom@tromey.com>

	* typeprint.h (c_type_print_varspec_suffix): Don't declare.
	* c-typeprint.c (c_type_print_varspec_suffix): Now static.
---
 gdb/ChangeLog     | 5 +++++
 gdb/c-typeprint.c | 6 +++++-
 gdb/typeprint.h   | 3 ---
 3 files changed, 10 insertions(+), 4 deletions(-)
  

Comments

Joel Brobecker May 31, 2018, 1:05 a.m. UTC | #1
Hi Tom,

On Tue, Apr 17, 2018 at 01:51:22PM -0600, Tom Tromey wrote:
> I noticed that c_type_print_varspec_suffix is only called from
> c-typeprint.c, so this patch makes it "static".
> 
> ChangeLog
> 2018-04-17  Tom Tromey  <tom@tromey.com>
> 
> 	* typeprint.h (c_type_print_varspec_suffix): Don't declare.
> 	* c-typeprint.c (c_type_print_varspec_suffix): Now static.

So very sorry again for how long it's taking to review your patches.
This one is fairly clearly an improvement on its own, so approved.
  

Patch

diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 1a8af78669..e26687ba25 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -50,6 +50,10 @@  enum access_specifier
   s_protected
 };
 
+static void c_type_print_varspec_suffix (struct type *, struct ui_file *, int,
+					 int, int,
+					 const struct type_print_options *);
+
 static void c_type_print_varspec_prefix (struct type *,
 					 struct ui_file *,
 					 int, int, int,
@@ -716,7 +720,7 @@  remove_qualifiers (char *qid)
    needed after the variable name (to describe its type).
    Args work like c_type_print_varspec_prefix.  */
 
-void
+static void
 c_type_print_varspec_suffix (struct type *type,
 			     struct ui_file *stream,
 			     int show, int passed_a_ptr,
diff --git a/gdb/typeprint.h b/gdb/typeprint.h
index 895eebd50a..74006b3058 100644
--- a/gdb/typeprint.h
+++ b/gdb/typeprint.h
@@ -120,9 +120,6 @@  private:
 
 void print_type_scalar (struct type * type, LONGEST, struct ui_file *);
 
-void c_type_print_varspec_suffix (struct type *, struct ui_file *, int,
-				  int, int, const struct type_print_options *);
-
 void c_type_print_args (struct type *, struct ui_file *, int, enum language,
 			const struct type_print_options *);